Record Class AttackOutcome
java.lang.Object
java.lang.Record
idlab.colonyops.model.events.AttackOutcome
- Record Components:
damageApplied- the damage actually dealt to the targettargetHpLeft- the target's remaining health pointstargetColonyId- colony id of the target if the target belongs to a colony,nullotherwise
- All Implemented Interfaces:
ActionOutcome
public record AttackOutcome(int damageApplied, int targetHpLeft, String targetColonyId)
extends Record
implements ActionOutcome
Outcome for a successfully applied
AttackAction.-
Constructor Summary
ConstructorsConstructorDescriptionAttackOutcome(int damageApplied, int targetHpLeft, String targetColonyId) Creates an instance of aAttackOutcomerecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of thedamageAppliedrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thetargetColonyIdrecord component.intReturns the value of thetargetHpLeftrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
AttackOutcome
Creates an instance of aAttackOutcomerecord class.- Parameters:
damageApplied- the value for thedamageAppliedrecord componenttargetHpLeft- the value for thetargetHpLeftrecord componenttargetColonyId- the value for thetargetColonyIdrecord component
-
-
Method Details
-
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
damageApplied
public int damageApplied()Returns the value of thedamageAppliedrecord component.- Returns:
- the value of the
damageAppliedrecord component
-
targetHpLeft
public int targetHpLeft()Returns the value of thetargetHpLeftrecord component.- Returns:
- the value of the
targetHpLeftrecord component
-
targetColonyId
Returns the value of thetargetColonyIdrecord component.- Returns:
- the value of the
targetColonyIdrecord component
-