Class SimulationGrid

java.lang.Object
dev.twilite.game.simulation.model.SimulationGrid

public class SimulationGrid extends Object
Per-run node state storage passed to simulation tasks.
  • Constructor Details

  • Method Details

    • options

      public SimulationOptions options()
      Returns the options used to create this grid.
    • start

      public Coord start()
      Returns the coordinate the current simulation run started from.
    • node

      public SimulationNode node(Coord position)
      Returns mutable state for a coordinate in the grid.
      Parameters:
      position - coordinate inside the simulation bounds
    • nodes

      public List<SimulationNode> nodes()
      Returns a snapshot list of all mutable node states in row-major order.
    • contains

      public boolean contains(Coord position)
      Returns whether a coordinate is inside the grid bounds.
      Parameters:
      position - coordinate to test
    • neighbours

      public List<Coord> neighbours(Coord position)
      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