Interface MapGrid
- All Known Subinterfaces:
GeometricGrid
- All Known Implementing Classes:
HexGrid
,RegionGrid
,SquareGrid
,ZonedGrid
public interface MapGrid
A MapGrid overlays a map board to constrain
the legal locations of GamePieces
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Draw the gridgetLocation
(String location) default int
Return an estimation of the maximum number of pixels per range unit for the grid that applies at the specified point.boolean
boolean
Whether this grid should be drawn on the mapint
default Point
default Point
-
Method Details
-
snapTo
-
snapTo
-
snapTo
-
isLocationRestricted
- Returns:
- true if the given point may not be a local location. I.e., if this grid will attempt to snap it to the nearest grid location
-
locationName
-
localizedLocationName
-
getLocation
- Returns:
- A point p such that locationName(p).equals(location).
- Throws:
MapGrid.BadCoords
- if the location is not valid or formatted incorrectly.
-
range
-
getMaxPixelsPerRangeUnit
Return an estimation of the maximum number of pixels per range unit for the grid that applies at the specified point. Does not need to be exact, but must defer on the larger side to ensure fast range-checking by QTree lookup finds all target pieces.- Returns:
- maximum number of pixels per range unit.
-
isVisible
boolean isVisible()Whether this grid should be drawn on the map -
draw
-
getGridNumbering
GridNumbering getGridNumbering()
-