Minor tweaks after a failed attempt at metatables
This commit is contained in:
@@ -41,7 +41,6 @@ RoomData* RoomManager::CreateRoom(MapType mapType) {
|
||||
//create the generator, use a lambda because I'm lazy
|
||||
newRoom->generator = [mapType]() -> BaseGenerator* {
|
||||
switch(mapType) {
|
||||
case MapType::NONE: //use overworld as a default
|
||||
case MapType::OVERWORLD: return new OverworldGenerator();
|
||||
case MapType::RUINS: return new RuinsGenerator();
|
||||
case MapType::TOWERS: return new TowersGenerator();
|
||||
@@ -98,7 +97,8 @@ void RoomManager::UnloadRoom(int uid) {
|
||||
RoomData* RoomManager::GetRoom(int uid) {
|
||||
RoomData* ptr = FindRoom(uid);
|
||||
if (ptr) return ptr;
|
||||
return CreateRoom(MapType::NONE);
|
||||
//TODO: proper Get() method
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
RoomData* RoomManager::FindRoom(int uid) {
|
||||
|
||||
@@ -39,6 +39,8 @@ static int getRoom(lua_State* L) {
|
||||
}
|
||||
|
||||
static int createRoom(lua_State* L) {
|
||||
//TODO: check parameter count for the glue functions
|
||||
|
||||
//get the room manager
|
||||
lua_pushstring(L, ROOM_MANAGER_PSEUDOINDEX);
|
||||
lua_gettable(L, LUA_REGISTRYINDEX);
|
||||
|
||||
Reference in New Issue
Block a user