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)
boolean
boolean
Whether this grid should be drawn on the maplocationName(Point p)
int
-
Method Details
-
snapTo
- Returns:
- the nearest grid location to the given point
-
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
- Returns:
- a string describing the location containing the given point
-
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
- Returns:
- the range between two points, in some unit appropriate to the grid (e.g. hexes or squares)
-
isVisible
boolean isVisible()Whether this grid should be drawn on the map -
draw
Draw the grid- Parameters:
bounds
- the boundaries of the grid (in magnified coordinates)scale
- the magnification factor
-
getGridNumbering
GridNumbering getGridNumbering()
-