Module app

Interface MoveMatcher<P extends Piece>

Type Parameters:
P -

public interface MoveMatcher<P extends Piece>
Emulates enum-like behavior on moves.

Every Move has `match` method that accepts a matcher and calls appropriate method.

Without the matcher we have to use `instanceof` and downcast to desired type.

  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    pieceMove(P piece, Field field)
     
    default void
    piecePick(P piece, P pick)
     
  • Method Details

    • pieceMove

      default void pieceMove(P piece, Field field)
    • piecePick

      default void piecePick(P piece, P pick)