Mana
Loading...
Searching...
No Matches
statuseffectdb.h
Go to the documentation of this file.
1/*
2 * The Mana Client
3 * Copyright (C) 2008-2009 The Mana World Development Team
4 * Copyright (C) 2009-2025 The Mana Developers
5 *
6 * This file is part of The Mana Client.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 */
21
22#ifndef STATUSEFFECTDB_H
23#define STATUSEFFECTDB_H
24
25#include "statuseffect.h"
26#include "utils/xml.h"
27
28#include <cstdint>
29#include <map>
30
32{
33public:
39 static const StatusEffect *getStatusEffect(int id);
40
41 using OptionsMap = std::map<uint16_t, int>;
42
47 static const OptionsMap &opt0ToIdMap() { return mOpt0ToIdMap; }
48 static const OptionsMap &opt1ToIdMap() { return mOpt1ToIdMap; }
49 static const OptionsMap &opt2ToIdMap() { return mOpt2ToIdMap; }
50 static const OptionsMap &opt3ToIdMap() { return mOpt3ToIdMap; }
51
52 static void init();
53 static void readStatusEffectNode(XML::Node node, const std::string &filename);
54 static void checkStatus();
55 static void unload();
56
57private:
58 static bool mLoaded;
59
60 static std::map<int, StatusEffect> mStatusEffects;
65};
66
67#endif // STATUSEFFECTDB_H
static const OptionsMap & opt2ToIdMap()
static const OptionsMap & opt0ToIdMap()
These map flags or indexes to their corresponding status effect ID.
static void init()
static const OptionsMap & opt3ToIdMap()
static OptionsMap mOpt3ToIdMap
static OptionsMap mOpt1ToIdMap
static std::map< int, StatusEffect > mStatusEffects
static bool mLoaded
std::map< uint16_t, int > OptionsMap
static OptionsMap mOpt0ToIdMap
static void checkStatus()
static OptionsMap mOpt2ToIdMap
static const StatusEffect * getStatusEffect(int id)
Retrieves a status effect.
static void readStatusEffectNode(XML::Node node, const std::string &filename)
static void unload()
static const OptionsMap & opt1ToIdMap()