123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- #pragma once
- #include <Array.h>
- #include <JSON.h>
- #include "ItemFilter.h"
- class CraftingStorage;
- class ShapedCraftingStorage;
- struct ItemInfo
- {
- int type;
- int count;
- float damage;
- float maxDamage;
- 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;
- int width;
- int height;
- Item* output;
- int outputAmount;
- public:
- ShapedRecipie(int width, int height);
- ~ShapedRecipie();
- void setIngredient(int x, int y, ItemFilter* filter);
- void setOutput(Item* item, int amount);
- bool testApplicability(ShapedCraftingStorage* zStorage);
- void apply(ShapedCraftingStorage* zStorage);
- Framework::Array<ItemInfo> getOutput(ShapedCraftingStorage* zStorage);
- };
|