From 59accfe17512a663d852205dcbe7bc7547400bb3 Mon Sep 17 00:00:00 2001 From: Björn Steinbrink Date: Sat, 25 Feb 2006 10:21:24 +0000 Subject: Added a logic method to the being manager. --- src/beingmanager.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/beingmanager.cpp') 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) -- cgit v1.2.3-70-g09d2