ManaPlus
skillinfo.h
Go to the documentation of this file.
1 /*
2  * The ManaPlus Client
3  * Copyright (C) 2004-2009 The Mana World Development Team
4  * Copyright (C) 2009-2010 The Mana Developers
5  * Copyright (C) 2011-2019 The ManaPlus Developers
6  * Copyright (C) 2019-2021 Andrei Karas
7  *
8  * This file is part of The ManaPlus Client.
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program. If not, see <http://www.gnu.org/licenses/>.
22  */
23 
24 #ifndef GUI_WIDGETS_SKILLINFO_H
25 #define GUI_WIDGETS_SKILLINFO_H
26 
29 
33 
34 #include "utils/vector.h"
35 
36 #include <string>
37 #include <map>
38 
39 #include "localconsts.h"
40 
41 struct SkillData;
42 
43 class SkillModel;
44 class SkillTab;
45 
46 typedef std::map<int, SkillData*> SkillDataMap;
47 typedef SkillDataMap::iterator SkillDataMapIter;
48 typedef SkillDataMap::const_iterator SkillDataMapCIter;
49 
51 {
52  std::string skillLevel;
53  std::string skillEffect;
54  std::string useButton;
55  std::string errorText;
56  std::string castingAction;
57  std::string castingRideAction;
58  std::string castingSkyAction;
59  std::string castingWaterAction;
64  int level;
69  unsigned int id;
70  int range;
71  int sp;
72  int duration;
74  int cooldown;
75  int x;
76  int y;
84 
85  SkillInfo();
87  ~SkillInfo();
88 
89  void update();
90 
91  SkillData *getData(const int level) const A_WARN_UNUSED;
92  SkillData *getData1(const int level) const A_WARN_UNUSED;
93 
94  void addData(const int level, SkillData *const data);
95 
97  {
98  return type == SkillType::Attack
99  || type == SkillType::Self
100  || type == SkillType::Support;
101  }
102 
103  std::string toDataStr() const A_WARN_UNUSED;
104 };
105 
107 typedef SkillList::iterator SkillListIter;
108 
109 #endif // GUI_WIDGETS_SKILLINFO_H
CastType ::T CastTypeT
Definition: casttype.h:34
#define A_WARN_UNUSED
Definition: localconsts.h:161
#define noexcept2
Definition: localconsts.h:50
#define final
Definition: localconsts.h:46
#define A_DELETE_COPY(func)
Definition: localconsts.h:53
bool Modifiable
Definition: modifiable.h:30
SkillDataMap::const_iterator SkillDataMapCIter
Definition: skillinfo.h:48
SkillList::iterator SkillListIter
Definition: skillinfo.h:107
std::vector< SkillInfo * > SkillList
Definition: skillinfo.h:106
std::map< int, SkillData * > SkillDataMap
Definition: skillinfo.h:44
SkillDataMap::iterator SkillDataMapIter
Definition: skillinfo.h:47
SkillTab * tab
Definition: skillinfo.h:62
void addData(const int level, SkillData *const data)
Definition: skillinfo.cpp:178
Modifiable modifiable
Definition: skillinfo.h:80
SkillData * getData(const int level) const
Definition: skillinfo.cpp:183
CastTypeT customCastType
Definition: skillinfo.h:79
std::string castingRideAction
Definition: skillinfo.h:57
int duration
Definition: skillinfo.h:72
Visible visible
Definition: skillinfo.h:81
int customSelectedLevel
Definition: skillinfo.h:65
SkillData * getData1(const int level) const
Definition: skillinfo.cpp:191
int skillLevelWidth
Definition: skillinfo.h:68
void update()
Definition: skillinfo.cpp:83
std::string skillEffect
Definition: skillinfo.h:53
unsigned int id
Definition: skillinfo.h:69
std::string toDataStr() const
Definition: skillinfo.cpp:199
std::string castingSkyAction
Definition: skillinfo.h:58
SkillType::SkillType type
Definition: skillinfo.h:77
int cooldown
Definition: skillinfo.h:74
int sp
Definition: skillinfo.h:71
std::string castingAction
Definition: skillinfo.h:56
std::string skillLevel
Definition: skillinfo.h:52
SkillOwner::Type owner
Definition: skillinfo.h:78
bool useTextParameter
Definition: skillinfo.h:83
SkillData * data
Definition: skillinfo.h:63
int level
Definition: skillinfo.h:64
std::string errorText
Definition: skillinfo.h:55
bool isUsable() const
Definition: skillinfo.h:96
std::string castingWaterAction
Definition: skillinfo.h:59
std::string useButton
Definition: skillinfo.h:54
Visible alwaysVisible
Definition: skillinfo.h:82
SkillModel * model
Definition: skillinfo.h:61
int range
Definition: skillinfo.h:70
int customOffsetY
Definition: skillinfo.h:67
int customOffsetX
Definition: skillinfo.h:66
int durationTime
Definition: skillinfo.h:73
SkillDataMap dataMap
Definition: skillinfo.h:60
#define STD_VECTOR
Definition: vector.h:30
bool Visible
Definition: visible.h:30