Record Class Planet

java.lang.Object
java.lang.Record
idlab.colonyops.model.Planet
Record Components:
name - the planet's name
biomeType - the planet's environmental flavour
mapWidth - the grid width, in tiles
mapHeight - the grid height, in tiles
chanceOfFindingLife - the per-tile probability of a hostile organism being generated
chanceOfFindingResource - the per-tile probability of a resource deposit being generated, per resource type
numberOfFindableLargeResourceDeposits - 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 Details

    • Planet

      public Planet(String name, BiomeType biomeType, int mapWidth, int mapHeight, double chanceOfFindingLife, Map<ResourceType, Double> chanceOfFindingResource, int numberOfFindableLargeResourceDeposits)
      Creates an instance of a Planet record class.
      Parameters:
      name - the value for the name record component
      biomeType - the value for the biomeType record component
      mapWidth - the value for the mapWidth record component
      mapHeight - the value for the mapHeight record component
      chanceOfFindingLife - the value for the chanceOfFindingLife record component
      chanceOfFindingResource - the value for the chanceOfFindingResource record component
      numberOfFindableLargeResourceDeposits - the value for the numberOfFindableLargeResourceDeposits record component
  • Method Details

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • biomeType

      public BiomeType biomeType()
      Returns the value of the biomeType record component.
      Returns:
      the value of the biomeType record component
    • mapWidth

      public int mapWidth()
      Returns the value of the mapWidth record component.
      Returns:
      the value of the mapWidth record component
    • mapHeight

      public int mapHeight()
      Returns the value of the mapHeight record component.
      Returns:
      the value of the mapHeight record component
    • chanceOfFindingLife

      public double chanceOfFindingLife()
      Returns the value of the chanceOfFindingLife record component.
      Returns:
      the value of the chanceOfFindingLife record component
    • chanceOfFindingResource

      public Map<ResourceType, Double> chanceOfFindingResource()
      Returns the value of the chanceOfFindingResource record component.
      Returns:
      the value of the chanceOfFindingResource record component
    • numberOfFindableLargeResourceDeposits

      public int numberOfFindableLargeResourceDeposits()
      Returns the value of the numberOfFindableLargeResourceDeposits record component.
      Returns:
      the value of the numberOfFindableLargeResourceDeposits record component