Interface PieceProvider

All Known Implementing Classes:
SimplePieceProvider

public interface PieceProvider
An interface that provides instances of pieces. This may be used to store custom information with each piece, for situations such as adding stacking or unique piece behavior.
  • Method Summary

    Modifier and Type
    Method
    Description
    create(PlayerType owner, int pathIndex)
    Generate a piece on the board.
    createIntroduced(PlayerType owner, int newPathIndex)
    Generates a new piece to be introduced to the board.
    createMoved(Piece originPiece, int newPathIndex)
    Generates a piece that has been moved from another tile on the board.
  • Method Details

    • create

      Piece create(PlayerType owner, int pathIndex)
      Generate a piece on the board.
    • createIntroduced

      Piece createIntroduced(PlayerType owner, int newPathIndex)
      Generates a new piece to be introduced to the board.
      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

      Piece createMoved(Piece originPiece, int newPathIndex)
      Generates a piece that has been moved from another tile on the board.
      Parameters:
      originPiece - 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.