From b6e7b6c6cb3ea26157e3a78713cc9621dc46b2d7 Mon Sep 17 00:00:00 2001 From: Philipp Sehmisch Date: Fri, 22 Feb 2008 19:58:29 +0000 Subject: 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 --- src/being.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/being.h') 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; 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 */ -- cgit v1.2.3-70-g09d2