Class VassalMapPieceIndex
java.lang.Object
VASSAL.build.module.index.VassalMapPieceIndex
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addOrUpdatePiece
(GamePiece piece) A piece has been added to our map.Return a list of pieces in range of a given point.Return a list of pieces in range of a given point.Return a list of pieces in range of a given piecevoid
removePiece
(GamePiece piece) A piece has been removed from our map
-
Constructor Details
-
VassalMapPieceIndex
-
-
Method Details
-
addOrUpdatePiece
A piece has been added to our map.- Parameters:
piece
- Piece added
-
removePiece
A piece has been removed from our map- Parameters:
piece
- Removed piece
-
getPieces
-
getPieces
-
getPieces
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 aroundrange
- Range in units appropriate to the search point- Returns:
- List of pieces
-
getPieces
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 aroundrange
- Range in units appropriate to the search pointforceAsPixels
- Force the search to be in pixels, even if the target point is on a regular grid- Returns:
- List of pieces
-
getPieces
-