summaryrefslogtreecommitdiff
path: root/src/resources/itemdb.h
diff options
context:
space:
mode:
authorPrzemysław Grzywacz <nexather@gmail.com>2013-05-07 17:45:26 +0200
committerPrzemysław Grzywacz <nexather@gmail.com>2013-05-07 17:45:26 +0200
commit92c09d42b782deff9dcb9dcc6b408fdd36bc4f37 (patch)
treeba6fc1735e766e32bf3eb76531b8ea506b9bd241 /src/resources/itemdb.h
parentbd1fdd87eed48ba3ffcc413936d6a6a60a429a97 (diff)
downloadMana-92c09d42b782deff9dcb9dcc6b408fdd36bc4f37.tar.gz
Mana-92c09d42b782deff9dcb9dcc6b408fdd36bc4f37.tar.bz2
Mana-92c09d42b782deff9dcb9dcc6b408fdd36bc4f37.tar.xz
Mana-92c09d42b782deff9dcb9dcc6b408fdd36bc4f37.zip
items.xml can be used from settings.xml
Diffstat (limited to 'src/resources/itemdb.h')
-rw-r--r--src/resources/itemdb.h34
1 files changed, 18 insertions, 16 deletions
diff --git a/src/resources/itemdb.h b/src/resources/itemdb.h
index d7859ad3..2f19339d 100644
--- a/src/resources/itemdb.h
+++ b/src/resources/itemdb.h
@@ -82,11 +82,6 @@ class ItemDB
{}
/**
- * Loads the item data from <code>items.xml</code>.
- */
- virtual void load() = 0;
-
- /**
* Frees item data.
*/
virtual void unload();
@@ -102,12 +97,18 @@ class ItemDB
const ItemInfo &get(int id);
const ItemInfo &get(const std::string &name);
+ virtual void init() = 0;
+
+ virtual void readItemNode(xmlNodePtr node, const std::string &filename) = 0;
+
+ virtual void checkStatus() = 0;
+
protected:
/**
* Permits to load item definitions which are common
* for each protocols to avoid code duplication.
*/
- void loadCommonRef(ItemInfo *itemInfo, xmlNodePtr node);
+ void loadCommonRef(ItemInfo *itemInfo, xmlNodePtr node, const std::string &filename);
/**
* Checks the items parameters consistency.
@@ -164,16 +165,16 @@ class TaItemDB: public ItemDB
{
public:
TaItemDB() : ItemDB()
- { load(); }
+ { }
~TaItemDB()
{ unload(); }
- /**
- * Loads the item data from <code>items.xml</code>.
- */
- void load();
+ virtual void init();
+
+ virtual void readItemNode(xmlNodePtr node, const std::string &filename);
+ virtual void checkStatus();
private:
/**
* Check items id specific hard limits and log errors found.
@@ -198,15 +199,16 @@ class ManaServItemDB: public ItemDB
{
public:
ManaServItemDB() : ItemDB()
- { load(); }
+ { }
~ManaServItemDB()
{ unload(); }
- /**
- * Loads the item data from <code>items.xml</code>.
- */
- void load();
+ virtual void init();
+
+ virtual void readItemNode(xmlNodePtr node, const std::string &filename);
+
+ virtual void checkStatus();
private:
void checkItemInfo(ItemInfo* itemInfo);