Class SimulationGrid
java.lang.Object
dev.twilite.game.simulation.model.SimulationGrid
Per-run node state storage passed to simulation tasks.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns whether a coordinate is inside the grid bounds.neighbours(Coord position) Returns adjacent coordinates for a position using this grid's diagonal movement setting.Returns mutable state for a coordinate in the grid.nodes()Returns a snapshot list of all mutable node states in row-major order.options()Returns the options used to create this grid.start()Returns the coordinate the current simulation run started from.
-
Constructor Details
-
SimulationGrid
-
-
Method Details
-
options
Returns the options used to create this grid. -
start
Returns the coordinate the current simulation run started from. -
node
Returns mutable state for a coordinate in the grid.- Parameters:
position- coordinate inside the simulation bounds
-
nodes
Returns a snapshot list of all mutable node states in row-major order. -
contains
Returns whether a coordinate is inside the grid bounds.- Parameters:
position- coordinate to test
-
neighbours
Returns adjacent coordinates for a position using this grid's diagonal movement setting.Points outside the bounds may be included; callers can filter them with
contains(Coord).- Parameters:
position- center coordinate
-