コード例 #1
0
 @Override
 public void enter() {
   if (bazaarCap != null) {
     Tile tile = bazaarCap.drawNextTile();
     if (tile != null) {
       nextTile(tile);
       return;
     }
   }
   if (getTilePack().isEmpty()) {
     if (abbeyCap != null && !getActivePlayer().equals(abbeyCap.getAbbeyRoundLastPlayer())) {
       if (abbeyCap.getAbbeyRoundLastPlayer() == null) {
         abbeyCap.setAbbeyRoundLastPlayer(getActivePlayer());
       }
       next(CleanUpTurnPartPhase.class);
       return;
     }
     next(GameOverPhase.class);
     return;
   }
   if (makeDebugDraw()) {
     return;
   }
   if (isLocalPlayer(getActivePlayer())) {
     // call only from one client (from the active one)
     getConnection().send(new MakeDrawMessage(game.getGameId(), getTilePack().size(), 1));
   }
 }
コード例 #2
0
ファイル: DrawPhase.java プロジェクト: hexmind/JCloisterZone
 @Override
 public void enter() {
   if (bazaarCap != null) {
     Tile tile = bazaarCap.drawNextTile();
     if (tile != null) {
       nextTile(tile);
       return;
     }
   }
   if (getTilePack().isEmpty()) {
     if (abbeyCap != null && !getActivePlayer().equals(abbeyCap.getAbbeyRoundLastPlayer())) {
       if (abbeyCap.getAbbeyRoundLastPlayer() == null) {
         abbeyCap.setAbbeyRoundLastPlayer(game.getPrevPlayer(getActivePlayer()));
       }
       next(CleanUpTurnPartPhase.class);
       return;
     }
     next(GameOverPhase.class);
     return;
   }
   if (makeDebugDraw()) {
     return;
   }
   int rndIndex = game.getRandom().nextInt(getTilePack().size());
   Tile tile = getTilePack().drawTile(rndIndex);
   nextTile(tile);
 }