summaryrefslogtreecommitdiff
path: root/src/beingmanager.cpp
diff options
context:
space:
mode:
authorBjörn Steinbrink <B.Steinbrink@gmx.de>2006-02-25 10:21:24 +0000
committerBjörn Steinbrink <B.Steinbrink@gmx.de>2006-02-25 10:21:24 +0000
commit59accfe17512a663d852205dcbe7bc7547400bb3 (patch)
treed00baff7f1413090f07c086977e09d4d08f41c30 /src/beingmanager.cpp
parent1c4742e530271e10ae949cf7e85402bee867e298 (diff)
downloadmana-59accfe17512a663d852205dcbe7bc7547400bb3.tar.gz
mana-59accfe17512a663d852205dcbe7bc7547400bb3.tar.bz2
mana-59accfe17512a663d852205dcbe7bc7547400bb3.tar.xz
mana-59accfe17512a663d852205dcbe7bc7547400bb3.zip
Added a logic method to the being manager.
Diffstat (limited to 'src/beingmanager.cpp')
-rw-r--r--src/beingmanager.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/beingmanager.cpp b/src/beingmanager.cpp
index 311cfa91..c7edc82b 100644
--- a/src/beingmanager.cpp
+++ b/src/beingmanager.cpp
@@ -121,6 +121,26 @@ Beings* BeingManager::getAll()
return &mBeings;
}
+void BeingManager::logic()
+{
+ BeingIterator i = mBeings.begin();
+ while (i != mBeings.end())
+ {
+ Being *being = (*i);
+
+ being->logic();
+
+ if (being->action == Being::MONSTER_DEAD && being->mFrame >= 20)
+ {
+ delete being;
+ i = mBeings.erase(i);
+ }
+ else {
+ i++;
+ }
+ }
+}
+
void BeingManager::clear()
{
if (player_node)