12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- #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);
- };
|