コード例 #1
0
ファイル: Board.java プロジェクト: hellsant/wd-chess
 public void clearGameBoard() {
   for (final Tile tile : this.gameBoard) {
     if (tile.isTileOccupied()) {
       tile.removePiece();
     }
   }
 }
コード例 #2
0
ファイル: Board.java プロジェクト: hellsant/wd-chess
 public void calculateActivePieces() {
   for (final Tile t : this.gameBoard) {
     if (t.isTileOccupied()) {
       final Piece p = t.getPiece();
       switch (p.getPieceAllegiance()) {
         case WHITE:
           this.whitePieces.add(p);
           break;
         case BLACK:
           this.blackPieces.add(p);
           break;
         default:
           throw new RuntimeException("wtf");
       }
     }
   }
 }