From aebe130299a3c3d14a0d89e68195c303ca120c1b Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Sat, 22 Dec 2012 09:39:13 +0000 Subject: Reduced most mobs' constructors to oneliners by passing parameters to superclasses git-svn-id: http://mc-server.googlecode.com/svn/trunk@1095 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/Mobs/Monster.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'source/Mobs/Monster.h') diff --git a/source/Mobs/Monster.h b/source/Mobs/Monster.h index 2c26045ff..066f17495 100644 --- a/source/Mobs/Monster.h +++ b/source/Mobs/Monster.h @@ -25,7 +25,12 @@ class cMonster : public: // tolua_end - cMonster(void); + /** Creates the mob object. + * If a_ConfigName is not empty, the configuration is loaded using GetMonsterConfig() + * a_ProtocolMobType is the ID of the mob used in the protocol ( http://wiki.vg/Entities#Mobs , 2012_12_22) + * a_SoundHurt and a_SoundDeath are assigned into m_SoundHurt and m_SoundDeath, respectively + */ + cMonster(const AString & a_ConfigName, char a_ProtocolMobType, const AString & a_SoundHurt, const AString & a_SoundDeath); CLASS_PROTODEF(cMonster); @@ -52,7 +57,10 @@ public: virtual void EventSeePlayer(cEntity *); float m_SightDistance; virtual cPlayer * FindClosestPlayer(); // non static is easier. also virtual so other mobs can implement their own searching algo - virtual void GetMonsterConfig(const char* pm_name); + + /// Reads the monster configuration for the specified monster name and assigns it to this object. + void GetMonsterConfig(const AString & a_Name); + virtual void EventLosePlayer(); virtual void CheckEventLostPlayer(); -- cgit v1.2.3