summaryrefslogtreecommitdiffstats
path: root/pacman-c++/gameentity.h
diff options
context:
space:
mode:
authortotycro <totycro@unknown-horizons.org>2011-04-11 12:37:29 +0200
committertotycro <totycro@unknown-horizons.org>2011-04-11 12:37:29 +0200
commit51a3559e5df31018d7de14357f83c24e7e508d7e (patch)
tree89db0899d182dd5b3b770b07c8646dd80c915d4e /pacman-c++/gameentity.h
parent98f4a31e1a359a69dbcc0fa4055f36cefb6d4e02 (diff)
downloadfoop-51a3559e5df31018d7de14357f83c24e7e508d7e.tar.gz
foop-51a3559e5df31018d7de14357f83c24e7e508d7e.tar.bz2
foop-51a3559e5df31018d7de14357f83c24e7e508d7e.zip
progress
Diffstat (limited to 'pacman-c++/gameentity.h')
-rw-r--r--pacman-c++/gameentity.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/pacman-c++/gameentity.h b/pacman-c++/gameentity.h
index 82df438..2a771ee 100644
--- a/pacman-c++/gameentity.h
+++ b/pacman-c++/gameentity.h
@@ -1,19 +1,29 @@
1#ifndef GAMEENTITY_H 1#ifndef GAMEENTITY_H
2#define GAMEENTITY_H 2#define GAMEENTITY_H
3 3
4#include <QtGlobal>
5
4class Actor; 6class Actor;
5 7
6/** 8/**
7 * Abstract base class for entities that interact in the game 9 * Base class for entities that interact in the game
8 */ 10 */
9class GameEntity { 11class GameEntity {
12public:
13 GameEntity();
14 virtual ~GameEntity() {};
10 15
11 // returns whether the actor may enter this field 16 // returns whether the actor may enter this field
12 virtual bool checkEnter(Actor *actor) = 0; 17 virtual bool checkEnter(Actor *actor) { Q_UNUSED(actor); return true; } // default to true
13 18
14 // performs action when this actor acctually enters 19 // performs action when this actor acctually enters
15 virtual void enter(Actor *actor) = 0; 20 // returns whether this entity survives the entering
21 virtual bool enter(Actor *actor) { Q_UNUSED(actor); return true; } // default to no action/survive
22
23 virtual bool eaten() { return m_eaten; }
16 24
25protected:
26 bool m_eaten;
17}; 27};
18 28
19#endif // GAMEENTITY_H 29#endif // GAMEENTITY_H