X-Git-Url: https://jfr.im/git/irc/gameservirc.git/blobdiff_plain/99c0151e0d0ad682e7ee58de89f2e11b18a7864c..33ae7ca771436b985cc16aba2f3100de864e789f:/gameserv-2.0/libgameservgldl/src/GameLayer/GameObjects/MonsterGO.cpp diff --git a/gameserv-2.0/libgameservgldl/src/GameLayer/GameObjects/MonsterGO.cpp b/gameserv-2.0/libgameservgldl/src/GameLayer/GameObjects/MonsterGO.cpp index 8df537e..fb14740 100644 --- a/gameserv-2.0/libgameservgldl/src/GameLayer/GameObjects/MonsterGO.cpp +++ b/gameserv-2.0/libgameservgldl/src/GameLayer/GameObjects/MonsterGO.cpp @@ -8,10 +8,23 @@ using std::string; MonsterGO::MonsterGO() : GameObject() { + Initialize(); } MonsterGO::MonsterGO(const string &Id) : GameObject(Id) { + Initialize(); +} + +void MonsterGO::Initialize(void) +{ + mGold = 0; + mHealth = 0; + mMaxHealth = 0; + mStrength = 0; + mDefense = 0; + mExperience = 0; + mAlive = true; } MonsterGO::~MonsterGO() @@ -34,54 +47,72 @@ string MonsterGO::Name(void) const return mName; } -void MonsterGO::Strength(const int &value) +void MonsterGO::LevelId(const string &value) +{ + mfkLevelId = value; +} + +string MonsterGO::LevelId(void) const +{ + return mfkLevelId; +} + +void MonsterGO::Strength(const unsigned int &value) { - assert(value > 0); mStrength = value; } -int MonsterGO::Strength(void) const +unsigned int MonsterGO::Strength(void) const { return mStrength; } -void MonsterGO::Defense(const int &value) +void MonsterGO::Defense(const unsigned int &value) { - assert(value > 0); mDefense = value; } -int MonsterGO::Defense(void) const +unsigned int MonsterGO::Defense(void) const { return mDefense; } -void MonsterGO::Gold(const unsigned long &value) +void MonsterGO::Gold(const unsigned long int &value) { mGold = value; } -unsigned long MonsterGO::Gold(void) const +unsigned long int MonsterGO::Gold(void) const { return mGold; } -void MonsterGO::Health(const int &value) +void MonsterGO::Experience(const unsigned long int &value) +{ + mExperience = value; +} + +unsigned long int MonsterGO::Experience(void) const +{ + return mExperience; +} + +void MonsterGO::Health(const unsigned int &value) { mHealth = value; } -int MonsterGO::Health(void) const +unsigned int MonsterGO::Health(void) const { return mHealth; } -void MonsterGO::MaxHealth(const int &value) +void MonsterGO::MaxHealth(const unsigned int &value) { mMaxHealth = value; } -int MonsterGO::MaxHealth(void) const +unsigned int MonsterGO::MaxHealth(void) const { return mMaxHealth; } @@ -108,9 +139,19 @@ string MonsterGO::DeathCry(void) const return mDeathCry; } +void MonsterGO::Alive(const bool &value) +{ + mAlive = value; +} + +bool MonsterGO::Alive(void) const +{ + return mAlive; +} + bool MonsterGO::operator==(const MonsterGO &right) const { - return mId == right.mId && mHealth == right.mHealth && + return mId == right.mId && mfkLevelId == right.mfkLevelId && mHealth == right.mHealth && mDefense == right.mDefense && mDeathCry == right.mDeathCry && mGold == right.mGold && mHealth == right.mHealth && mMaxHealth == right.mMaxHealth && mName == right.mName && @@ -120,4 +161,9 @@ bool MonsterGO::operator==(const MonsterGO &right) const bool MonsterGO::operator!=(const MonsterGO &right) const { return (!(*this == right)); -} \ No newline at end of file +} + +ObjectTypes::ObjectType MonsterGO::ObjectType(void) const +{ + return ObjectTypes::Monster; +}