ManaPlus
colordb.h
Go to the documentation of this file.
1 /*
2  * The ManaPlus Client
3  * Copyright (C) 2008 Aethyra Development Team
4  * Copyright (C) 2011-2019 The ManaPlus Developers
5  * Copyright (C) 2019-2021 Andrei Karas
6  *
7  * This file is part of The ManaPlus Client.
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program. If not, see <http://www.gnu.org/licenses/>.
21  */
22 
23 #ifndef RESOURCES_DB_COLORDB_H
24 #define RESOURCES_DB_COLORDB_H
25 
27 
29 
30 #include <map>
31 
32 #include "localconsts.h"
33 
37 namespace ColorDB
38 {
42  void load();
43 
47  void loadHair(const std::string &fileName,
48  std::map<ItemColor, ItemColorData> &colors,
49  const SkipError skipError);
50 
51  void loadColorLists(const std::string &fileName,
52  const SkipError skipError);
53 
57  void unload();
58 
59  std::string &getHairColorName(const ItemColor id) A_WARN_UNUSED;
60 
62 
63  const std::map <ItemColor, ItemColorData> *getColorsList(const std::string
64  &name)
66 
67  // Color DB
68  typedef std::map<ItemColor, ItemColorData> Colors;
69  typedef Colors::iterator ColorIterator;
70  typedef std::map <std::string, std::map <ItemColor, ItemColorData> >
72  typedef ColorLists::iterator ColorListsIterator;
73 } // namespace ColorDB
74 
75 #endif // RESOURCES_DB_COLORDB_H
uint16_t ItemColor
Definition: itemcolor.h:30
#define A_WARN_UNUSED
Definition: localconsts.h:161
const std::map< ItemColor, ItemColorData > * getColorsList(const std::string &name)
Definition: colordb.cpp:219
void unload()
Definition: colordb.cpp:182
Colors::iterator ColorIterator
Definition: colordb.h:69
void loadColorLists(const std::string &fileName, const SkipError skipError)
Definition: colordb.cpp:128
std::map< ItemColor, ItemColorData > Colors
Definition: colordb.h:68
std::map< std::string, std::map< ItemColor, ItemColorData > > ColorLists
Definition: colordb.h:71
void loadHair(const std::string &fileName, std::map< ItemColor, ItemColorData > &colors, const SkipError skipError)
Definition: colordb.cpp:81
ColorLists::iterator ColorListsIterator
Definition: colordb.h:72
int getHairSize()
Definition: colordb.cpp:213
void load()
Definition: colordb.cpp:42
std::string & getHairColorName(const ItemColor id)
Definition: colordb.cpp:190
bool SkipError
Definition: skiperror.h:30
std::string fileName
Definition: testmain.cpp:39