Simulator::cStarRecord class

Keeps all the information related to a star and all the elements in its solar system.

This does not represent the star visually (that is the Simulator::cPlanet class), this is just information about the planet that will be stored in the galaxy database in the saved games folder.

This class represents any element in the galaxy view, so it is also used by binary stars, black holes, proto-planteary disks and the galaxy center.

Star records are uniquely identified with a StarID, which can be retrieved using GetID(). You can get the record from an ID using StarID::GetRecord().

The vector mPlanets only gets loaded when it is needed, so sometimes it might be empty even if this star has planets. To force it to load, use cStarRecord::GetPlanetRecords() to access the vector instead.

You can create a star record using (cStarRecord*)ClassManager.Create(cStarRecord::CLASS_ID)

Base classes

class ISimulatorSerializable
class DefaultRefCounted
The default implementation of a reference counted class.

Public static variables

static const uint32_t TYPE
static const uint32_t CLASS_ID

Public functions

auto GetType() const -> StarType
auto GetTechLevel() const -> TechLevel
auto GetID() const -> StarID
auto GetPlanetRecord(size_t planetIndex) -> cPlanetRecord*
Returns the planet record information at the given orbit index (0 - planet closest to the sun, 1 - second planet, etc)
auto GetPlanetRecords() -> eastl::vector<cPlanetRecordPtr>&
Returns a reference to the planet records of this star, loading them if they are not loaded.
auto AddRef() -> int pure virtual
auto Release() -> int pure virtual
auto Cast() const -> void* pure virtual

Public variables

int mLastObservedTime
int mSavedGameVersionMajor
int mSavedGameVersionMinor
TimeStamp mSavedGameTimeStamp
Math::Vector3 mPosition
StarType mType
TechLevel mTechLevel
bool field_50
uint32_t mEmpireID
uint32_t mStarterWorldID
int mFlags
eastl::string16 mName
StarID mKey
ResourceKey mCitizenSpeciesKey
cSpeciesProfile* mpSpeciesProfile
eastl::vector<cPlanetRecordPtr> mPlanets
eastl::vector<cPlanetRecordPtr> field_98
Subset of mPlanets, only those with a specific flag set.
char mPlanetCount

Function documentation

eastl::vector<cPlanetRecordPtr>& Simulator::cStarRecord::GetPlanetRecords()

Returns a reference to the planet records of this star, loading them if they are not loaded.

Returns A read only vector of the planet records in this star.

It is preferrable to use this instead of mPlanets.