Package org.rspeer.game.coord.shape
Interface CoordShape
-
- All Known Implementing Classes:
CoordArea,CoordPolygon
public interface CoordShape
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancontains(SceneNode node)Determines whether the given coordinate lies inside this shape.Set<Coord>getBoundary(boolean outer)Returns all coordinates on the boundary (perimeter) of the shape.Set<Coord>getCoords()Returns all coordinates contained within this shape.Set<Coord>getVertices()Returns the set of vertices defining this shape.
-
-
-
Method Detail
-
contains
boolean contains(SceneNode node)
Determines whether the given coordinate lies inside this shape.- Parameters:
node- the node to test- Returns:
trueif the shape contains the coordinate
-
getVertices
Set<Coord> getVertices()
Returns the set of vertices defining this shape.For a rectangle, this is the 4 corner coordinates. For polygons, this would be all defining polygon points.
- Returns:
- an immutable set of shape-defining vertices
-
getBoundary
Set<Coord> getBoundary(boolean outer)
Returns all coordinates on the boundary (perimeter) of the shape.- Parameters:
outer- iftrue, returns the ring of tiles immediately surrounding the shape;
iffalse, returns only the tiles forming the perimeter on the shape itself.- Returns:
- a set of coordinates representing the boundary
-
-