Creation of the room (static components of the scene) could be decoupled from the initialization of the scene by splitting it off into an instance of the Room interface. This will make it much easier to implement room selections by the user.
Environment could then have a method updateRoom for setting the displayed room.
def updateRoom(room: Room) {
// If this.room is not null, remove it from the scene
this.room = room
// Add this.room to the scene
}
One possibility is that rooms could be dynamic, and they could be updated every frame via the same method, but with no arguments.
def updateRoom() = room.update()
Creation of the room (static components of the scene) could be decoupled from the initialization of the scene by splitting it off into an instance of the Room interface. This will make it much easier to implement room selections by the user.
Environment could then have a method
updateRoomfor setting the displayed room.One possibility is that rooms could be dynamic, and they could be updated every frame via the same method, but with no arguments.