From 22f79fd0d623c8e11994905534f53da267e22935 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 3 Mar 2011 01:25:21 +0200 Subject: Dehardcode item colors. Now reading all from configs. --- src/resources/colordb.h | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) (limited to 'src/resources/colordb.h') 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 colors.xml. */ void load(); + /** + * Loads the color data from colors.xml. + */ + 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 *getColorsList(std::string name); // Color DB typedef std::map Colors; typedef Colors::iterator ColorIterator; + typedef std::map > ColorLists; + typedef ColorLists::iterator ColorListsIterator; } #endif -- cgit v1.2.3-60-g2f50