ManaPlus
src
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
35
class
GameModifiers
final
36
{
37
public
:
38
A_DELETE_COPY
(
GameModifiers
)
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)
55
declModifier
(
AttackType
)
56
declModifier
(TargetingType)
57
declModifier
(QuickDropCounter)
58
declModifier
(PickUpType)
59
declModifier
(MagicAttackType)
60
declModifier
(PvpAttackType)
61
declModifier
(ImitationMode)
62
declModifier
(
GameModifiers
)
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)
75
A_WARN_UNUSED
A_NONNULL
(1);
76
};
77
78
#undef declModifier
79
80
#endif
// GAMEMODIFIERS_H
GameModifiers
Definition:
gamemodifiers.h:36
GameModifiers::getVarItem
static const char * getVarItem(const char *const *const arr, const unsigned index, const unsigned sz)
Definition:
gamemodifiers.cpp:138
GameModifiers::resetModifiers
static void resetModifiers()
Definition:
gamemodifiers.cpp:490
GameModifiers::init
static void init()
Definition:
gamemodifiers.cpp:84
GameModifiers::setQuickDropCounter
static void setQuickDropCounter(const int n)
Definition:
gamemodifiers.cpp:299
GameModifiers::changeMode
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)
Definition:
gamemodifiers.cpp:104
declModifier
#define declModifier(name1)
Definition:
gamemodifiers.h:29
localconsts.h
restrict
#define restrict
Definition:
localconsts.h:165
A_WARN_UNUSED
#define A_WARN_UNUSED
Definition:
localconsts.h:161
A_NONNULL
#define A_NONNULL(...)
Definition:
localconsts.h:168
final
#define final
Definition:
localconsts.h:46
A_DELETE_COPY
#define A_DELETE_COPY(func)
Definition:
localconsts.h:53
AttackType
Definition:
attacktype.h:29
Generated on Wed Mar 17 2021 19:19:06 for ManaPlus by
1.9.1