Package threeChess

Class CheatBoard

  • All Implemented Interfaces:
    java.lang.Cloneable

    public class CheatBoard
    extends Board
    implements java.lang.Cloneable
    Main class for representing game state. The board maps each position to the piece at that posiiton, or null is free. It also records previous moves, as well as whose move it is, and which pieces have been captured by which player. CheatBoard overrides the isLegalMove function to always return true, so any Board position can be used.
    • Constructor Detail

      • CheatBoard

        public CheatBoard()
        Creates a standard board
    • Method Detail

      • isLegalMove

        public boolean isLegalMove​(Position start,
                                   Position end)
        All moves are deemed legal
        Overrides:
        isLegalMove in class Board
        Parameters:
        start - the starting position of the piece
        end - the end position the piece intends to move to
        Returns:
        true