Record Class LootAction
java.lang.Object
java.lang.Record
idlab.colonyops.model.actions.LootAction
- Record Components:
targetEntityId- the identifier of the defeated entity to lootlootWeapon- whether to pick up the target's weaponlootResources- the resources to take from the target's crate, by type
- All Implemented Interfaces:
Action
public record LootAction(String targetEntityId, boolean lootWeapon, Map<ResourceType, Integer> lootResources)
extends Record
implements Action
Loot a defeated (dead) entity at the squad member's current location, picking up its weapon
and/or the resources remaining in its crate. Corpses remain lootable for a limited number of
turns after death.
-
Constructor Summary
ConstructorsConstructorDescriptionLootAction(String targetEntityId, boolean lootWeapon, Map<ResourceType, Integer> lootResources) Creates an instance of aLootActionrecord 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 thelootResourcesrecord component.booleanReturns the value of thelootWeaponrecord component.Returns the value of thetargetEntityIdrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
LootAction
public LootAction(String targetEntityId, boolean lootWeapon, Map<ResourceType, Integer> lootResources) Creates an instance of aLootActionrecord class.- Parameters:
targetEntityId- the value for thetargetEntityIdrecord componentlootWeapon- the value for thelootWeaponrecord componentlootResources- the value for thelootResourcesrecord 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. -
targetEntityId
Returns the value of thetargetEntityIdrecord component.- Returns:
- the value of the
targetEntityIdrecord component
-
lootWeapon
public boolean lootWeapon()Returns the value of thelootWeaponrecord component.- Returns:
- the value of the
lootWeaponrecord component
-
lootResources
Returns the value of thelootResourcesrecord component.- Returns:
- the value of the
lootResourcesrecord component
-