public Panroom getCurrentRoom() { if (currentRoom == null) { try { currentRoom = getFirstRoom(); } catch (final Exception e) { throw Pantil.toRuntimeException(e); } } initializingRoom = false; return currentRoom; }
protected Panroom getFirstRoom() throws Exception { /* Games can override this and retrieve the first room however they want. They can throw UnsupportedOperationExceptions in getFirstRoomSize and init if they don't want to use them. Nothing else will. This method allows init to call methods that use Pangame.getCurrentRoom(). If it's overridden, the game will need to be careful about that. */ final Panroom room = Pangine.getEngine().createRoom(Pantil.vmid(), getFirstRoomSize()); setCurrentRoomIfNeeded(room); init(room); return room; }