123456789101112131415161718192021222324252627282930313233343536373839404142 |
- #pragma once
- #include <Array.h>
- #include "ItemStack.h"
- #include "ItemFilter.h"
- #include "ItemSlot.h"
- #include "Inventory.h"
- class CraftingStorage
- {
- public:
- virtual bool isAllAvailable(Framework::RCArray<ItemFilter>& filters, Framework::Array<int>& inputAmount) = 0;
- virtual bool hasFreeSpace(const Item* zItem, int amount) = 0;
- virtual bool consume(Framework::RCArray<ItemFilter>& filters, Framework::Array<int>& inputAmount) = 0;
- virtual void addCraftingResult(ItemStack* stack) = 0;
- };
- class ShapedCraftingStorage
- {
- public:
- virtual bool isAllAvailable(Framework::RCArray<ItemFilter>& filters, int width, int height) = 0;
- virtual bool hasFreeSpace(const Item* zItem, int amount) = 0;
- virtual bool consume(Framework::RCArray<ItemFilter>& filters, int width, int height) = 0;
- virtual void addCraftingResult(ItemStack* stack) = 0;
- };
- class BasicShapedCrafter : public ShapedCraftingStorage
- {
- private:
- Framework::Array<ItemSlot*> craftingInput;
- Inventory* zInventory;
- int width;
- int height;
- public:
- BasicShapedCrafter(int width, int height, Inventory* zInventory);
- virtual bool isAllAvailable(Framework::RCArray<ItemFilter>& filters, int width, int height);
- virtual bool hasFreeSpace(const Item* zItem, int amount);
- virtual bool consume(Framework::RCArray<ItemFilter>& filters, int width, int height);
- virtual void addCraftingResult(ItemStack* stack);
- };
|