Record Class LootOutcome
java.lang.Object
java.lang.Record
idlab.colonyops.model.events.LootOutcome
- Record Components:
lootedWeapon- copy of the weapon looted from the target;nullif no weapon was lootedlootedResources- resources actually transferred from the target's crate, keyed by typeremainingWeapon- weapon still remaining on the target after looting;nullif none remainsremainingResources- resources still remaining in the target's crate after looting
- All Implemented Interfaces:
ActionOutcome
public record LootOutcome(Weapon lootedWeapon, Map<ResourceType, Integer> lootedResources, Weapon remainingWeapon, Map<ResourceType, Integer> remainingResources)
extends Record
implements ActionOutcome
Outcome for a successfully applied
LootAction.-
Constructor Summary
ConstructorsConstructorDescriptionLootOutcome(Weapon lootedWeapon, Map<ResourceType, Integer> lootedResources, Weapon remainingWeapon, Map<ResourceType, Integer> remainingResources) Creates an instance of aLootOutcomerecord 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.Returns the value of thelootedResourcesrecord component.Returns the value of thelootedWeaponrecord component.Returns the value of theremainingResourcesrecord component.Returns the value of theremainingWeaponrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
LootOutcome
public LootOutcome(Weapon lootedWeapon, Map<ResourceType, Integer> lootedResources, Weapon remainingWeapon, Map<ResourceType, Integer> remainingResources) Creates an instance of aLootOutcomerecord class.- Parameters:
lootedWeapon- the value for thelootedWeaponrecord componentlootedResources- the value for thelootedResourcesrecord componentremainingWeapon- the value for theremainingWeaponrecord componentremainingResources- the value for theremainingResourcesrecord 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. All components in this record class are compared withObjects::equals(Object,Object). -
lootedWeapon
Returns the value of thelootedWeaponrecord component.- Returns:
- the value of the
lootedWeaponrecord component
-
lootedResources
Returns the value of thelootedResourcesrecord component.- Returns:
- the value of the
lootedResourcesrecord component
-
remainingWeapon
Returns the value of theremainingWeaponrecord component.- Returns:
- the value of the
remainingWeaponrecord component
-
remainingResources
Returns the value of theremainingResourcesrecord component.- Returns:
- the value of the
remainingResourcesrecord component
-