Record Class ResourceCrate
java.lang.Object
java.lang.Record
idlab.colonyops.model.entities.inventory.ResourceCrate
- Record Components:
maxCapacity- the total quantity of resources the crate can hold, across all typesstorage- the resources currently held, by type
A squad member's container for carrying extracted resources back to a collection point.
Resources still in a crate when a mission ends are lost.
-
Constructor Summary
ConstructorsConstructorDescriptionResourceCrate(int maxCapacity, Map<ResourceType, Integer> storage) Creates an instance of aResourceCraterecord 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.intReturns the value of themaxCapacityrecord component.storage()Returns the value of thestoragerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ResourceCrate
Creates an instance of aResourceCraterecord class.- Parameters:
maxCapacity- the value for themaxCapacityrecord componentstorage- the value for thestoragerecord 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. -
maxCapacity
public int maxCapacity()Returns the value of themaxCapacityrecord component.- Returns:
- the value of the
maxCapacityrecord component
-
storage
-