Record Class SimulationTimeline
java.lang.Object
java.lang.Record
dev.twilite.game.simulation.model.combat.SimulationTimeline
Timeline of predicted combat events for one simulated candidate path.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates an empty timeline.SimulationTimeline(List<SimulationHit> hits) Creates an instance of aSimulationTimelinerecord class. -
Method Summary
Modifier and TypeMethodDescriptionaddAll(SimulationTimeline timeline) Appends all events from another timeline.addHit(SimulationHit hit) Appends a predicted hit.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.hits()Returns the value of thehitsrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
SimulationTimeline
public SimulationTimeline()Creates an empty timeline. -
SimulationTimeline
Creates an instance of aSimulationTimelinerecord class.- Parameters:
hits- the value for thehitsrecord component
-
-
Method Details
-
addHit
Appends a predicted hit.- Parameters:
hit- predicted hit to append
-
addAll
Appends all events from another timeline.- Parameters:
timeline- timeline to append
-
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). -
hits
Returns the value of thehitsrecord component.- Returns:
- the value of the
hitsrecord component
-