Class PiecePropertyIndex

java.lang.Object
VASSAL.build.module.index.PiecePropertyIndex

public class PiecePropertyIndex extends Object
Maintain a reverse cross-reference of property values to GamePieces that have that value for a given property.
  • Constructor Details

    • PiecePropertyIndex

      public PiecePropertyIndex(String propertyName)
  • Method Details

    • addOrUpdatePiece

      public void addOrUpdatePiece(GamePiece piece)
      Add a new piece to the index, or check and update the value for an existing piece
      Parameters:
      piece - Piece added/changed
    • getCount

      public int getCount()
    • removePiece

      public void removePiece(GamePiece piece)
      Remove a piece from the index
      Parameters:
      piece - Piece removed
    • getPieces

      public Set<GamePiece> getPieces(String propertyValue)
      Return the set of pieces that have the specified value for the property we are indexing
      Parameters:
      propertyValue - Value to check
      Returns:
      Set of pieces that have that value