summaryrefslogtreecommitdiff
path: root/src/textcommand.h
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-11-16 20:23:30 +0300
committerAndrei Karas <akaras@inbox.ru>2015-11-16 20:23:30 +0300
commit11000f010f19a2de85ba26660b451c7c41ab3a97 (patch)
tree65eee18b5fcb17f35cb90fcc930242e02b0a79f1 /src/textcommand.h
parent18bd0722a9cebc3ba80bfb74a5b5ba0dd9e53c75 (diff)
downloadplus-11000f010f19a2de85ba26660b451c7c41ab3a97.tar.gz
plus-11000f010f19a2de85ba26660b451c7c41ab3a97.tar.bz2
plus-11000f010f19a2de85ba26660b451c7c41ab3a97.tar.xz
plus-11000f010f19a2de85ba26660b451c7c41ab3a97.zip
Move MagicSchool enum into separate file and convert to strong typed.
Diffstat (limited to 'src/textcommand.h')
-rw-r--r--src/textcommand.h31
1 files changed, 13 insertions, 18 deletions
diff --git a/src/textcommand.h b/src/textcommand.h
index 76749b51f..d09a1b9be 100644
--- a/src/textcommand.h
+++ b/src/textcommand.h
@@ -24,6 +24,7 @@
#define TEXTCOMMAND_H
#include "enums/commandtarget.h"
+#include "enums/magicschool.h"
#include <string>
@@ -33,16 +34,6 @@ const unsigned int MAGIC_START_ID = 340;
class Image;
-enum MagicSchool
-{
- SKILL_MAGIC = 340,
- SKILL_MAGIC_LIFE = 341,
- SKILL_MAGIC_WAR = 342,
- SKILL_MAGIC_TRANSMUTE = 343,
- SKILL_MAGIC_NATURE = 344,
- SKILL_MAGIC_ASTRAL = 345
-};
-
enum TextCommandType
{
TEXT_COMMAND_MAGIC = 0,
@@ -58,12 +49,16 @@ class TextCommand final
/**
* Constructor.
*/
- TextCommand(const unsigned int id, const std::string &symbol,
+ TextCommand(const unsigned int id,
+ const std::string &symbol,
const std::string &command,
- const std::string &comment, const CommandTargetT type,
- const std::string &icon, const unsigned int basicLvl,
- const MagicSchool school = SKILL_MAGIC,
- const unsigned int schoolLvl = 0, const int mana = 0);
+ const std::string &comment,
+ const CommandTargetT type,
+ const std::string &icon,
+ const unsigned int basicLvl,
+ const MagicSchoolT school = MagicSchool::SkillMagic,
+ const unsigned int schoolLvl = 0,
+ const int mana = 0);
/**
* Constructor.
@@ -108,7 +103,7 @@ class TextCommand final
int getMana() const A_WARN_UNUSED
{ return mMana; }
- MagicSchool getSchool() const A_WARN_UNUSED
+ MagicSchoolT getSchool() const A_WARN_UNUSED
{ return mSchool; }
unsigned getBaseLvl() const A_WARN_UNUSED
@@ -141,7 +136,7 @@ class TextCommand final
void setMana(const unsigned int mana)
{ mMana = mana; }
- void setSchool(const MagicSchool school)
+ void setSchool(const MagicSchoolT school)
{ mSchool = school; }
void setBaseLvl(const unsigned int baseLvl)
@@ -170,7 +165,7 @@ class TextCommand final
std::string mIcon;
unsigned int mId;
int mMana;
- MagicSchool mSchool;
+ MagicSchoolT mSchool;
unsigned mBaseLvl;
unsigned mSchoolLvl;
TextCommandType mCommandType;