Locatable
public interface Table extends Locatable
Locatable.getLocation()
,
and has a radius of RADIUS
(meaning a side length of 2 times
RADIUS
). Any player running into an edge of the table will move
forward until they are at a location where they are "touching" the table.
Food pieces are moved onto a table when their center (specified by
Locatable.getLocation()
is contained within the table.Modifier and Type | Field | Description |
---|---|---|
static double |
RADIUS |
The distance from the center of any table to any of its edges.
|
Modifier and Type | Method | Description |
---|---|---|
default double |
getEdge(Direction side) |
Returns the edge of the table on the given side of the table.
|
Set<Food.Type> |
getFood() |
Returns a set of all of the types of food on this table.
|
getLocation
static final double RADIUS
Set<Food.Type> getFood()
Field.MAX_FOOD
.default double getEdge(Direction side)
Direction.NORTH
, Direction.EAST
,
Direction.SOUTH
, or Direction.WEST
. This method will
return the y-value for the north or south edges, and the x-value for the
east or west edges.
For example, if a controller wanted to get the x-coordinate of the
eastern edge of the table, they could call
table.getEdge(Direction.EAST)
.
side
- the side of the table to get the value ofNullPointerException
- if side is nullIllegalArgumentException
- if side is not NORTH, EAST, SOUTH, OR WEST