summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-05-29 23:49:29 +0300
committerAndrei Karas <akaras@inbox.ru>2015-05-29 23:49:29 +0300
commit45379d14d9d3c7f4673b8390cb95d98bb1759f45 (patch)
tree698fe787014ca277f5b23144136d4e5417c6b444 /src/gui
parent273b79cf4f52c846508f3493727e34b1811ecfd5 (diff)
downloadplus-45379d14d9d3c7f4673b8390cb95d98bb1759f45.tar.gz
plus-45379d14d9d3c7f4673b8390cb95d98bb1759f45.tar.bz2
plus-45379d14d9d3c7f4673b8390cb95d98bb1759f45.tar.xz
plus-45379d14d9d3c7f4673b8390cb95d98bb1759f45.zip
Convert Gender enum into strong typed enum.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/onlineplayer.h10
-rw-r--r--src/gui/windows/charcreatedialog.cpp2
-rw-r--r--src/gui/windows/charcreatedialog.h6
3 files changed, 11 insertions, 7 deletions
diff --git a/src/gui/onlineplayer.h b/src/gui/onlineplayer.h
index d0b566ffe..dbcf45be4 100644
--- a/src/gui/onlineplayer.h
+++ b/src/gui/onlineplayer.h
@@ -22,6 +22,8 @@
#ifndef GUI_ONLINEPLAYER_H
#define GUI_ONLINEPLAYER_H
+#include "enums/being/gender.h"
+
#include <string>
#include "localconsts.h"
@@ -29,8 +31,10 @@
class OnlinePlayer final
{
public:
- OnlinePlayer(const std::string &nick, const unsigned char status,
- const signed char level, const unsigned char gender,
+ OnlinePlayer(const std::string &nick,
+ const unsigned char status,
+ const signed char level,
+ const Gender gender,
const signed char version) :
mNick(nick),
mText(""),
@@ -78,7 +82,7 @@ class OnlinePlayer final
signed char mVersion;
- unsigned char mGender;
+ Gender mGender;
bool mIsGM;
};
diff --git a/src/gui/windows/charcreatedialog.cpp b/src/gui/windows/charcreatedialog.cpp
index 8ccd127c6..49b1e1c59 100644
--- a/src/gui/windows/charcreatedialog.cpp
+++ b/src/gui/windows/charcreatedialog.cpp
@@ -586,7 +586,7 @@ void CharCreateDialog::setAttributes(const StringVect &labels,
setButtonsPosition(w, h);
}
-void CharCreateDialog::setDefaultGender(const Gender::Type gender)
+void CharCreateDialog::setDefaultGender(const GenderT gender)
{
mDefaultGender = gender;
mPlayer->setGender(gender);
diff --git a/src/gui/windows/charcreatedialog.h b/src/gui/windows/charcreatedialog.h
index ed1a8fcf3..7ac1980c7 100644
--- a/src/gui/windows/charcreatedialog.h
+++ b/src/gui/windows/charcreatedialog.h
@@ -72,7 +72,7 @@ class CharCreateDialog final : public Window,
const int available,
const int min, const int max);
- void setDefaultGender(const Gender::Type gender = Gender::FEMALE);
+ void setDefaultGender(const GenderT gender = Gender::FEMALE);
void logic() override final;
@@ -155,8 +155,8 @@ class CharCreateDialog final : public Window,
int mSlot;
- Gender::Type mDefaultGender;
- Gender::Type mGender;
+ GenderT mDefaultGender;
+ GenderT mGender;
unsigned int maxHairColor;
unsigned int minHairColor;