Class Overview
Represents the simulation area.
Summary
Nested Classes |
class |
Area.Bind |
Provides various AbstractModules to bind different types of
Area . |
enum |
Area.Edge |
|
Public Constructors |
|
Area(int x, int y, int z)
|
Fields
Public Constructors
public
Area
(int x, int y, int z)
Public Methods
public
void
addEdgeHandlers
(Map<Area.Edge, EdgeHandler> edgeHandlers)
public
boolean
contains
(Location l)
Check if the given Location
falls inside of this area.
Returns
- True if
l
is within the area defined by this
Area
object, false otherwise.
If the Move
m
from Location
l
results in a Location outside of this area we create and return a
modified Move
based on the edge-case rules defined for this
Area
.
The edge rules are defined for all 6 possible edges of the area via
EdgeHandlers. We determine which edge has been crossed then
invoke the appropriate handler to give us the modified move. By default
all edges have an ExceptionEdgeHandler
.
Returns
- if
loc.add(m)
returns a Location
l
such that this.contains(l) == false
returns a m
modified according to the
EdgeHandler on the edge which has been crossed. otherwise
returns m