Class VassalMapPieceIndex

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

public class VassalMapPieceIndex extends Object
Maintain a set of Indexes about location related information of pieces on a Vassal Map. 1. Maintain a Quadtree of x,y locations to enable fast direct lookup and ranged selections 2. Maintain cross-references of all values for CurrentZone and LocationName to be able to quickly find all pieces in a specified Zone, Region or module defined location like a Hex.
  • Constructor Details

    • VassalMapPieceIndex

      public VassalMapPieceIndex(Map map)
  • Method Details

    • addOrUpdatePiece

      public void addOrUpdatePiece(GamePiece piece)
      A piece has been added to our map.
      Parameters:
      piece - Piece added
    • removePiece

      public void removePiece(GamePiece piece)
      A piece has been removed from our map
      Parameters:
      piece - Removed piece
    • getPieces

      public List<GamePiece> getPieces(GamePiece piece, int range)
      Return a list of pieces in range of a given piece
      Parameters:
      piece - Piece to search around
      range - Range in units appropriate to the search point
      Returns:
      List of pieces
    • getPieces

      public List<GamePiece> getPieces(GamePiece piece, int range, boolean forceAsPixels)
    • getPieces

      public List<GamePiece> getPieces(Point point, int range)
      Return a list of pieces in range of a given point. NOTE: Does not need to be accurate, may include pieces out of range, range will be accurately checked later, but must not exclude pieces that are in range
      Parameters:
      point - Point to search around
      range - Range in units appropriate to the search point
      Returns:
      List of pieces
    • getPieces

      public List<GamePiece> getPieces(Point point, int range, boolean forceAsPixels)
      Return a list of pieces in range of a given point. NOTE: Does not need to be accurate, may include pieces out of range, range will be accurately checked later, but must not exclude pieces that are in range
      Parameters:
      point - Point to search around
      range - Range in units appropriate to the search point
      forceAsPixels - Force the search to be in pixels, even if the target point is on a regular grid
      Returns:
      List of pieces
    • getPieces

      public Set<GamePiece> getPieces(String propertyName, String propertyValue)