Package org.rspeer.game.position.area
Interface Area
-
- All Known Implementing Classes:
DiscreetRectangularArea
,PolygonalArea
,RectangularArea
,SingularArea
public interface Area
Represents a gameArea
ofpositions
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default Area
adjust(int x, int y)
boolean
contains(SceneNode entity)
static Area
discreet(int x1, int y1, int x2, int y2, int floorLevel)
static Area
discreet(Position a, Position b)
Factory method to create a discreet rectangular Areadefault Collection<Position>
getBoundaryPositions(boolean outer)
default Collection<Position>
getBoundaryVertices()
default Position
getCenter()
int
getFloorLevel()
default Position
getRandomTile()
Collection<Position>
getTiles()
Area
ignoreFloorLevel()
default boolean
isInFieldOfViewOf(Area o)
default boolean
isInFieldOfViewOf(Area o, CollisionFlagOverride override)
static Area
polygonal(Position... edges)
Factory method to create a polygonal areastatic Area
rectangular(int x1, int y1, int x2, int y2, int floorLevel)
static Area
rectangular(Position a, Position b)
Factory method to create a rectangular Areastatic Area
singular(Position p)
Factory method to create a singular Areastatic Area
surrounding(Position origin, int distance)
default Area
translate(int x, int y)
default Area
translate(Direction direction)
-
-
-
Method Detail
-
rectangular
static Area rectangular(Position a, Position b)
Factory method to create a rectangular Area- Parameters:
a
- A corner of the areab
- Opposite corner of the area- Returns:
- A rectangular area
-
rectangular
static Area rectangular(int x1, int y1, int x2, int y2, int floorLevel)
-
discreet
static Area discreet(Position a, Position b)
Factory method to create a discreet rectangular Area- Parameters:
a
- A corner of the areab
- Opposite corner of the area- Returns:
- A rectangular area
-
discreet
static Area discreet(int x1, int y1, int x2, int y2, int floorLevel)
-
singular
static Area singular(Position p)
Factory method to create a singular Area- Parameters:
p
- The only position in the area- Returns:
- A area with a singular position
-
polygonal
static Area polygonal(Position... edges)
Factory method to create a polygonal area- Parameters:
edges
- The edges of the area polygon- Returns:
- A polygonal area
-
getRandomTile
default Position getRandomTile()
-
getFloorLevel
int getFloorLevel()
-
getTiles
Collection<Position> getTiles()
-
ignoreFloorLevel
Area ignoreFloorLevel()
-
contains
boolean contains(SceneNode entity)
-
translate
default Area translate(int x, int y)
-
getBoundaryPositions
default Collection<Position> getBoundaryPositions(boolean outer)
-
getBoundaryVertices
default Collection<Position> getBoundaryVertices()
-
adjust
default Area adjust(int x, int y)
-
isInFieldOfViewOf
default boolean isInFieldOfViewOf(Area o)
-
isInFieldOfViewOf
default boolean isInFieldOfViewOf(Area o, CollisionFlagOverride override)
-
getCenter
default Position getCenter()
-
-