Class SimplePieceProvider

java.lang.Object
net.royalur.rules.simple.SimplePieceProvider
All Implemented Interfaces:
PieceProvider

public class SimplePieceProvider extends Object implements PieceProvider
Provides new instances of, and manipulations to, simple pieces.
  • Constructor Details

    • SimplePieceProvider

      public SimplePieceProvider()
  • Method Details

    • create

      public Piece create(PlayerType owner, int pathIndex)
      Description copied from interface: PieceProvider
      Generate a piece on the board.
      Specified by:
      create in interface PieceProvider
    • createIntroduced

      public Piece createIntroduced(PlayerType owner, int newPathIndex)
      Description copied from interface: PieceProvider
      Generates a new piece to be introduced to the board.
      Specified by:
      createIntroduced in interface PieceProvider
      Parameters:
      owner - The owner of the new piece.
      newPathIndex - The destination index of the piece in the player's path.
      Returns:
      The new piece that may be introduced to the board.
    • createMoved

      public Piece createMoved(Piece fromPiece, int newPathIndex)
      Description copied from interface: PieceProvider
      Generates a piece that has been moved from another tile on the board.
      Specified by:
      createMoved in interface PieceProvider
      Parameters:
      fromPiece - The piece that will be moved.
      newPathIndex - The destination index of the piece in the player's path.
      Returns:
      The new piece to be placed on the board.