Interface TwoPhaseMoveState<T>

Type Parameters:
T - represents the type of the source and the target of the moves
All Superinterfaces:
State<TwoPhaseMoveState.TwoPhaseMove<T>>
All Known Subinterfaces:
TwoPhaseMoveState<T>, TwoPhaseMoveState<T>

public interface TwoPhaseMoveState<T> extends State<TwoPhaseMoveState.TwoPhaseMove<T>>
Represents the states of puzzles or two-player games whose moves are described by two objects, i.e., from and to. From a user interface-centric viewpoint, it is suitable for puzzles or two-player games where moves are made from a source to a target location. Thus, a move is specified in two phases, each requiring a selection, e.g., two subsequent mouse clicks are need.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final record 
    Represents moves that are described by two objects, i.e., from and to.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns whether it is possible to make a move from the argument specified.

    Methods inherited from interface common.State

    isLegalMove, makeMove
  • Method Details

    • isLegalToMoveFrom

      boolean isLegalToMoveFrom(T from)
      Returns whether it is possible to make a move from the argument specified.
      Parameters:
      from - represents where to move from
      Returns:
      whether it is possible to make a move from the argument specified