public class ChessHelper
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static ChessBoardModel |
applyMove(ChessRules rules,
ChessPosition position,
ChessMovePath move) |
static ChessBoardModel |
applyMoveAndSwitch(ChessRules rules,
ChessPosition position,
ChessMovePath move) |
static boolean |
isCheck(ChessRules rules,
ChessPosition position,
ChessMovePath move,
boolean swapSides)
Check if a move would lead to a Check situation.
|
public static boolean isCheck(ChessRules rules, ChessPosition position, ChessMovePath move, boolean swapSides) throws IllegalMoveException
rules - the chess rules componentposition - the initial positionmove - the move to checkswapSides - if true check if the move would lead to a check in favor of the player moving, if false for the
opponent.IllegalMoveExceptionpublic static ChessBoardModel applyMove(ChessRules rules, ChessPosition position, ChessMovePath move) throws IllegalMoveException
IllegalMoveExceptionpublic static ChessBoardModel applyMoveAndSwitch(ChessRules rules, ChessPosition position, ChessMovePath move) throws IllegalMoveException
IllegalMoveExceptionCopyright © 2015. All Rights Reserved.