Record Class SimulationHit
java.lang.Object
java.lang.Record
dev.twilite.game.simulation.model.combat.SimulationHit
- Record Components:
tick- simulated tick when the hit is expectedtarget- simulated target areasources- entities expected to hit the target on this tickstates- entity states after advancing the combat simulation to this tick
public record SimulationHit(int tick, Rect target, List<SimulationEntity> sources, List<SimulationEntity> states)
extends Record
Predicted incoming hit for a simulated movement candidate.
-
Constructor Summary
ConstructorsConstructorDescriptionSimulationHit(int tick, Rect target, List<SimulationEntity> sources, List<SimulationEntity> states) Creates an instance of aSimulationHitrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.sources()Returns the value of thesourcesrecord component.states()Returns the value of thestatesrecord component.target()Returns the value of thetargetrecord component.inttick()Returns the value of thetickrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
SimulationHit
public SimulationHit(int tick, Rect target, List<SimulationEntity> sources, List<SimulationEntity> states) Creates an instance of aSimulationHitrecord class.
-
-
Method Details
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
tick
public int tick()Returns the value of thetickrecord component.- Returns:
- the value of the
tickrecord component
-
target
Returns the value of thetargetrecord component.- Returns:
- the value of the
targetrecord component
-
sources
Returns the value of thesourcesrecord component.- Returns:
- the value of the
sourcesrecord component
-
states
Returns the value of thestatesrecord component.- Returns:
- the value of the
statesrecord component
-