diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-03-03 01:25:21 +0200 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-03-03 01:25:21 +0200 |
commit | 22f79fd0d623c8e11994905534f53da267e22935 (patch) | |
tree | 04403929ca80f47253f8dd523a29489c0fd30162 /src/resources/colordb.h | |
parent | 582428edf9e40db0d1ed7b78222562a7a5031fe4 (diff) | |
download | plus-22f79fd0d623c8e11994905534f53da267e22935.tar.gz plus-22f79fd0d623c8e11994905534f53da267e22935.tar.bz2 plus-22f79fd0d623c8e11994905534f53da267e22935.tar.xz plus-22f79fd0d623c8e11994905534f53da267e22935.zip |
Dehardcode item colors. Now reading all from configs.
Diffstat (limited to 'src/resources/colordb.h')
-rw-r--r-- | src/resources/colordb.h | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/src/resources/colordb.h b/src/resources/colordb.h index 72d34afe8..fb0da0036 100644 --- a/src/resources/colordb.h +++ b/src/resources/colordb.h @@ -29,23 +29,51 @@ */ namespace ColorDB { + class ItemColor + { + public: + ItemColor() + { } + ItemColor(int id, std::string name, std::string color) + { + this->id = id; + this->name = name; + this->color = color; + } + + int id; + std::string name; + std::string color; + }; + /** * Loads the color data from <code>colors.xml</code>. */ void load(); /** + * Loads the color data from <code>colors.xml</code>. + */ + void loadHair(); + + void loadColorLists(); + + /** * Clear the color data */ void unload(); - std::string &get(int id); + std::string &getHairColor(int id); + + int getHairSize(); - int size(); + std::map <int, ItemColor> *getColorsList(std::string name); // Color DB typedef std::map<int, std::string> Colors; typedef Colors::iterator ColorIterator; + typedef std::map <std::string, std::map <int, ItemColor> > ColorLists; + typedef ColorLists::iterator ColorListsIterator; } #endif |