Class MoveLeft
java.lang.Object
com.chess.backend.gamemodel.abstractmoves.MoveLeft
Represents the implementation of a move to the left.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconcretise
(Chessboard chessboard, Piece piece, boolean attack, boolean jump, boolean peaceful) Generate concrete possible moves from a given piece and game context.left
(Chessboard chessboard, Piece piece, boolean attack, boolean jump, boolean peaceful, int limit) Generate concrete possible moves from a given piece and game context.
-
Constructor Details
-
MoveLeft
public MoveLeft()
-
-
Method Details
-
concretise
public static Set<Move> concretise(Chessboard chessboard, Piece piece, boolean attack, boolean jump, boolean peaceful) Generate concrete possible moves from a given piece and game context. Direction: Left, no limit- Parameters:
chessboard
- The chessboard.piece
- The originating square.attack
- Whether the piece may move to an occupied square. This would result in an attack with a captured piece.jump
- Whether the piece may jump over other pieces (e.g. the knight).peaceful
- Whether the piece may move to an empty field.- Returns:
- HashSet of concrete moves
-
left
public static Set<Move> left(Chessboard chessboard, Piece piece, boolean attack, boolean jump, boolean peaceful, int limit) Generate concrete possible moves from a given piece and game context. Direction: Left, limit can be set- Parameters:
chessboard
- The chessboard.piece
- The originating square.attack
- Whether the piece may move to an occupied square. This would result in an attack with a captured piece.jump
- Whether the piece may jump over other pieces (e.g. the knight).limit
- The maximum of steps.peaceful
- Whether the piece may move to an empty field.- Returns:
- HashSet of concrete moves
-