summaryrefslogtreecommitdiff
path: root/src/textcommand.h
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-11-16 20:02:04 +0300
committerAndrei Karas <akaras@inbox.ru>2015-11-16 20:02:04 +0300
commit18bd0722a9cebc3ba80bfb74a5b5ba0dd9e53c75 (patch)
tree179d12121a4e588efa53c67a207e2ab5392d99eb /src/textcommand.h
parent44cdf80268135a21ddb09710fc029e808fb3f519 (diff)
downloadmanaverse-18bd0722a9cebc3ba80bfb74a5b5ba0dd9e53c75.tar.gz
manaverse-18bd0722a9cebc3ba80bfb74a5b5ba0dd9e53c75.tar.bz2
manaverse-18bd0722a9cebc3ba80bfb74a5b5ba0dd9e53c75.tar.xz
manaverse-18bd0722a9cebc3ba80bfb74a5b5ba0dd9e53c75.zip
Rename SpellTarget into CommandTarget enum and convert it to strong typed.
Diffstat (limited to 'src/textcommand.h')
-rw-r--r--src/textcommand.h19
1 files changed, 7 insertions, 12 deletions
diff --git a/src/textcommand.h b/src/textcommand.h
index 79a6b6f7e..76749b51f 100644
--- a/src/textcommand.h
+++ b/src/textcommand.h
@@ -23,6 +23,8 @@
#ifndef TEXTCOMMAND_H
#define TEXTCOMMAND_H
+#include "enums/commandtarget.h"
+
#include <string>
#include "localconsts.h"
@@ -31,13 +33,6 @@ const unsigned int MAGIC_START_ID = 340;
class Image;
-enum SpellTarget
-{
- NOTARGET = 0,
- ALLOWTARGET = 1,
- NEEDTARGET = 2
-};
-
enum MagicSchool
{
SKILL_MAGIC = 340,
@@ -65,7 +60,7 @@ class TextCommand final
*/
TextCommand(const unsigned int id, const std::string &symbol,
const std::string &command,
- const std::string &comment, const SpellTarget type,
+ 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);
@@ -75,7 +70,7 @@ class TextCommand final
*/
TextCommand(const unsigned int id, const std::string &symbol,
const std::string &command, const std::string &comment,
- const SpellTarget type, const std::string &icon);
+ const CommandTargetT type, const std::string &icon);
/**
* Constructor.
@@ -104,7 +99,7 @@ class TextCommand final
unsigned int getId() const A_WARN_UNUSED
{ return mId; }
- SpellTarget getTargetType() const A_WARN_UNUSED
+ CommandTargetT getTargetType() const A_WARN_UNUSED
{ return mTargetType; }
std::string getIcon() const A_WARN_UNUSED
@@ -137,7 +132,7 @@ class TextCommand final
void setId(const unsigned int id)
{ mId = id; }
- void setTargetType(const SpellTarget targetType)
+ void setTargetType(const CommandTargetT targetType)
{ mTargetType = targetType; }
void setIcon(const std::string &icon)
@@ -171,7 +166,7 @@ class TextCommand final
std::string mCommand;
std::string mComment;
std::string mSymbol;
- SpellTarget mTargetType;
+ CommandTargetT mTargetType;
std::string mIcon;
unsigned int mId;
int mMana;