Simulator namespace

Namespaces

namespace Cell
namespace ScenarioInputStrategy
namespace SerializationTypes
namespace SpaceInputStrategy
namespace SubSystem
namespace WASDInputStrategy

Classes

struct Attribute
class cAbductToolStrategy
class cAbilityState
class cArtilleryWeaponStrategy
class cBehaviorAgent
class cBehaviorBase
class cBehaviorEntry
class cBehaviorList
class cBuilding
class cBuildingScenario
class cCelestialBody
class cCity
class cCityTerritory
class cCityWalls
class cCivilization
class cCombatant
Any object that has hit points and can combat other units.
class cCommEvent
class cCommManager
class cCommodityNode
class cCommunity
The following attributes are saved:
class cConversation
class cCreatureAbility
class cCreatureAnimal
class cCreatureBase
class cCreatureItem
class cCropCirclesToolStrategy
class cCultureSet
class cDeepSpaceProjectileToolStrategy
class cDefaultAoEArea
class cDefaultAoETool
class cDefaultBeamProjectile
class cDefaultBeamTool
class cDefaultProjectileWeapon
class cDragInputProjectileToolStrategy
class cDropCargoToolStrategy
class cEllipticalOrbit
class cEmpire
struct cEmptyBubble
class cEnergyRepairToolStrategy
class cFeedbackEvent
class cGameBehaviorManager
class cGameBundleContainer
class cGameData
class cGameDataUFO
class cGameInputManager
class cGameModeManager
class cGameNounManager
class cGameplayMarker
class cGameTerrainCursor
class cGameViewManager
class cGenesisDeviceToolStrategy
class cGetOutOfUFOToolStrategy
class cGlobalMindEraseToolStrategy
class cGonzagoSimulator
class cGonzagoTimer
A class for measuring time inside Simulator modes. This is the equivalent to the Clock class.
class cIdentityColorable
A Simulator class inherited by all those classes that can have an identity color, such as empires, tribes, etc.
class cInteractableObject
class cInteractiveOrnament
struct cLaneInfo
struct ClassSerializer
struct cLocomotionRequest
class cLocomotiveObject
class cLocomotiveObject_superclass
class cMindEraseToolStrategy
struct CnvAction
struct CnvAnimation
struct CnvAnimationVariation
struct CnvDialog
struct CnvDialogResponse
struct CnvEventLog
struct CnvText
struct CnvUnknown
class ConversationResource
class cOrnament
class cOrnamentBase
class cPlaceableStructure
A structure that can be placed into a community slot, like buildings, turrets, ornaments and tribe tools.
class cPlaceColonyToolStrategy
class cPlaceObjectToolStrategy
class cPlanet
class cPlanetModel
class cPlanetRecord
class cPlayerInventory
class cProjectile
class cRallyCallToolStrategy
class cRelationshipData
class cRelationshipManager
class cRepairAOEToolStrategy
class cRepairToolStrategy
class cSavedGameHeader
class cScanToolStrategy
class cScenarioAct
class cScenarioAsset
class cScenarioClass
class cScenarioClassAct
class cScenarioDialog
class cScenarioGoal
class cScenarioMarker
class cScenarioMarkerAct
class cScenarioPosseMember
class cScenarioResource
class cScenarioString
class cSimPlanetLowLOD
class cSimTicker
class cSimulatorPlayerUFO
class cSimulatorSpaceGame
class cSimulatorSystem
class cSolarSystem
class cSpaceInventory
class cSpaceInventoryItem
class cSpaceToolData
class cSpaceTradeRouteManager
class cSpatialObject
class cSpeciesManager
class cSpeciesProfile
class cStar
class cStarManager
class cStarRecord
class cStrategy
class cTerraformingManager
class cToggleToolStrategy
class cToolManager
class cToolStrategy
class cTradeRouteData
class cTurretDefenseMissileWeapon
class cTurretFlakWeapon
class cUIEventLog
This class manages event logs in Simulator game modes.
class cVehicle
class cVisiblePlanet
class EnterEditorMessage
class EnterModeMessage
class GoalCard
class ICityMusic
class IMessageParameters
class ISerializerStream
class ISimulatorSerializable
class ISimulatorSerializableRefCounted
class ISimulatorStrategy
class ISimulatorUIGraphic
class NounCreateMap
class ScheduledTaskListener
A message listener that, listening to Update messages, executes the given task after a certain time has passed and (optionally) repetaing it periodically.
class SpacePlayerData
class Sporepedia
struct StarRequestFilter
template<class T>
class tGameDataVectorT
class UnkCityClass
class UnknownCreatureClass
class UnknownCreatureClass2
class UnknownManagerSuperclass
struct UnkRefCounted
class XmlSerializer

Enums

enum class cCommEventType: int { None = -1, Space = 0, Civ = 1 }
enum Archetypes { kArchetypeWarrior = 0, kArchetypeTrader = 1, kArchetypeScientist = 2, kArchetypeShaman = 3, kArchetypeBard = 4, kArchetypeZealot = 5, kArchetypeDiplomat = 6, kArchetypeEcologist = 7, kArchetypeGrob = 8, kArchetypePlayerWarrior = 9, kArchetypePlayerTrader = 10, kArchetypePlayerScientist = 11, kArchetypePlayerShaman = 12, kArchetypePlayerBard = 13, kArchetypePlayerZealot = 14, kArchetypePlayerDiplomat = 15, kArchetypePlayerEcologist = 16, kArchetypePlayerWanderer = 17, kArchetypePlayerKnight = 18 }
enum OrnamentType { kOrnamentFlower = 1, kOrnamentBone = 2, kOrnamentStick = 3 }
enum class TechLevel: int { None = 0, Creature = 1, Tribe = 2, City = 3, Civilization = 4, Empire = 5 }
enum class StarType: int { None = 0, GalacticCore = 1, BlackHole = 2, ProtoPlanetary = 3, StarG = 4, StarO = 5, StarM = 6, BinaryOO = 7, BinaryOM = 8, BinaryOG = 9, BinaryGG = 10, BinaryGM = 11, BinaryMM = 12 }
enum GameNounIDs { kGameData = 0x17F243B, kCheatObject = 0x2A37E35, kMissionFetch = 0x2AFD284, kMissionHappinessEvent = 0x4F3BDE9, kMissionMakeAlly = 0x4F77499, kRaidPlunderEvent = 0x397BFF3, kRaidEvent = 0x3960C0E, kMissionColonize = 0x2BA2A0E, kMissionEradicate = 0x2F99994, kMissionExplore = 0x32A12F1, kMissionWar = 0x330FC49, kMissionScan = 0x347092D, kMissionTerraform = 0x35988F4, kMissionTrade = 0x2ADEDFF, kMissionTradeRoute = 0x447092D, kMissionMultiDelivery = 0x35ED8F6, kMissionBiosphere = 0x437444B, kGenericPressureEvent = 0x317AFCC, kMissionMultiStep = 0x4222283, kMissionBalance = 0x347092E, kMissionFindAliens = 0x347092F, kMissionFlight101 = 0x4222284, kMissionUseTool = 0x2ADEDEE, kMissionStory201 = 0x4222285, kMissionChangeArchetype = 0x4622285, kMissionTrackBadge = 0x4633285, kMissionAdventure = 0x46332A5, kPlayer = 0x2C21781, kMilitaryAttackCityOrder = 0x2E9AE6C, kCulturalConvertCityOrder = 0x3DF2CC5, kGameTerrainCursor = 0x18C40BC, kBuildingCityHall = 0x18EA1EB, kBuildingIndustry = 0x18EA2CC, kBuildingHouse = 0x18EB106, kBuildingEntertainment = 0x1A56ABA, kBuildingScenario = 0x70703B3, kTurret = 0x436F342, kCelestialBody = 0x38CFB6B, kGameBundle = 0x18C431C, kCulturalTarget = 0x3D5C325, kCity = 0x18C43E8, kGameBundleGroundContainer = 0x1906183, kVehicle = 0x18C6DE8, kVehicleGroupOrder = 0x2E98AB7, kCityWalls = 0x18C7C97, kCityTerritory = 0x244FB08, kPlaceholderColonyEditorCursorAttachment = 0x2C5C93A, kPlanetaryArtifact = 0x2DD8C42, kToolObject = 0x4E3FAB5, kCivilization = 0x18C816A, kCreatureAnimal = 0x18EB45E, kCreatureCitizen = 0x18EB4B7, kObstacle = 0x3ED8573, kGamePlant = 0x18C84A9, kFruit = 0x2C9CC91, kFruitGroup = 0x2E96892, kNest = 0x52AA6122, kHerd = 0x1BE418E, kEgg = 0x2A034CD, kInteractiveOrnament = 0x3A2511E, kGameplayMarker = 0x36BE27E, kOrnament = 0x18C88E4, kAnimalTrap = 0x61494BE, kTotemPole = 0x55CF865, kTribeFoodMat = 0x629BAFE, kRock = 0x2A8FB3F, kCommodityNode = 0x403DF5C, kMovableDestructibleOrnament = 0x283DDB1, kSolarHitSphere = 0x32F9778, kHitSphere = 0x2E72CAE, kInterCityRoad = 0x2B8A4E7, kTribe = 0x18C6D19, kTribeTool = 0x18C8F0C, kSpear = 0x24270C9, kArtilleryProjectile = 0x18C9380, kFlakProjectile = 0x240E3BF, kDefaultToolProjectile = 0x24270C5, kDeepSpaceProjectile = 0x24270C7, kSpaceDefenseMissile = 0x244D3C8, kDefaultBeamProjectile = 0x24630D7, kDefaultAoEArea = 0x4167186, kCulturalProjectile = 0x4F76F0D, kResourceProjectile = 0x5776A2C, kICBM = 0x49CEC61, kSoundLoopObject = 0x18EB641, kRotationRing = 0x2EE8CE8, kRotationBall = 0x7292112, kMorphHandle = 0x7A30A12, kTargetMorphHandle = 0x76F6E64, kArrowMorphHandle = 0x771AD6F, kSimpleRotationRing = 0x7A81829, kSimpleRotationBall = 0x7ABDD91, kPlanet = 0x3275728, kVisiblePlanet = 0x44462A6, kStar = 0x355C93A, kSolarSystem = 0x38CF94C, kSimPlanetLowLOD = 0x3572E72, kEmpire = 0x18EB9D2, kSpaceInventory = 0x21FFA3F, kPlayerInventory = 0x2265FDC, kGameDataUFO = 0x18EBADC, kTribeHut = 0x1E4DAAE, kTribePlanner = 0x3098AF98, kCreatureSpeciesMission = 0x1406A572, kCreatureTutorialMission = 0x34066DBA, kTribeToTribeMission = 0x5436411A, kFindMission = 0x14D9597F, kNanoDrone = 0x6EF0F11, kPlaceableSound = 0x74E0069, kPlaceableEffect = 0x7B38BA7 }
enum SimulatorMessages { kMsgEnterEditor = 0x53850BAE, kMsgSwitchGameMode = 0x0212D3E7 }
enum RelationshipEvents { kRelationshipEventCompliment = 0x0526E4E5, kRelationshipEventTrade = 0x0526E4EE, kRelationshipEventGift = 0x0526E4F2, kRelationshipEventBuyCityOver = 0x0526E4F5, kRelationshipEventJoinedAlliance = 0x0526E4F8, kRelationshipEventBribeNode = 0x0526E4FB, kRelationshipEventInsult = 0x0526E4FE, kRelationshipEventHostility = 0x0526E501, kRelationshipEventReligion = 0x0526E504, kRelationshipEventBuyCityUnder = 0x0526E50A, kRelationshipEventDemandRejected = 0x0526E50E, kRelationshipEventDeclaredWar = 0x0526E512, kRelationshipEventSpaceMissionComplete = 0x0526E519, kRelationshipEventSpaceMissionFailed = 0x0526E51C, kRelationshipEventSpaceMissionRejected = 0x0526E51D, kRelationshipEventSpaceMissionAborted = 0x0526E51E, kRelationshipEventSpaceGiveGift = 0x0526E51F, kRelationshipEventSpaceBreakAlliance = 0x0526E521, kRelationshipEventSpaceCreateAlliance = 0x0526E524, kRelationshipEventSpaceTradeComplete = 0x0526E527, kRelationshipEventSpaceTradeDeclined = 0x0526E52A, kRelationshipEventSpaceCityPanicked = 0x0526E52D, kRelationshipEventSpaceTerraformWorsened = 0x0526E531, kRelationshipEventSpaceTerraformImproved = 0x0526E535, kRelationshipEventSpaceTerraformExtinction = 0x0526E537, kRelationshipEventSpaceDestroyBuilding = 0x0526E53C, kRelationshipEventSpaceDestroyAllyUFO = 0x0526E542, kRelationshipEventSpaceBadToolUse = 0x0526E545, kRelationshipEventSpaceGoodToolUse = 0x0526E56A, kRelationshipEventSpaceFloodCity = 0x0526E5CF, kRelationshipEventSpaceAbductCitizen = 0x0526E5D4, kRelationshipEventSpaceStealCommodity = 0x0526E5D8, kRelationshipEventSpaceCheatGood = 0x0526E5DC, kRelationshipEventSpaceCheatBad = 0x0526E5F3, kRelationshipEventSpaceNewEmpireAndCTMGOwner = 0x0526E5F4 }
enum SpaceContext { kSpaceContextNone = -1, kSpaceContextPlanet = 0, kSpaceContextSolarSystem = 1, kSpaceContextGalaxy = 2 }

Typedefs

using TimeStamp = int[9]
using NounCreateFunction = cGameData*(*)()
using ReadFunction_t = bool(*)(ISerializerStream*, void*)
The type of function used to read binary attribute data.
using WriteFunction_t = bool(*)(ISerializerStream*, void*)
The type of function used to write binary attribute data.
using ReadTextFunction_t = void(*)(const string&, void*)
The type of function used to read attribute data, which is expressed in text.
using WriteTextFunction_t = void(*)(char*, void*)
The type of function used to write attribute data, which is expressed in text.
using UnknownFunction_t = bool(*)()
using UnknownFunction2_t = bool(*)(void*, const char*, int)
using OffsetFunction_t = void*(*)(Attribute*)
using StarID = uint32_t
using PlanetID = uint32_t
template<class T>
using ContainerCreateCallback_t = tGameDataVectorT<T>*(*)()
Creates the vector game data container.
template<class T>
using ContainerClearCallback_t = void(*)(tGameDataVectorT<T>*pVector)
Clears the content of the vector.
template<class T>
using ContainerAddCallback_t = void(*)(tGameDataVectorT<T>*pVector, cGameData*pObject)
This method must add the game data object into the vector.
using ContainerFilterCallback_t = bool(*)(cGameData*pObject, uint32_t gameNounID)
Used to decide which game objects go to the vector and which do not.
using EmpiresMap = map<uint32_t, intrusive_ptr<cEmpire>>

Functions

auto ScheduleTask(const App::VoidFunction_T& function, float scheduleTime) -> intrusive_ptr<ScheduledTaskListener>
Executes a function after a certain time (measured in seconds) has passed from ths call.
template<class T>
auto ScheduleTask(T* object, App::VoidMethod_T<T> method, float scheduleTime) -> intrusive_ptr<ScheduledTaskListener>
Executes a class method after a certain time (measured in seconds) has passed from ths call.
auto ScheduleRepeatedTask(const App::VoidFunction_T& function, float scheduleTime, float repeatRate) -> intrusive_ptr<ScheduledTaskListener>
Executes a function after a certain time (measured in seconds) has passed from this call, and then keeps repeating it after a certain period (defined by the repeatRate parameter) parameter.
template<class T>
auto ScheduleRepeatedTask(T* object, App::VoidMethod_T<T> method, float scheduleTime, float repeatRate) -> intrusive_ptr<ScheduledTaskListener>
Executes a function after a certain time (measured in seconds) has passed from this call, and then keeps repeating it after a certain period (defined by the repeatRate parameter) parameter.
auto RemoveScheduledTask(intrusive_ptr<ScheduledTaskListener>& taskListener) -> bool
auto Addresses(cAbductToolStrategy) -> namespace
auto Addresses(cArtilleryWeaponStrategy) -> namespace
auto Addresses(cCity) -> namespace
ASSERT_SIZE(cCivilization, 0x4D8)
ASSERT_SIZE(cCommEvent, 0xA0)
ASSERT_SIZE(cCommodityNode, 0x290)
auto Addresses(cCreatureAbility) -> namespace
auto Addresses(cCreatureAnimal) -> namespace
auto Addresses(cCreatureBase) -> namespace
auto Addresses(cCropCirclesToolStrategy) -> namespace
auto Addresses(cDeepSpaceProjectileToolStrategy) -> namespace
auto Addresses(cDefaultAoETool) -> namespace
auto Addresses(cDefaultBeamTool) -> namespace
auto Addresses(cDefaultProjectileWeapon) -> namespace
auto Addresses(cDragInputProjectileToolStrategy) -> namespace
auto Addresses(cDropCargoToolStrategy) -> namespace
auto Addresses(Cell) -> namespace
auto GetArchetypeRelationshipsID(int archetype, int difficulty) -> uint32_t
Returns the instance ID of the property file that contains the relationship properties used by a certain archetype in a certain difficulty (such as "spg_bard_easy", "spg_warrior_medium", etc)
auto Addresses(cEmpire) -> namespace
auto Addresses(cEnergyRepairToolStrategy) -> namespace
auto Addresses(cGameData) -> namespace
auto Addresses(cGameDataUFO) -> namespace
ASSERT_SIZE(cGameplayMarker, 0x1C8)
auto Addresses(cGameTerrainCursor) -> namespace
auto Addresses(cGenesisDeviceToolStrategy) -> namespace
auto Addresses(cGetOutOfUFOToolStrategy) -> namespace
auto Addresses(cGlobalMindEraseToolStrategy) -> namespace
auto Addresses(cGonzagoTimer) -> namespace
auto Addresses(cMindEraseToolStrategy) -> namespace
ASSERT_SIZE(ConversationResource, 0x80)
auto Addresses(cPlaceColonyToolStrategy) -> namespace
auto Addresses(cPlaceObjectToolStrategy) -> namespace
auto Addresses(cPlanet) -> namespace
auto Addresses(cPlayerInventory) -> namespace
auto Addresses(cRallyCallToolStrategy) -> namespace
auto Addresses(cRepairAOEToolStrategy) -> namespace
auto Addresses(cRepairToolStrategy) -> namespace
auto Addresses(cScanToolStrategy) -> namespace
auto GetPlayerUFO() -> cGameDataUFO*
auto Addresses(cSimulatorPlayerUFO) -> namespace
auto Addresses(cSimulatorSpaceGame) -> namespace
auto Addresses(cSpaceToolData) -> namespace
auto Addresses(cStarRecord) -> namespace
auto Addresses(cToolStrategy) -> namespace
auto Addresses(cTurretDefenseMissileWeapon) -> namespace
auto Addresses(cTurretFlakWeapon) -> namespace
auto Addresses(cVehicle) -> namespace
void RegisterNounType(uint32_t nounID, uint32_t typeID, const char* name)
ASSERT_SIZE(Attribute, 0x3C)
ASSERT_SIZE(ClassSerializer, 0xA14)
auto Addresses(ClassSerializer) -> namespace
auto Addresses(XmlSerializer) -> namespace
auto GetSectorIndex(StarID star) -> size_t
Returns the index of the sector where this star is stored.
auto GetStarIndex(StarID star) -> size_t
Returns the index of the star within its star sector.
auto GetStarKey(PlanetID planet) -> StarID
Returns the key that uniquely identifies the star where the given planet is.
auto GetPlanetIndex(PlanetID planet) -> size_t
Returns the index of the planet within its star system.
auto Addresses(cCommManager) -> namespace
auto Addresses(cRelationshipManager) -> namespace
ASSERT_SIZE(cSavedGameHeader, 0x68)
ASSERT_SIZE(cGameBehaviorManager, 0xA4)
auto Addresses(cGameBehaviorManager) -> namespace
auto Addresses(cGameInputManager) -> namespace
auto GetGameModeID() -> uint32_t
Returns the ID of the current game mode. You can compare it to the values in the GameModeIDs enum.
auto IsCellGame() -> bool
Returns true if the game is currently in the cell stage.
auto IsCreatureGame() -> bool
Returns true if the game is currently in the creature stage.
auto IsTribeGame() -> bool
Returns true if the game is currently in the tribe stage.
auto IsCivGame() -> bool
Returns true if the game is currently in the civilization stage.
auto IsSpaceGame() -> bool
Returns true if the game is currently in the tribe stage.
auto IsGameEditMode() -> bool
Returns true if the game is currently in the "game edit" mode, which is the level editor.
auto IsScenarioMode() -> bool
Returns true if the game is currently in adventure mode.
auto IsLoadingGameMode() -> bool
Returns true if the game is currently loading a stage.
auto Addresses(cGameModeManager) -> namespace
auto Addresses(cGameNounManager) -> namespace
template<class T>
auto GetData(uint32_t nounID) -> tGameDataVectorT<T>&
Gets all the game data objects that use the given game noun ID.
template<class T>
auto GetData() -> tGameDataVectorT<T>&
Gets all the game data objects that are of the specified type.
template<class T>
auto GetDataByCast() -> tGameDataVectorT<T>&
Gets all the game data objects that can be casted to the specified type.
auto GetLightingWorld() -> Graphics::ILightingWorld*
auto Addresses(cGameViewManager) -> namespace
auto Addresses(cPlanetModel) -> namespace
ASSERT_SIZE(cSimTicker, 0x44)
void InitializeWithoutPlanet()
Initializes certain Simulator systems so that most things can be used without being in a star or planet.
auto Addresses(cSimulatorSystem) -> namespace
auto GetActiveStar() -> cStar*
auto GetActiveStarRecord() -> cStarRecord*
auto GetActivePlanet() -> cPlanet*
auto GetActivePlanetRecord() -> cPlanetRecord*
auto GetPlayerEmpire() -> cEmpire*
auto GetPlayerEmpireID() -> uint32_t
auto GetCurrentContext() -> SpaceContext
auto Addresses(SpacePlayerData) -> namespace
auto Addresses(cStarManager) -> namespace
auto Addresses(cSpaceTradeRouteManager) -> namespace
void SpaceTeleportTo(cStarRecord* star)
Teleports the player spaceship into the given star record.
auto GalaxyCoordinatesTo3D(float parsecDistance, float angle, Vector3& dst) -> Vector3&
Converts the parsec distance and angle into the 3D coordinates used in the galaxy map and in functions like cStarManager::FindClosestStar().
auto Addresses(cTerraformingManager) -> namespace
auto Addresses(cToolManager) -> namespace
ASSERT_SIZE(cFeedbackEvent, 0x94)
ASSERT_SIZE(cUIEventLog, 0x70)
auto Addresses(cUIEventLog) -> namespace

Enum documentation

enum class Simulator::cCommEventType: int

enum Simulator::Archetypes

enum class Simulator::TechLevel: int

enum class Simulator::StarType: int

Enumerators
None

GalacticCore

The galactic core.

BlackHole

Black holes.

ProtoPlanetary

Proto-planetary disks.

StarG

Yellow stars.

StarO

Blue stars.

StarM

Red stars.

BinaryOO

Binary O-O (blue-blue) star system.

BinaryOM

Binary O-M (blue-red) star system.

BinaryOG

Binary O-G (blue-yellow) star system.

BinaryGG

Binary G-G (yellow-yellow) star system.

BinaryGM

Binary G-M (yellow-red) star system.

BinaryMM

Binary M-M (red-red) star system.

enum Simulator::GameNounIDs

enum Simulator::SimulatorMessages

Enumerators
kMsgEnterEditor

Simulator::EnterEditorMessage; Enters the correct editor modifying the specified creation.

kMsgSwitchGameMode

Typedef documentation

typedef intSimulator::TimeStamp[9]

typedef bool(*Simulator::ReadFunction_t)(ISerializerStream*, void*)

The type of function used to read binary attribute data.

The parameters are the data serializer and the address of memory where the data must be read.

typedef bool(*Simulator::WriteFunction_t)(ISerializerStream*, void*)

The type of function used to write binary attribute data.

The parameters are the data serializer and the address of memory where the data is.

typedef void(*Simulator::ReadTextFunction_t)(const string&, void*)

The type of function used to read attribute data, which is expressed in text.

The parameters are the text string and the address of memory where the data must be read.

typedef void(*Simulator::WriteTextFunction_t)(char*, void*)

The type of function used to write attribute data, which is expressed in text.

The parameters are the destination text buffer and the address of memory where the data is.

typedef bool(*Simulator::UnknownFunction_t)()

typedef bool(*Simulator::UnknownFunction2_t)(void*, const char*, int)

typedef void*(*Simulator::OffsetFunction_t)(Attribute*)

typedef uint32_t Simulator::StarID

typedef uint32_t Simulator::PlanetID

template<class T>
using Simulator::ContainerCreateCallback_t = tGameDataVectorT<T>*(*)()

Creates the vector game data container.

template<class T>
using Simulator::ContainerClearCallback_t = void(*)(tGameDataVectorT<T>*pVector)

Clears the content of the vector.

template<class T>
using Simulator::ContainerAddCallback_t = void(*)(tGameDataVectorT<T>*pVector, cGameData*pObject)

This method must add the game data object into the vector.

Only the objects that have passed the filter function are used in this callback.

using Simulator::ContainerFilterCallback_t = bool(*)(cGameData*pObject, uint32_t gameNounID)

Used to decide which game objects go to the vector and which do not.

It receives the object to evaluate and the game noun ID passed to the GetData function.

typedef map<uint32_t, intrusive_ptr<cEmpire>> Simulator::EmpiresMap

Function documentation

intrusive_ptr<ScheduledTaskListener> Simulator::ScheduleTask(const App::VoidFunction_T& function, float scheduleTime)

Executes a function after a certain time (measured in seconds) has passed from ths call.

Parameters
function A void function with no parameters, that will be executed every frame.
scheduleTime The time that has to pass, in seconds, since the task is scheduled for it to be executed.

The function is executed only once, and the time starts counting since this ScheduleTask method has been called.

The method returns the object that holds the scheduled task. If you want to remove the task before it is called, you can do it by calling Simulator::RemoveScheduledTask(...) with the returned object as parameter.

Internally, this is implemented by adding a message listener that listens to the kMsgAppUpdate message. Every frame uses a cGonzagoTimer object to compare the elapsed time since this task as scheduled. The listener is removed once the task has finished executing.

template<class T>
intrusive_ptr<ScheduledTaskListener> Simulator::ScheduleTask(T* object, App::VoidMethod_T<T> method, float scheduleTime)

Executes a class method after a certain time (measured in seconds) has passed from ths call.

Parameters
object The object to which the method will be called.
method A void method with no parameters, that will be executed every frame.
scheduleTime The time that has to pass, in seconds, since the task is scheduled for it to be executed.

The method is executed only once, and the time starts counting since this ScheduleTask method has been called.

The method returns the object that holds the scheduled task. If you want to remove the task before it is called, you can do it by calling Simulator::RemoveScheduledTask(...) with the returned object as parameter.

Internally, this is implemented by adding a message listener that listens to the kMsgAppUpdate message. Every frame uses a cGonzagoTimer object to compare the elapsed time since this task as scheduled. The listener is removed once the task has finished executing.

intrusive_ptr<ScheduledTaskListener> Simulator::ScheduleRepeatedTask(const App::VoidFunction_T& function, float scheduleTime, float repeatRate)

Executes a function after a certain time (measured in seconds) has passed from this call, and then keeps repeating it after a certain period (defined by the repeatRate parameter) parameter.

Parameters
function A void function with no parameters, that will be executed every frame.
scheduleTime The time that has to pass, in seconds, since the task is scheduled for it to be executed.
repeatRate How many seconds have to pass between every execution of the task.

The function is executed only once, and the time starts counting since this ScheduleTask method has been called.

The method returns the object that holds the scheduled task. If you want to remove the task so it does not execute anymore, you can do it by calling Simulator::RemoveScheduledTask(...) with the returned object as parameter.

Internally, this is implemented by adding a message listener that listens to the kMsgAppUpdate message. Every frame uses a cGonzagoTimer object to compare the elapsed time since this task as scheduled. The listener is removed once the task has finished executing.

template<class T>
intrusive_ptr<ScheduledTaskListener> Simulator::ScheduleRepeatedTask(T* object, App::VoidMethod_T<T> method, float scheduleTime, float repeatRate)

Executes a function after a certain time (measured in seconds) has passed from this call, and then keeps repeating it after a certain period (defined by the repeatRate parameter) parameter.

Parameters
object The object to which the method will be called.
method A void method with no parameters, that will be executed every frame.
scheduleTime The time that has to pass, in seconds, since the task is scheduled for it to be executed.
repeatRate How many seconds have to pass between every execution of the task.

The function is executed only once, and the time starts counting since this ScheduleTask method has been called.

The method returns the object that holds the scheduled task. If you want to remove the task so it does not execute anymore, you can do it by calling Simulator::RemoveScheduledTask(...) with the returned object as parameter.

Internally, this is implemented by adding a message listener that listens to the kMsgAppUpdate message. Every frame uses a cGonzagoTimer object to compare the elapsed time since this task as scheduled. The listener is removed once the task has finished executing.

bool Simulator::RemoveScheduledTask(intrusive_ptr<ScheduledTaskListener>& taskListener)

namespace Simulator::Addresses(cCity)

namespace Simulator::Addresses(Cell)

uint32_t Simulator::GetArchetypeRelationshipsID(int archetype, int difficulty)

Returns the instance ID of the property file that contains the relationship properties used by a certain archetype in a certain difficulty (such as "spg_bard_easy", "spg_warrior_medium", etc)

Parameters
archetype The archetype, in the "kArchetype..." enum.
difficulty The current difficulty, in the "kDifficulty..." enum.

namespace Simulator::Addresses(cEmpire)

namespace Simulator::Addresses(cGameData)

namespace Simulator::Addresses(cPlanet)

namespace Simulator::Addresses(cStarRecord)

namespace Simulator::Addresses(cVehicle)

void Simulator::RegisterNounType(uint32_t nounID, uint32_t typeID, const char* name)

size_t Simulator::GetSectorIndex(StarID star)

Returns the index of the sector where this star is stored.

Parameters
star The key that uniquely identifies the star.

size_t Simulator::GetStarIndex(StarID star)

Returns the index of the star within its star sector.

Parameters
star The key that uniquely identifies the star.

StarID Simulator::GetStarKey(PlanetID planet)

Returns the key that uniquely identifies the star where the given planet is.

Parameters
planet The key that uniquely identifies the planet.

size_t Simulator::GetPlanetIndex(PlanetID planet)

Returns the index of the planet within its star system.

Parameters
planet The key that uniquely identifies the planet.

uint32_t Simulator::GetGameModeID()

Returns the ID of the current game mode. You can compare it to the values in the GameModeIDs enum.

bool Simulator::IsCellGame()

Returns true if the game is currently in the cell stage.

bool Simulator::IsCreatureGame()

Returns true if the game is currently in the creature stage.

bool Simulator::IsTribeGame()

Returns true if the game is currently in the tribe stage.

bool Simulator::IsCivGame()

Returns true if the game is currently in the civilization stage.

bool Simulator::IsSpaceGame()

Returns true if the game is currently in the tribe stage.

bool Simulator::IsGameEditMode()

Returns true if the game is currently in the "game edit" mode, which is the level editor.

bool Simulator::IsScenarioMode()

Returns true if the game is currently in adventure mode.

bool Simulator::IsLoadingGameMode()

Returns true if the game is currently loading a stage.

template<class T>
tGameDataVectorT<T>& Simulator::GetData(uint32_t nounID)

Gets all the game data objects that use the given game noun ID.

All the found objects will be casted to the specified type.

template<class T>
tGameDataVectorT<T>& Simulator::GetData()

Gets all the game data objects that are of the specified type.

Only classes that define a NOUN_ID can be used here. All the found objects will be casted to the specified type.

template<class T>
tGameDataVectorT<T>& Simulator::GetDataByCast()

Gets all the game data objects that can be casted to the specified type.

You can use this with base classes that aren't nouns to use all the objects of subclasses; for example you can use it with cCombatant or cCreatureBase. Only classes that define a TYPE can be used here. All the found objects will be casted to the specified type.

void Simulator::InitializeWithoutPlanet()

Initializes certain Simulator systems so that most things can be used without being in a star or planet.

This method does:

  • Uses the StarManager temporary star with a temporary planet on it, and sets those as the current star/planet in SpacePlayerData.
  • Calls the PrepareSimulator() method in GameViewManager so that the simulator objects are displayed on the screen.

void Simulator::SpaceTeleportTo(cStarRecord* star)

Teleports the player spaceship into the given star record.

Parameters
star The star record the player will be teleported to.

Only works if the player is in the galaxy view.

Vector3& Simulator::GalaxyCoordinatesTo3D(float parsecDistance, float angle, Vector3& dst)

Converts the parsec distance and angle into the 3D coordinates used in the galaxy map and in functions like cStarManager::FindClosestStar().

Parameters
parsecDistance The distance from the galaxy center, in parsecs.
angle The angle, in degrees.
dst A 3D vector where the coordinates will be written.

The Z coordinate will be 0.