Class Walk


public class Walk extends Move
The type Walk.
  • Field Details

    • source

      public Location source
      The Source.
    • destination

      public Location destination
      The Destination.
  • Constructor Details

    • Walk

      public Walk(Piece sourcePiece, Location destination)
      Instantiates a new Walk.
      Parameters:
      sourcePiece - the source piece
      destination - the destination
  • Method Details

    • applyOnBoard

      public boolean applyOnBoard(Board board)
      Apply on board boolean.
      Specified by:
      applyOnBoard in class Move
      Parameters:
      board - the board
      Returns:
      the boolean
    • undoOnBoard

      public void undoOnBoard(Board board)
      Undo on board.
      Specified by:
      undoOnBoard in class Move
      Parameters:
      board - the board
    • isValidApplyOnBoard

      public boolean isValidApplyOnBoard(Board board)
      Is valid apply on board boolean.
      Overrides:
      isValidApplyOnBoard in class Move
      Parameters:
      board - the board
      Returns:
      the boolean
    • getStartpointLocation

      public Location getStartpointLocation()
      Gets startpoint location.
      Specified by:
      getStartpointLocation in class Move
      Returns:
      the startpoint location
    • getEndpointLocation

      public Location getEndpointLocation()
      Gets endpoint location.
      Specified by:
      getEndpointLocation in class Move
      Returns:
      the endpoint location
    • toString

      public String toString()
      To string string.
      Overrides:
      toString in class Object
      Returns:
      the string