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