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 TypeMethodDescriptionboolean
isLegalMove
(T move) Returns whether the move provided can be applied to the state.void
Applies the move provided to the state.
-
Method Details
-
isLegalMove
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
Applies the move provided to the state. This method should be called if and only ifisLegalMove(Object)
returnstrue
.- Parameters:
move
- represents the move to be made
-