コード例 #1
0
ファイル: Pangame.java プロジェクト: weijiang8410/pandam
 public Panroom getCurrentRoom() {
   if (currentRoom == null) {
     try {
       currentRoom = getFirstRoom();
     } catch (final Exception e) {
       throw Pantil.toRuntimeException(e);
     }
   }
   initializingRoom = false;
   return currentRoom;
 }
コード例 #2
0
ファイル: Pangame.java プロジェクト: weijiang8410/pandam
 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;
 }