Class MoveDiagonal

java.lang.Object
com.chess.backend.gamemodel.abstractmoves.MoveDiagonal

public class MoveDiagonal extends Object
Represents the implementation of a diagonal move.
  • Constructor Details

    • MoveDiagonal

      public MoveDiagonal()
  • 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: Diagonal, 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
    • diagonal

      public static Set<Move> diagonal(Chessboard chessboard, Piece piece, boolean attack, boolean jump, boolean peaceful, int limit)
      Generate concrete possible moves from a given piece and game context. Direction: Diagonal (every direction), 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).
      peaceful - Whether the piece may move to an empty field.
      limit - The maximum of steps.
      Returns:
      HashSet of concrete moves
    • diagonal

      public static Set<Move> diagonal(Chessboard chessboard, Piece piece, boolean attack, boolean jump, boolean peaceful, int limit, Position.Direction direction)
      Generate concrete possible moves from a given piece and game context. Direction: Diagonal backward 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.
      Returns:
      HashSet of concrete moves