ManaPlus
emotedb.h
Go to the documentation of this file.
1 /*
2  * The ManaPlus Client
3  * Copyright (C) 2009 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_EMOTEDB_H
24 #define RESOURCES_DB_EMOTEDB_H
25 
27 
28 #include <map>
29 #include <string>
30 
31 #include "localconsts.h"
32 
33 struct EmoteInfo;
34 struct EmoteSprite;
35 
36 typedef std::map<int, EmoteInfo*> EmoteInfos;
37 typedef std::map<int, int> EmoteToEmote;
38 
42 namespace EmoteDB
43 {
44  void load();
45 
46  void loadXmlFile(const std::string &fileName,
47  const SkipError skipError);
48 
49  void loadSpecialXmlFile(const std::string &fileName,
50  const SkipError skipError);
51 
52  void unload();
53 
54  const EmoteInfo *get(const int id,
55  const bool allowNull) A_WARN_UNUSED;
56 
57  const EmoteInfo *get2(int id,
58  const bool allowNull) A_WARN_UNUSED;
59 
60  const EmoteSprite *getSprite(const int id,
61  const bool allowNull) A_WARN_UNUSED;
62 
63  const int &getLast() A_CONST A_WARN_UNUSED;
64 
65  int getIdByIndex(const int index);
66 
67  int size();
68 
69  typedef EmoteInfos::iterator EmoteInfosIterator;
70 } // namespace EmoteDB
71 
72 #endif // RESOURCES_DB_EMOTEDB_H
std::map< int, int > EmoteToEmote
Definition: emotedb.h:37
std::map< int, EmoteInfo * > EmoteInfos
Definition: emotedb.h:34
#define A_WARN_UNUSED
Definition: localconsts.h:161
void load()
Definition: emotedb.cpp:48
const int & getLast() A_CONST
Definition: emotedb.cpp:301
const EmoteInfo * get2(int id, const bool allowNull)
Definition: emotedb.cpp:273
void loadSpecialXmlFile(const std::string &fileName, const SkipError skipError)
Definition: emotedb.cpp:151
int size()
Definition: emotedb.cpp:306
void loadXmlFile(const std::string &fileName, const SkipError skipError)
Definition: emotedb.cpp:74
const EmoteInfo * get(const int id, const bool allowNull)
Definition: emotedb.cpp:258
int getIdByIndex(const int index)
Definition: emotedb.cpp:311
void unload()
Definition: emotedb.cpp:227
const EmoteSprite * getSprite(const int id, const bool allowNull)
Definition: emotedb.cpp:292
EmoteInfos::iterator EmoteInfosIterator
Definition: emotedb.h:69
bool SkipError
Definition: skiperror.h:30
std::string fileName
Definition: testmain.cpp:39