diff options
author | Philipp Sehmisch <tmw@crushnet.org> | 2008-02-22 19:58:29 +0000 |
---|---|---|
committer | Ira Rice <irarice@gmail.com> | 2009-01-05 20:36:46 -0700 |
commit | b6e7b6c6cb3ea26157e3a78713cc9621dc46b2d7 (patch) | |
tree | 67c3d0552af5661b3847ef7e397771bc101e0c7c /src/being.h | |
parent | 77db175ceabe8d05665191835d0250a927d93d32 (diff) | |
download | mana-b6e7b6c6cb3ea26157e3a78713cc9621dc46b2d7.tar.gz mana-b6e7b6c6cb3ea26157e3a78713cc9621dc46b2d7.tar.bz2 mana-b6e7b6c6cb3ea26157e3a78713cc9621dc46b2d7.tar.xz mana-b6e7b6c6cb3ea26157e3a78713cc9621dc46b2d7.zip |
Handling gender with an enum everywhere.
(cherry picked from mainline commit d3adc61aa4b4924f82d8cbc23bea26da7257da97)
Conflicts:
src/net/beinghandler.cpp
src/net/charserverhandler.cpp
src/player.cpp
src/player.h
Diffstat (limited to 'src/being.h')
-rw-r--r-- | src/being.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/being.h b/src/being.h index ca051811..ccb1c4c4 100644 --- a/src/being.h +++ b/src/being.h @@ -70,6 +70,12 @@ struct PATH_NODE typedef std::list<PATH_NODE> Path; typedef Path::iterator PathIterator; +enum Gender { + GENDER_MALE = 0, + GENDER_FEMALE = 1, + GENDER_UNSPECIFIED = 2 +}; + class Being : public Sprite { public: @@ -222,12 +228,12 @@ class Being : public Sprite /** * Sets the gender of this being. */ - virtual void setGender(int gender) { mGender = gender; } + virtual void setGender(Gender gender) { mGender = gender; } /** * Gets the gender of this being. */ - int getGender() const { return mGender; } + Gender getGender() const { return mGender; } /** * Makes this being take the next step of his path. @@ -419,7 +425,7 @@ class Being : public Sprite std::string mSpeech; Text *mText; Uint16 mHairStyle, mHairColor; - Uint8 mGender; + Gender mGender; Uint32 mSpeechTime; Sint32 mPx, mPy; /**< Pixel coordinates */ Uint16 mStunMode; /**< Stun mode; zero if not stunned */ |