Examples of BoardPiece


Examples of org.darkhelm.dragonchess.server.board.BoardPiece

          break;
        }
      }

      // Figure out what piece (if any) is at the destination location.
      BoardPiece destPiece = boardDest.get(vertDest, horizDest);

      // Destination piece is the same team.
      if (destPiece != null && destPiece.getTeam() == team) {
        break;
       
        // Destination piece is the other team.
      } else if (destPiece != null) {
        PieceDef destPieceDef = PieceDef.get(destPiece.getType());

        score = destPieceDef.getValue();
      }

      // CAPTURE can only capture, MOVE can only move.
View Full Code Here

Examples of org.darkhelm.dragonchess.server.board.BoardPiece

    // Figure out which board the move is going to.
    BoardDef boardDest = set.getBoard(Boards.values()[boardMove]);

    // Check what is at the destination.
    BoardPiece destPiece = boardDest.get(vertDest, horizDest);

    // Destination piece is on the same team.
    if (destPiece != null && destPiece.getTeam() == team) {
      return ret;

      // Destination piece is on the other team.
    } else if (destPiece != null) {
      PieceDef destPieceDef = PieceDef.get(destPiece.getType());

      score = destPieceDef.getValue();
    }

    // If there is a piece that can be "captured" it can be frozen.
View Full Code Here

Examples of org.darkhelm.dragonchess.server.board.BoardPiece

  }

  private List<Move> getHomeMoves(Teams team, BoardDef board, int horizPos, int vertPos, boolean check) {
    List<Move> ret = new ArrayList<Move>();
   
    BoardPiece bPiece = board.get(vertPos, horizPos);
   
    for(Position pos : board.getSet().getHomes(bPiece)) {
      long hash = 0;
     
      // Clone the current board set for this move.
      BoardSet set = board.getSet().clone();
     
      // Figure out which board the move is going to.
      BoardDef boardDest = set.getBoard(pos.getBoard());

      // Check what is at the destination.
      BoardPiece destPiece = boardDest.get(pos.getVert(), pos.getHoriz());
     
      // If the home position is not empty, skip.
      if(destPiece != null) {
        continue;
      }
View Full Code Here

Examples of org.darkhelm.dragonchess.server.board.BoardPiece

    // Figure out which board the move is going to.
    BoardDef boardDest = set.getBoard(Boards.values()[boardMove]);

    // Check what is at the destination.
    BoardPiece destPiece = boardDest.get(vertDest, horizDest);

    // Destination piece is on the same team.
    if (destPiece != null && destPiece.getTeam() == team) {
      return ret;

      // Destination piece is on the other team.
    } else if (destPiece != null) {
      PieceDef destPieceDef = PieceDef.get(destPiece.getType());

      score = destPieceDef.getValue();
    }

    // FROM_AFAR only makes sense with capture moves.
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.