diff options
author | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2010-02-05 22:15:43 +0100 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2010-02-06 21:25:37 +0100 |
commit | 242e3bb8d92def67d5c30f2f2fd974cfb117ec04 (patch) | |
tree | 7f247e04e238a0edc0281ec8ed85539b2be81137 /src/flooritemmanager.cpp | |
parent | 51e14c9d7aab75fe60f68d4943759eef66eafe9a (diff) | |
download | mana-242e3bb8d92def67d5c30f2f2fd974cfb117ec04.tar.gz mana-242e3bb8d92def67d5c30f2f2fd974cfb117ec04.tar.bz2 mana-242e3bb8d92def67d5c30f2f2fd974cfb117ec04.tar.xz mana-242e3bb8d92def67d5c30f2f2fd974cfb117ec04.zip |
Merged the Engine class into the Game class
There was little point in keeping the Engine class separate. It wasn't
an engine at all, but only kept track of the currently active map, a job
more suitable for the Game class anyway.
Diffstat (limited to 'src/flooritemmanager.cpp')
-rw-r--r-- | src/flooritemmanager.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/flooritemmanager.cpp b/src/flooritemmanager.cpp index 9bfd02ae..72735d74 100644 --- a/src/flooritemmanager.cpp +++ b/src/flooritemmanager.cpp @@ -22,6 +22,8 @@ #include "flooritemmanager.h" #include "flooritem.h" +#include "game.h" + #include "utils/dtor.h" FloorItemManager::~FloorItemManager() @@ -29,9 +31,9 @@ FloorItemManager::~FloorItemManager() clear(); } -FloorItem *FloorItemManager::create(int id, int itemId, - int x, int y, Map *map) +FloorItem *FloorItemManager::create(int id, int itemId, int x, int y) { + Map *map = Game::instance()->getCurrentMap(); FloorItem *floorItem = new FloorItem(id, itemId, x, y, map); mFloorItems.push_back(floorItem); return floorItem; @@ -49,9 +51,9 @@ void FloorItemManager::clear() mFloorItems.clear(); } -FloorItem *FloorItemManager::findById(int id) +FloorItem *FloorItemManager::findById(int id) const { - FloorItemIterator i; + FloorItems::const_iterator i; for (i = mFloorItems.begin(); i != mFloorItems.end(); i++) { if ((*i)->getId() == id) @@ -63,9 +65,9 @@ FloorItem *FloorItemManager::findById(int id) return NULL; } -FloorItem *FloorItemManager::findByCoordinates(int x, int y) +FloorItem *FloorItemManager::findByCoordinates(int x, int y) const { - FloorItemIterator i; + FloorItems::const_iterator i; for (i = mFloorItems.begin(); i != mFloorItems.end(); i++) { if ((*i)->getX() == x && (*i)->getY() == y) |