1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- #pragma once
- #include <Array.h>
- #include <JSON.h>
- #include "ItemFilter.h"
- #include "ItemModifier.h"
- class CraftingStorage;
- class ShapedCraftingStorage;
- struct ItemInfo
- {
- int type;
- int count;
- float hp;
- float maxHp;
- float durability;
- float maxDurability;
- };
- class Recipie : public virtual Framework::ReferenceCounter
- {
- private:
- Framework::RCArray<ItemFilter> filters;
- Framework::Array<int> inputAmount;
- Framework::RCArray<Item> outputs;
- Framework::Array<int> outputAmount;
- public:
- Recipie();
- void addIngredient(ItemFilter* filter, int amount);
- void addOutput(Item* item, int amount);
- bool testApplicability(CraftingStorage* zStorage);
- void apply(CraftingStorage* zStorage);
- };
- class ShapedRecipie : public virtual Framework::ReferenceCounter
- {
- private:
- Framework::RCArray<ItemFilter> filters;
- Framework::RCArray<ItemModifier> modifiers;
- int width;
- int height;
- Item* output;
- int outputAmount;
- public:
- ShapedRecipie(int width, int height);
- ~ShapedRecipie();
- void setIngredient(
- int x, int y, ItemFilter* filter, ItemModifier* modifier);
- void setOutput(Item* item, int amount);
- bool testApplicability(ShapedCraftingStorage* zStorage);
- void apply(ShapedCraftingStorage* zStorage);
- Framework::Array<ItemInfo> getOutput(ShapedCraftingStorage* zStorage);
- };
|