Simulator::PlanetID struct

32 bits field that uniquely identifies a planet in the galaxy.

This ID is made up by the StarID of the star system where the planet is, combined with an index of the planet within that solar system (where 0 is the closest to the sun, 1 is the second closest, etc). The bits are organized as:

31       24 23       12 11      0
planetIndex sectorIndex starIndex
            (-------StarID------)

Constructors, destructors, conversion operators

PlanetID(StarID starID, unsigned int planetIndex)
Creates a planet ID combining the given star ID and index of the planet within that solar system (where 0 is the closest to the sun, 1 the second closest, etc).
PlanetID(uint32_t value)

Public functions

auto GetRecord() const -> cPlanetRecord*
auto GetStarID() const -> StarID
Returns the ID that uniquely identifies the star where this planet is.
auto GetPlanetIndex() const -> unsigned int
Returns the index of this planet within its star system.

Public variables

uint32_t internalValue

Function documentation

Simulator::PlanetID::PlanetID(StarID starID, unsigned int planetIndex)

Creates a planet ID combining the given star ID and index of the planet within that solar system (where 0 is the closest to the sun, 1 the second closest, etc).

Parameters
starID ID of the star system where this planet is.
planetIndex Index of planet within the star system, between 0 and 255.