From e2f1200c29de5f72125247b0516a1810909e9622 Mon Sep 17 00:00:00 2001 From: Samuel Barney Date: Mon, 25 Aug 2014 17:22:16 -0600 Subject: Added getters for the Components. Currently returning by reference. --- src/Mobs/Monster.h | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/Mobs/Monster.h b/src/Mobs/Monster.h index a3febc568..587c503e3 100644 --- a/src/Mobs/Monster.h +++ b/src/Mobs/Monster.h @@ -69,6 +69,11 @@ public: protected: eType m_MobType; + + cAIComponent * m_AI; + cAttackComponent * m_Attack; + cEnvironmentComponent * m_Environment; + cMovementComponent * m_Movement; public: cMonster(const AString & a_ConfigName, eType a_MobType, const AString & a_SoundHurt, const AString & a_SoundDeath, double a_Width, double a_Height); virtual void SpawnOn(cClientHandle & a_ClientHandle) /*override*/; @@ -78,6 +83,12 @@ public: virtual bool IsTame (void) const { return false; } virtual bool IsUndead (void) const { return false; } + // Get Functions + cAIComponent & GetAIComponent() { return *m_AI; } + cAttackComponent & GetAttackComponent() { return *m_Attack; } + cEnvironmentComponent & GetEnvironmentComponent() { return *m_Environment; } + cMovementComponent & GetMovementComponent() { return *m_Movement; } + // Get Functions - Temporary AString GetOwnerName (void) const { return m_OwnerName; } @@ -146,11 +157,6 @@ protected: AString m_SoundHurt; AString m_SoundDeath; - cAIComponent * m_AI; - cAttackComponent * m_Attack; - cEnvironmentComponent * m_Environment; - cMovementComponent * m_Movement; - // Temporary placement till I figure out where to put it float m_DropChanceWeapon; float m_DropChanceHelmet; -- cgit v1.2.3