Record Class SimulationResult

java.lang.Object
java.lang.Record
dev.twilite.game.simulation.model.SimulationResult
Record Components:
start - coordinate passed to the simulation
destination - selected final candidate node
firstStep - first coordinate to move to on the selected path
path - selected path from the first step through the destination
timeline - predicted combat events attached to the selected path

public record SimulationResult(Coord start, SimulationNode destination, Coord firstStep, List<Coord> path, SimulationTimeline timeline) extends Record
Best movement candidate produced by a simulation run.
  • Constructor Details

    • SimulationResult

      public SimulationResult(Coord start, SimulationNode destination, Coord firstStep, List<Coord> path, SimulationTimeline timeline)
      Creates an instance of a SimulationResult record class.
      Parameters:
      start - the value for the start record component
      destination - the value for the destination record component
      firstStep - the value for the firstStep record component
      path - the value for the path record component
      timeline - the value for the timeline record component
  • Method Details

    • moved

      public boolean moved()
      Returns whether the selected first step differs from the start coordinate.
    • actions

      public List<SimulationAction> actions()
      Returns typed action signals attached to the selected destination.
    • timeline

      public SimulationTimeline timeline()
      Returns predicted combat events attached to nodes on the selected path.
    • hits

      public List<SimulationHit> hits()
      Returns predicted hits attached to nodes on the selected path.
    • action

      public boolean action(SimulationActionType type)
      Returns whether the selected destination has an action signal of the requested type.
      Parameters:
      type - action type to test
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • start

      public Coord start()
      Returns the value of the start record component.
      Returns:
      the value of the start record component
    • destination

      public SimulationNode destination()
      Returns the value of the destination record component.
      Returns:
      the value of the destination record component
    • firstStep

      public Coord firstStep()
      Returns the value of the firstStep record component.
      Returns:
      the value of the firstStep record component
    • path

      public List<Coord> path()
      Returns the value of the path record component.
      Returns:
      the value of the path record component