struct
#include <Spore/Simulator/StarID.h>
StarID 32 bits field used to uniquely identify a star within the galaxy.
Contents
The galaxy is divided in sectors, the star ID keeps the index to the sector and the index of the star within the sector. Some bits are reserved to be able to form PlanetID. The bits are organized as:
31 24 23 12 11 0 00000000 sectorIndex starIndex
Constructors, destructors, conversion operators
Public functions
- auto GetRecord() const -> cStarRecord*
- auto GetSectorIndex() const -> unsigned int
- Returns the index of the sector where this star is stored.
- auto GetStarIndex() const -> unsigned int
- Returns the index of the star within its star sector.
Public variables
- uint32_t internalValue
Function documentation
Simulator:: StarID:: StarID(unsigned int sectorIndex,
unsigned int starIndex)
Creates a star ID using the given sector and index of star within that sector.
Parameters | |
---|---|
sectorIndex | Index of galaxy sector, between 0 and 4095. |
starIndex | Index of star within the sector, between 0 and 4095. |