Simulator::cStarManager class

Base classes

class cStrategy
class App::IMessageListener
An interface that can receive messages sent through the app.

Public static functions

static auto Get() -> cStarManager*
Returns the active Simulator star manager, used for most things in space stage.

Public functions

auto GetEmpire(uint32_t politicalID) -> cEmpire*
Returns the empire that has the given political ID, or nullptr if no empire uses it.
auto GetStarRecord(StarIndex recordIndex) -> cStarRecord*
Returns the star record assigned to the specified id.
auto GetPlanetRecord(PlanetIndex recordIndex) -> cPlanetRecord*
auto GetEmpires() -> EmpiresMap&
auto GetGrobEmpireID() -> uint32_t
auto NextPoliticalID(bool) -> uint32_t
Generates a new political ID.
auto GetEmpireForStar(cStarRecord* starRecord) -> cEmpire*
Returns the empire that controls this star record, creating it if necessary.
void RecordToPlanet(cPlanetRecord* record, intrusive_ptr<cPlanet>& dst)
auto GetSol() const -> cStarRecord*
auto GetScenarioStar() const -> cStarRecord*

Protected variables

map<int, int> field_20
vector<int> field_3C
vector<int> field_50
bool field_64
int field_68
string16 field_6C
char _padding_7C
vector<int> field_A0
int field_B4
int field_B8
int field_BC
int field_C0
int field_C4
vector<vector<intrusive_ptr<cStarRecord>>> mStarRecords
vector<intrusive_ptr<Object>> field_DC
vector<intrusive_ptr<Object>> field_F0
vector<intrusive_ptr<Object>> field_104
vector<intrusive_ptr<Object>> field_118
map<uint32_t, intrusive_ptr<Object>> field_12C
intrusive_ptr<cStarRecord> mpSol
intrusive_ptr<cStarRecord> field_14C
EmpiresMap mEmpiresMap
vector<int> field_16C
int field_180
map<int, int> field_184
intrusive_ptr<Object> field_1A0
intrusive_ptr<Object> field_1A4
int field_1A8
int field_1AC
int field_1B0
int field_1B4
int field_1B8
float field_1BC
float field_1C0
int field_1C4
int field_1C8
int field_1CC
int field_1D0
int field_1D4
uint32_t mGrobEmpireID
intrusive_ptr<cStarRecord> mpScenarioStar
cSpaceTradeRouteManager mTradeRouteMgr
intrusive_ptr<cRelationshipManager> mpRelationshipManager
vector<int> field_208
bool field_21C
intrusive_ptr<Object> field_220
intrusive_ptr<Object> field_224
intrusive_ptr<Object> field_228

Function documentation

cEmpire* Simulator::cStarManager::GetEmpire(uint32_t politicalID)

Returns the empire that has the given political ID, or nullptr if no empire uses it.

Parameters
politicalID

cStarRecord* Simulator::cStarManager::GetStarRecord(StarIndex recordIndex)

Returns the star record assigned to the specified id.

There are three possibilities:

  • If id == 0, the galaxy center is returned ?
  • If id == -1, nullptr is returned.
  • Otherwise, the id is divided in sector index (& 0xFFFFF000) and star index (& 0x00000FFF) and the star record is returned.

cEmpire* Simulator::cStarManager::GetEmpireForStar(cStarRecord* starRecord)

Returns the empire that controls this star record, creating it if necessary.

Parameters
starRecord

If no empire controls this star record or the one that controls it does not yet exist, it will be created and added to the empire map.