#pragma once #include #include #include #include #include "Effect.h" #include "StaticRegistry.h" class Item; class ItemStack; class ItemSkill; class ItemSkillLevelUpRule; class ItemType : public virtual Framework::ReferenceCounter { protected: const int id; ItemSkillLevelUpRule* levelUpRule; const ItemType* zBrokenType; ItemType( int id, ItemSkillLevelUpRule* levelUpRule, const ItemType* zBrokenType ); 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; public: ~ItemType(); int getId() 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( Item* zItem ) const; virtual Item* breakItem( Item* zItem ) const; };