Record Class SimulationResult
java.lang.Object
java.lang.Record
dev.twilite.game.simulation.model.SimulationResult
- Record Components:
start- coordinate passed to the simulationdestination- selected final candidate nodefirstStep- first coordinate to move to on the selected pathpath- selected path from the first step through the destinationtimeline- 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 Summary
ConstructorsConstructorDescriptionSimulationResult(Coord start, SimulationNode destination, Coord firstStep, List<Coord> path, SimulationTimeline timeline) Creates an instance of aSimulationResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanaction(SimulationActionType type) Returns whether the selected destination has an action signal of the requested type.actions()Returns typed action signals attached to the selected destination.Returns the value of thedestinationrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of thefirstSteprecord component.final inthashCode()Returns a hash code value for this object.hits()Returns predicted hits attached to nodes on the selected path.booleanmoved()Returns whether the selected first step differs from the start coordinate.path()Returns the value of thepathrecord component.start()Returns the value of thestartrecord component.timeline()Returns predicted combat events attached to nodes on the selected path.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
SimulationResult
public SimulationResult(Coord start, SimulationNode destination, Coord firstStep, List<Coord> path, SimulationTimeline timeline) Creates an instance of aSimulationResultrecord class.- Parameters:
start- the value for thestartrecord componentdestination- the value for thedestinationrecord componentfirstStep- the value for thefirstSteprecord componentpath- the value for thepathrecord componenttimeline- the value for thetimelinerecord component
-
-
Method Details
-
moved
public boolean moved()Returns whether the selected first step differs from the start coordinate. -
actions
Returns typed action signals attached to the selected destination. -
timeline
Returns predicted combat events attached to nodes on the selected path. -
hits
Returns predicted hits attached to nodes on the selected path. -
action
Returns whether the selected destination has an action signal of the requested type.- Parameters:
type- action type to test
-
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. -
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. -
equals
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 withObjects::equals(Object,Object). -
start
Returns the value of thestartrecord component.- Returns:
- the value of the
startrecord component
-
destination
Returns the value of thedestinationrecord component.- Returns:
- the value of the
destinationrecord component
-
firstStep
Returns the value of thefirstSteprecord component.- Returns:
- the value of the
firstSteprecord component
-
path
Returns the value of thepathrecord component.- Returns:
- the value of the
pathrecord component
-