summaryrefslogtreecommitdiff
path: root/src/game-server/spawnarea.hpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2007-03-31 12:15:39 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2007-03-31 12:15:39 +0000
commite0c185864c09cebd3a7a0118d20ca3a368cbdb6e (patch)
treeef1b06b20e1d5ef2ae94a8b0a6ea739619fb4eed /src/game-server/spawnarea.hpp
parenteba3a8635b308475aa4bcfc5f5cd058c48ed679d (diff)
downloadmanaserv-e0c185864c09cebd3a7a0118d20ca3a368cbdb6e.tar.gz
manaserv-e0c185864c09cebd3a7a0118d20ca3a368cbdb6e.tar.bz2
manaserv-e0c185864c09cebd3a7a0118d20ca3a368cbdb6e.tar.xz
manaserv-e0c185864c09cebd3a7a0118d20ca3a368cbdb6e.zip
Added a DeathListener interface, which the SpawnArea now uses to get notified
about dying beings, so that it knows when to spawn more.
Diffstat (limited to 'src/game-server/spawnarea.hpp')
-rw-r--r--src/game-server/spawnarea.hpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/game-server/spawnarea.hpp b/src/game-server/spawnarea.hpp
index 5d141fa8..fb293b53 100644
--- a/src/game-server/spawnarea.hpp
+++ b/src/game-server/spawnarea.hpp
@@ -25,13 +25,16 @@
#define _TMWSERV_SPAWNAREA
#include "point.h"
+#include "game-server/deathlistener.hpp"
#include "game-server/thing.hpp"
+class Being;
+
/**
* A spawn area, where monsters spawn. The area is a rectangular field and will
* spawn a certain number of a given monster type.
*/
-class SpawnArea : public Thing
+class SpawnArea : public Thing, public DeathListener
{
public:
SpawnArea(int mapId, const Rectangle &zone);
@@ -40,6 +43,8 @@ class SpawnArea : public Thing
virtual void update();
+ virtual void died(Being *being);
+
protected:
Rectangle mZone;
int mMaxBeings; /**< Maximum population of this area. */