diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-03-21 16:52:59 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-03-21 16:52:59 +0300 |
commit | ac4e40a1408ad4d6fbcfce9d2bc6a0bc187ea5a4 (patch) | |
tree | 13314fbbb4945414b8be5d1d0236e1c41f88e8c8 /src/resources/db/statuseffectdb.h | |
parent | 68857593b01b73d33fa1a12011cf9cb402db8a73 (diff) | |
download | manaverse-ac4e40a1408ad4d6fbcfce9d2bc6a0bc187ea5a4.tar.gz manaverse-ac4e40a1408ad4d6fbcfce9d2bc6a0bc187ea5a4.tar.bz2 manaverse-ac4e40a1408ad4d6fbcfce9d2bc6a0bc187ea5a4.tar.xz manaverse-ac4e40a1408ad4d6fbcfce9d2bc6a0bc187ea5a4.zip |
Split StatusEffect into StatusEffect and StatusEffectDB.
Diffstat (limited to 'src/resources/db/statuseffectdb.h')
-rw-r--r-- | src/resources/db/statuseffectdb.h | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/src/resources/db/statuseffectdb.h b/src/resources/db/statuseffectdb.h new file mode 100644 index 000000000..d239c1903 --- /dev/null +++ b/src/resources/db/statuseffectdb.h @@ -0,0 +1,62 @@ +/* + * The ManaPlus Client + * Copyright (C) 2008-2009 The Mana World Development Team + * Copyright (C) 2009-2010 The Mana Developers + * Copyright (C) 2011-2016 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef RESOURCES_DB_STATUSEFFECTDB_H +#define RESOURCES_DB_STATUSEFFECTDB_H + +#include "enums/simpletypes/enable.h" + +#include <string> + +#include "localconsts.h" + +class StatusEffect; + +namespace StatusEffectDB +{ + /** + * Retrieves a status effect. + * + * \param index Index of the status effect. + * \param enabling Whether to retrieve the activating effect (true) or + * the deactivating effect (false). + */ + StatusEffect *getStatusEffect(const int index, + const Enable enabling) A_WARN_UNUSED; + + /** + * Maps a block effect index to its corresponding effect index. Block + * effect indices are used for opt2/opt3/status.option blocks; their + * mapping to regular effect indices is handled in the config file. + * + * Returns -1 on failure. + */ + int blockEffectIndexToEffectIndex(const int blocKIndex) A_WARN_UNUSED; + + void load(); + + void loadXmlFile(const std::string &fileName); + + void unload(); +} // namespace StatusEffectDB + +#endif // RESOURCES_DB_STATUSEFFECTDB_H |