From 6c44b14d2bae2120c069ab205f95b2e51de2caea Mon Sep 17 00:00:00 2001 From: manuel Date: Mon, 11 Apr 2011 13:42:28 +0200 Subject: make constants::server extern code cleanup --- pacman-c++/gameentity.h | 47 +++++++++++++++++++++++++++++++---------------- 1 file changed, 31 insertions(+), 16 deletions(-) (limited to 'pacman-c++/gameentity.h') diff --git a/pacman-c++/gameentity.h b/pacman-c++/gameentity.h index 0c0ab9c..afa3aba 100644 --- a/pacman-c++/gameentity.h +++ b/pacman-c++/gameentity.h @@ -8,24 +8,39 @@ class Actor; /** * Base class for entities that interact in the game */ -class GameEntity { +class GameEntity +{ public: GameEntity(); - virtual ~GameEntity() {}; - - // returns whether the actor may enter this field - virtual bool checkEnter(Actor *actor) { Q_UNUSED(actor); return true; } // default to true - - // performs action when this actor acctually enters - // returns whether this entity survives the entering - virtual bool enter(Actor *actor) { Q_UNUSED(actor); return true; } // default to no action/survive - - // check whether this entity is regarded as eaten - // (and can be removed in the next tick) - virtual bool eaten() { return m_eaten; } - - // called when an instance acctually dies for creating effects - virtual void onDie(Actor *actor) { Q_UNUSED(actor); }; + virtual ~GameEntity() + {}; + + /* returns whether the actor may enter this field */ + virtual bool checkEnter(Actor *) + { + return true; + } + + /* performs action when this actor acctually enters + * returns whether this entity survives the entering + */ + virtual bool enter(Actor *) + { + /* default to no action/survive */ + return true; + } + + /* check whether this entity is regarded as eaten + * (and can be removed in the next tick) + */ + virtual bool eaten() + { + return m_eaten; + } + + /* called when an instance acctually dies for creating effects */ + virtual void onDie(Actor *) + {}; protected: -- cgit v1.2.3