30#define ITEMS_DB_FILE "items.xml"
54 const std::string &format):
58 {
return mTag == name; }
66static std::list<ItemStat> extraStats;
166 void init()
override;
198 void init()
override;
Item information database generic definition.
void addItem(ItemInfo *itemInfo)
Registers the item to mItemInfos and mNamedItemsInfos.
virtual void checkStatus()=0
bool isLoaded() const
Tells whether the item database is loaded.
virtual void readItemNode(XML::Node node, const std::string &filename)=0
void loadSoundRef(ItemInfo &itemInfo, XML::Node node)
Loads the sound references contained in a <sound> tag.
virtual void unload()
Frees item data.
std::map< std::string, ItemInfo * > mNamedItemInfos
void loadReplacement(ItemInfo &info, XML::Node replaceNode)
Loads the <replace> tag.
void loadCommonRef(ItemInfo &itemInfo, XML::Node node, const std::string &filename)
Permits to load item definitions which are common for each protocols to avoid code duplication.
bool exists(int id) const
virtual ~ItemDB()=default
std::map< int, ItemInfo * > mItemInfos
void loadSpriteRef(ItemInfo &itemInfo, XML::Node node)
Loads the sprite references contained in a <sprite> tag.
const ItemInfo & get(int id) const
void loadFloorSprite(SpriteDisplay &display, XML::Node node)
Loads the floor item references contained in a <floor> tag.
void loadEmptyItemDefinition()
Loads the empty item definition.
virtual void checkItemInfo(ItemInfo &itemInfo)
Checks the items parameters consistency.
Defines a class for storing generic item infos.
Nano-description functions.
ItemStat(const std::string &tag, const std::string &format)
bool operator==(const std::string &name) const
Item information database TmwAthena specific class.
void readItemNode(XML::Node node, const std::string &filename) override
~ManaServItemDB() override
void checkStatus() override
void checkItemInfo(ItemInfo &itemInfo) override
Checks the items parameters consistency.
Item information database TmwAthena specific class.
void checkStatus() override
void readItemNode(XML::Node node, const std::string &filename) override
void checkHairWeaponsRacesSpecialIds()
Check items id specific hard limits and log errors found.
void checkItemInfo(ItemInfo &itemInfo) override
Checks the items parameters consistency.
void setStatsList(std::list< ItemStat > stats)
ItemDB * itemDb
Items info database.
Warning: buffers and other variables are shared, so there can be only one connection active at a time...