ManaPlus
gamemodifiers.h
Go to the documentation of this file.
1 /*
2  * The ManaPlus Client
3  * Copyright (C) 2011-2019 The ManaPlus Developers
4  * Copyright (C) 2019-2021 Andrei Karas
5  *
6  * This file is part of The ManaPlus 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 GAMEMODIFIERS_H
23 #define GAMEMODIFIERS_H
24 
25 #include <string>
26 
27 #include "localconsts.h"
28 
29 #define declModifier(name1) \
30  static void change##name1(const bool forward); \
31  static std::string get##name1##String(); \
32  static const unsigned m##name1##Size; \
33  static const char *const m##name1##Strings[];
34 
36 {
37  public:
39 
40  static void init();
41 
42  static void changeMode(unsigned *restrict const var,
43  const unsigned limit,
44  const char *restrict const conf,
45  std::string (*const func)(),
46  const unsigned def,
47  const bool save,
48  const bool forward);
49 
50  declModifier(MoveType)
51  declModifier(CrazyMoveType)
52  declModifier(MoveToTargetType)
53  declModifier(FollowMode)
54  declModifier(AttackWeaponType)
56  declModifier(TargetingType)
57  declModifier(QuickDropCounter)
58  declModifier(PickUpType)
59  declModifier(MagicAttackType)
60  declModifier(PvpAttackType)
61  declModifier(ImitationMode)
63  declModifier(MapDrawType)
64  declModifier(CameraMode)
65  declModifier(AwayMode)
66 
67  static void setQuickDropCounter(const int n);
68 
69  static void resetModifiers();
70 
71  protected:
72  static const char *getVarItem(const char *const *const arr,
73  const unsigned index,
74  const unsigned sz)
76 };
77 
78 #undef declModifier
79 
80 #endif // GAMEMODIFIERS_H
static const char * getVarItem(const char *const *const arr, const unsigned index, const unsigned sz)
static void resetModifiers()
static void init()
static void setQuickDropCounter(const int n)
static void changeMode(unsigned *const var, const unsigned limit, const char *const conf, std::string(*const func)(), const unsigned def, const bool save, const bool forward)
#define declModifier(name1)
Definition: gamemodifiers.h:29
#define restrict
Definition: localconsts.h:165
#define A_WARN_UNUSED
Definition: localconsts.h:161
#define A_NONNULL(...)
Definition: localconsts.h:168
#define final
Definition: localconsts.h:46
#define A_DELETE_COPY(func)
Definition: localconsts.h:53