123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- #pragma once
- #include <Text.h>
- #include <JSON.h>
- #include <Trie.h>
- #include <Writer.h>
- #include "Effect.h"
- #include "StaticRegistry.h"
- #include "ModelInfo.h"
- class Item;
- class ItemStack;
- class ItemSkill;
- class ItemSkillLevelUpRule;
- class ItemType : public virtual Framework::ReferenceCounter
- {
- protected:
- const int id;
- const Framework::Text name;
- ItemSkillLevelUpRule* levelUpRule;
- const ItemType* zBrokenType;
- const ModelInfo model;
- ItemType(int id, const char* name, ItemSkillLevelUpRule* levelUpRule, const ItemType* zBrokenType, ModelInfo model);
- virtual void loadSuperItem(Item* zItem, Framework::StreamReader* zReader) const;
- virtual void saveSuperItem(const Item* zItem, Framework::StreamWriter* zWriter) const;
- virtual void loadSuperItemSkill(ItemSkill* zSkill, Framework::StreamReader* zReader) const;
- virtual void saveSuperItemSkill(const ItemSkill* zSkill, Framework::StreamWriter* zWriter) const;
- Item* createBasicItem(const char* name, float damage, float maxDamage, float durability, float maxDurability, bool eatable, bool placeable, bool equippable, bool solid, bool usable, int maxStackSize) const;
- public:
- ~ItemType();
- int getId() const;
- const Framework::Text& getName() const;
- const ItemType* zBrokenItemType() const;
- virtual Item* createItem() const = 0;
- virtual ItemStack* createItemStack(int size) const;
- virtual ItemSkill* createDefaultItemSkill() const;
- virtual void levelUpItemSkill(ItemSkill* zSkill) const;
- virtual Item* loadItem(Framework::StreamReader* zReader) const;
- virtual void saveItem(const Item* zItem, Framework::StreamWriter* zWriter) const;
- virtual ItemSkill* loadItemSkill(Framework::StreamReader* zReader) const;
- virtual void saveItemSkill(const ItemSkill* zSkill, Framework::StreamWriter* zWriter) const;
- virtual Item* cloneItem(const Item* zItem) const;
- virtual Item* breakItem(Item* zItem) const;
- const ModelInfo& getModel() const;
- };
|