Package forgottentowns.mod.api
Record Class ColonyContext.Home
java.lang.Object
java.lang.Record
forgottentowns.mod.api.ColonyContext.Home
- Record Components:
id- stable zone identitykind- zone definition IDarea- usable room floor tiles, including tiles occupied by furnitureresidents- immutable living, non-deserting resident identitiesbeds- immutable complete beds assigned to this zonebedAssignments- exclusive bed identity per resident; absent when no individual bed is available
- Enclosing interface:
ColonyContext
public static record ColonyContext.Home(long id, String kind, int area, List<Integer> residents, List<ColonyContext.Bed> beds, Map<Integer,Long> bedAssignments)
extends Record
A residence, barracks, guard house or other supported home.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintarea()Returns the value of thearearecord component.Returns the value of thebedAssignmentsrecord component.beds()Returns the value of thebedsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.longid()Returns the value of theidrecord component.kind()Returns the value of thekindrecord component.Returns the value of theresidentsrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Home
public Home(long id, String kind, int area, List<Integer> residents, List<ColonyContext.Bed> beds, Map<Integer, Long> bedAssignments) Copies home metadata.- Parameters:
id- zone identitykind- definition IDarea- floor arearesidents- resident IDsbeds- bed snapshotsbedAssignments- exclusive resident bed assignments- Throws:
NullPointerException- if a list, map or element is null
-
-
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 '=='. -
id
public long id()Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
kind
Returns the value of thekindrecord component.- Returns:
- the value of the
kindrecord component
-
area
public int area()Returns the value of thearearecord component.- Returns:
- the value of the
arearecord component
-
residents
Returns the value of theresidentsrecord component.- Returns:
- the value of the
residentsrecord component
-
beds
Returns the value of thebedsrecord component.- Returns:
- the value of the
bedsrecord component
-
bedAssignments
Returns the value of thebedAssignmentsrecord component.- Returns:
- the value of the
bedAssignmentsrecord component
-