Interface CoordShape

All Known Implementing Classes:
CoordArea, CoordPolygon

public interface CoordShape
  • Method Details

    • contains

      boolean contains(SceneNode node)
      Determines whether the given coordinate lies inside this shape.
      Parameters:
      node - the node to test
      Returns:
      true if 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 - if true, returns the ring of tiles immediately surrounding the shape;
      if false, returns only the tiles forming the perimeter on the shape itself.
      Returns:
      a set of coordinates representing the boundary
    • getCoords

      Set<Coord> getCoords()
      Returns all coordinates contained within this shape.

      For large shapes, this may be a large collection.

      Returns:
      a set of all coordinates inside the region
    • getFloorLevel

      int getFloorLevel()
    • getCenter

      default Coord getCenter()
    • getRandomCoord

      default Coord getRandomCoord()