Record Class Planet
java.lang.Object
java.lang.Record
idlab.colonyops.model.Planet
- Record Components:
name- the planet's namebiomeType- the planet's environmental flavourmapWidth- the grid width, in tilesmapHeight- the grid height, in tileschanceOfFindingLife- the per-tile probability of a hostile organism being generatedchanceOfFindingResource- the per-tile probability of a resource deposit being generated, per resource typenumberOfFindableLargeResourceDeposits- the total number of large deposits that can be discovered via orbital scans during the mission
public record Planet(String name, BiomeType biomeType, int mapWidth, int mapHeight, double chanceOfFindingLife, Map<ResourceType, Double> chanceOfFindingResource, int numberOfFindableLargeResourceDeposits)
extends Record
The planet a mission takes place on: a 2D raster grid on which squad members, resource
deposits and hostile organisms are placed.
The grid wraps around on both axes (toroidal topology) and uses Chebyshev distance for
movement and range calculations. See Location for details.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thebiomeTyperecord component.doubleReturns the value of thechanceOfFindingLiferecord component.Returns the value of thechanceOfFindingResourcerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intReturns the value of themapHeightrecord component.intmapWidth()Returns the value of themapWidthrecord component.name()Returns the value of thenamerecord component.intReturns the value of thenumberOfFindableLargeResourceDepositsrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Planet
public Planet(String name, BiomeType biomeType, int mapWidth, int mapHeight, double chanceOfFindingLife, Map<ResourceType, Double> chanceOfFindingResource, int numberOfFindableLargeResourceDeposits) Creates an instance of aPlanetrecord class.- Parameters:
name- the value for thenamerecord componentbiomeType- the value for thebiomeTyperecord componentmapWidth- the value for themapWidthrecord componentmapHeight- the value for themapHeightrecord componentchanceOfFindingLife- the value for thechanceOfFindingLiferecord componentchanceOfFindingResource- the value for thechanceOfFindingResourcerecord componentnumberOfFindableLargeResourceDeposits- the value for thenumberOfFindableLargeResourceDepositsrecord 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. -
name
-
biomeType
-
mapWidth
-
mapHeight
-
chanceOfFindingLife
public double chanceOfFindingLife()Returns the value of thechanceOfFindingLiferecord component.- Returns:
- the value of the
chanceOfFindingLiferecord component
-
chanceOfFindingResource
Returns the value of thechanceOfFindingResourcerecord component.- Returns:
- the value of the
chanceOfFindingResourcerecord component
-
numberOfFindableLargeResourceDeposits
public int numberOfFindableLargeResourceDeposits()Returns the value of thenumberOfFindableLargeResourceDepositsrecord component.- Returns:
- the value of the
numberOfFindableLargeResourceDepositsrecord component
-