Interface State<T>

Type Parameters:
T - represents the moves that can be applied to the states
All Known Subinterfaces:
State<T>, State<T>, TwoPhaseMoveState<T>, TwoPhaseMoveState<T>, TwoPhaseMoveState<T>

public interface State<T>
Represents functionality shared between the state of puzzles and two-player games.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    isLegalMove(T move)
    Returns whether the move provided can be applied to the state.
    void
    makeMove(T move)
    Applies the move provided to the state.
  • Method Details

    • isLegalMove

      boolean isLegalMove(T move)
      Returns whether the move provided can be applied to the state.
      Parameters:
      move - represents the move to be made
      Returns:
      whether the move provided can be applied to the state
    • makeMove

      void makeMove(T move)
      Applies the move provided to the state. This method should be called if and only if isLegalMove(Object) returns true.
      Parameters:
      move - represents the move to be made