Removed MonsterManager's Singleton status, RoomData now has mgr members

RoomData now has monsterMgr and waypointMgr members, so that it can
compare it's characters to the monster & waypoints, etc.

RoomManager has been updated. It now has a database reference, which is
passed to the monsterMgr of new rooms. The room API also has functions
which expose these managers to lua.
This commit is contained in:
Kayne Ruse
2015-01-11 19:47:42 +11:00
parent 051ed0f14c
commit d0b2f8e12f
11 changed files with 72 additions and 26 deletions
+11
View File
@@ -36,6 +36,9 @@ int RoomManager::Create(std::string roomName, std::string tileset) {
newRoom->SetTileset(tileset);
newRoom->pager.SetLuaState(lua);
newRoom->monsterMgr.SetLuaState(lua);
newRoom->monsterMgr.SetDatabase(database);
newRoom->waypointMgr.SetLuaState(lua);
//finish the routine
return counter++;
@@ -122,3 +125,11 @@ lua_State* RoomManager::SetLuaState(lua_State* L) {
lua_State* RoomManager::GetLuaState() {
return lua;
}
sqlite3* RoomManager::SetDatabase(sqlite3* db) {
return database = db;
}
sqlite3* RoomManager::GetDatabase() {
return database;
}