Loading...
Searching...
No Matches
CRobotMain Class Reference

Main class managing the game world. More...

`#include <src/level/robotmain.h>`

Inheritance diagram for CRobotMain:
[legend]

## Public Member Functions

| CRobotMain ()
| Constructor of robot application.
virtual | ~CRobotMain ()
| Destructor of robot application.
Gfx::CCamera * | GetCamera ()
Gfx::CTerrain * | GetTerrain ()
Ui::CInterface * | GetInterface ()
Ui::CDisplayText * | GetDisplayText ()
CPauseManager * | GetPauseManager ()

## Code battle interface

CApplication * | m_app = nullptr
| Progress of loaded player.
CEventQueue * | m_eventQueue = nullptr
| Progress of loaded player.
Gfx::CEngine * | m_engine = nullptr
| Progress of loaded player.
Gfx::CParticle * | m_particle = nullptr
| Progress of loaded player.
Gfx::CWater * | m_water = nullptr
| Progress of loaded player.
Gfx::CCloud * | m_cloud = nullptr
| Progress of loaded player.
Gfx::CLightning * | m_lightning = nullptr
| Progress of loaded player.
Gfx::CPlanet * | m_planet = nullptr
| Progress of loaded player.
Gfx::COldModelManager * | m_oldModelManager = nullptr
| Progress of loaded player.
Gfx::CLightManager * | m_lightMan = nullptr
| Progress of loaded player.
CSoundInterface * | m_sound = nullptr
| Progress of loaded player.
CInput * | m_input = nullptr
| Progress of loaded player.
std::unique_ptr< CObjectManager > | m_objMan
| Progress of loaded player.
std::unique_ptr< CMainMovie > | m_movie
| Progress of loaded player.
std::unique_ptr< CPauseManager > | m_pause
| Progress of loaded player.
std::unique_ptr< Gfx::CModelManager > | m_modelManager
| Progress of loaded player.
std::unique_ptr< Gfx::CTerrain > | m_terrain
| Progress of loaded player.
std::unique_ptr< Gfx::CCamera > | m_camera
| Progress of loaded player.
std::unique_ptr< Ui::CMainUserInterface > | m_ui
| Progress of loaded player.
std::unique_ptr< Ui::CMainShort > | m_short
| Progress of loaded player.
std::unique_ptr< Ui::CMainMap > | m_map
| Progress of loaded player.
std::unique_ptr< Ui::CInterface > | m_interface
| Progress of loaded player.
std::unique_ptr< Ui::CDisplayInfo > | m_displayInfo
| Progress of loaded player.
std::unique_ptr< Ui::CDisplayText > | m_displayText
| Progress of loaded player.
std::unique_ptr< Ui::CDebugMenu > | m_debugMenu
| Progress of loaded player.
std::unique_ptr< CSettings > | m_settings
| Progress of loaded player.
std::unique_ptr< CPlayerProfile > | m_playerProfile
| Progress of loaded player.
float | m_time = 0.0f
| Time since level start, including pause and intro movie.
float | m_gameTime = 0.0f
| Playing time since level start.
float | m_gameTimeAbsolute = 0.0f
| Playing time since level start, not dependent on simulation speed.
LevelCategory | m_levelCategory
| Progress of loaded player.
int | m_levelChap = 0
| Progress of loaded player.
int | m_levelRank = 0
| Progress of loaded player.
std::string | m_levelFile = ""
| if set, loads this file instead of building from category/chap/rank
std::string | m_sceneReadPath
| Progress of loaded player.
float | m_winDelay = 0.0f
| Progress of loaded player.
float | m_lostDelay = 0.0f
| Progress of loaded player.
bool | m_fixScene = false
| Progress of loaded player.
CObject * | m_base = nullptr
| Progress of loaded player.
CObject * | m_selectObject = nullptr
| Progress of loaded player.
Phase | m_phase = PHASE_WELCOME1
| Progress of loaded player.
ActivePause * | m_userPause = nullptr
| Progress of loaded player.
ActivePause * | m_focusPause = nullptr
| Progress of loaded player.
ActivePause * | m_freePhotoPause = nullptr
| Progress of loaded player.
bool | m_cmdEdit = false
| Progress of loaded player.
ActivePause * | m_cmdEditPause = nullptr
| Progress of loaded player.
bool | m_cheatSelectInsect = false
| Progress of loaded player.
bool | m_cheatShowSoluce = false
| Progress of loaded player.
bool | m_cheatAllMission = false
| Progress of loaded player.
bool | m_cheatRadar = false
| Progress of loaded player.
bool | m_shortCut = false
| Progress of loaded player.
std::string | m_audioTrack
| Progress of loaded player.
bool | m_audioRepeat = false
| Progress of loaded player.
std::string | m_satcomTrack
| Progress of loaded player.
bool | m_satcomRepeat = false
| Progress of loaded player.
std::string | m_editorTrack
| Progress of loaded player.
bool | m_editorRepeat = false
| Progress of loaded player.
int | m_movieInfoIndex = 0
| Progress of loaded player.
CObject * | m_controller = nullptr
| Progress of loaded player.
MissionType | m_missionType = MISSION_NORMAL
| Progress of loaded player.
bool | m_immediatSatCom = false
| Progress of loaded player.
bool | m_beginSatCom = false
| Progress of loaded player.
bool | m_lockedSatCom = false
| Progress of loaded player.
bool | m_movieLock = false
| Progress of loaded player.
bool | m_satComLock = false
| Progress of loaded player.
bool | m_editLock = false
| Progress of loaded player.
bool | m_editFull = false
| Progress of loaded player.
bool | m_hilite = false
| Progress of loaded player.
bool | m_cheatTrainerPilot = false
| Progress of loaded player.
bool | m_friendAim = false
| Progress of loaded player.
bool | m_resetCreate = false
| Progress of loaded player.
bool | m_mapShow = false
| Progress of loaded player.
bool | m_mapImage = false
| Progress of loaded player.
char | m_mapFilename [100] = {}
| Progress of loaded player.
ActivePause * | m_suspend = nullptr
| Progress of loaded player.
Math::Point | m_tooltipPos
| Progress of loaded player.
std::string | m_tooltipName
| Progress of loaded player.
float | m_tooltipTime = 0.0f
| Progress of loaded player.
char | m_infoFilename [SATCOM_MAX][100] = {}
| Progress of loaded player.
CObject * | m_infoObject = nullptr
| Progress of loaded player.
int | m_infoUsed = 0
| Progress of loaded player.
ActivePause * | m_satcomMoviePause = nullptr
| Progress of loaded player.
std::string | m_scriptName = ""
| Progress of loaded player.
std::string | m_scriptFile = ""
| Progress of loaded player.
std::string | m_endingWin = ""
| Progress of loaded player.
std::string | m_endingLost = ""
| Progress of loaded player.
bool | m_winTerminate = false
| Progress of loaded player.
float | m_globalMagnifyDamage = 0.0f
| Progress of loaded player.
float | m_globalNuclearCapacity = 10.0f
| Progress of loaded player.
float | m_globalCellCapacity = 1.0f
| Progress of loaded player.
bool | m_exitAfterMission = false
| Progress of loaded player.
bool | m_codeBattleInit = false
| Progress of loaded player.
bool | m_codeBattleStarted = false
| Progress of loaded player.
bool | m_codeBattleSpectator = true
| Code battle spectator mode, hides object UI, changes camera to CAM_TYPE_PLANE and allows for switching to free camera by clicking outside of any object.
std::map< int, std::string > | m_teamNames
| Progress of loaded player.
std::vector< NewScriptName > | m_newScriptName
| Progress of loaded player.
EventType | m_visitLast = EVENT_NULL
| Progress of loaded player.
CObject * | m_visitObject = nullptr
| Progress of loaded player.
CObject * | m_visitArrow = nullptr
| Progress of loaded player.
float | m_visitTime = 0.0f
| Progress of loaded player.
float | m_visitParticle = 0.0f
| Progress of loaded player.
Math::Vector | m_visitPos
| Progress of loaded player.
Math::Vector | m_visitPosArrow
| Progress of loaded player.
ActivePause * | m_visitPause = nullptr
| Progress of loaded player.
std::vector< std::unique_ptr< CSceneEndCondition > > | m_endTake
| Progress of loaded player.
bool | m_endTakeImmediat = false
| If true, the mission ends immediately after completing the requirements without requiring SpaceShip takeoff.
long | m_endTakeResearch = 0
| Progress of loaded player.
float | m_endTakeTimeout = -1.0f
| Progress of loaded player.
bool | m_endTakeTeamImmediateWin = false
| Progress of loaded player.
float | m_endTakeWinDelay = 0.0f
| Progress of loaded player.
float | m_endTakeLostDelay = 0.0f
| Progress of loaded player.
std::map< int, bool > | m_teamFinished
| Set to true for teams that have already finished.
std::vector< std::unique_ptr< CAudioChangeCondition > > | m_audioChange
| Progress of loaded player.
std::unique_ptr< CScoreboard > | m_scoreboard
std::map< std::string, MinMax > | m_obligatoryTokens
| Progress of loaded player.
int | m_build = 0
| Enabled buildings.
long | m_researchEnable = 0
| Available researches.
std::map< int, int > | m_researchDone
| Done researches for each team.
Error | m_missionResult = ERR_OK
| Progress of loaded player.
bool | m_missionResultFromScript = false
| true if m_missionResult has been set by LevelController script, this disables normal EndMissionTake processing
ShowLimit | m_showLimit [MAXSHOWLIMIT]
| Progress of loaded player.
std::map< int, Gfx::Color > | m_colorNewBot
| Progress of loaded player.
Gfx::Color | m_colorNewAlien
| Progress of loaded player.
Gfx::Color | m_colorNewGreen
| Progress of loaded player.
Gfx::Color | m_colorNewWater
| Progress of loaded player.
float | m_colorShiftWater = 0.0f
| Progress of loaded player.
bool | m_missionTimerEnabled = false
| Progress of loaded player.
bool | m_missionTimerStarted = false
| Progress of loaded player.
float | m_missionTimer = 0.0f
| Progress of loaded player.
bool | m_autosave = false
| Progress of loaded player.
int | m_autosaveInterval = 0
| Progress of loaded player.
int | m_autosaveSlots = 0
| Progress of loaded player.
float | m_autosaveLast = 0.0f
| Progress of loaded player.
int | m_shotSaving = 0
| Progress of loaded player.
std::deque< CObject * > | m_selectionHistory
| Progress of loaded player.
bool | m_debugCrashSpheres
| Progress of loaded player.
std::deque< std::string > | m_commandHistory
| Cheat console command history.
int | m_commandHistoryIndex
| Index of currently selected element in command history.
std::vector< Viewpoint > | m_viewpoints
| Vector of available viewpoints.
void | CreateCodeBattleInterface ()
| Progress of loaded player.
void | UpdateCodeBattleInterface ()
| Progress of loaded player.
void | ApplyCodeBattleInterface ()
| Progress of loaded player.
void | DestroyCodeBattleInterface ()
| Progress of loaded player.
void | SetCodeBattleSpectatorMode (bool mode)
| Progress of loaded player.
void | UpdateDebugCrashSpheres ()
| Progress of loaded player.
void | PushToCommandHistory (std::string cmd)
| Adds element to the beginning of command history.
std::string | GetNextFromCommandHistory ()
| Returns next/previous element from command history and updates index.
std::string | GetPreviousFromCommandHistory ()
| Progress of loaded player.

## Phase management

void | ChangePhase (Phase phase)
| Changes phase.
bool | ProcessEvent (Event &event)
| Processes an event.
Phase | GetPhase ()
| Changes phase.
void | ScenePerso ()
| Load the scene for appearance customization.
void | SetMovieLock (bool lock)
| Management of the lock mode for movies.
bool | GetMovieLock ()
| Changes phase.
bool | GetInfoLock ()
| Changes phase.
void | SetSatComLock (bool lock)
| Management of the blocking of the call of SatCom.
bool | GetSatComLock ()
| Changes phase.
void | SetEditLock (bool lock, bool edit)
| Management of the lock mode for the edition.
bool | GetEditLock ()
| Changes phase.
void | SetEditFull (bool full)
| Management of the fullscreen mode during editing.
bool | GetEditFull ()
| Changes phase.
void | SetFriendAim (bool friendAim)
| Indicates whether mouse is on an friend object, on which we should not shoot.
bool | GetFriendAim ()
| Changes phase.

## Simulation speed management

void | SetSpeed (float speed)
| Changes game speed.
float | GetSpeed ()
| Changes game speed.
bool | CreateShortcuts ()
| Create the shortcuts at the top of the screen, if they should be visible.
void | UpdateShortcuts ()
| Update the shortcuts at the top of the screen.
CObject * | SearchHuman ()
| Find the astronaut (OBJECT_HUMAN) object.
bool | SelectObject (CObject *obj, bool displayError=true)
| Select an object.
CObject * | GetSelectObject ()
| Return the object that was selected at the start of the scene.
CObject * | DeselectAll ()
void | ResetObject ()
| Resets all objects to their original position.
void | UpdateAudio (bool frame)
| Updates the audiotracks.
void | SetMissionResultFromScript (Error result, float delay)
| Set mission result from LevelController script.
Error | CheckEndMission (bool frame)
| Checks if the mission is over.
Error | ProcessEndMissionTake ()
Error | ProcessEndMissionTakeForGroup (std::vector< CSceneEndCondition * > &endTakes)
| Changes game speed.
const std::map< std::string, MinMax > & | GetObligatoryTokenList ()
| Returns the list instructions required in CBot program in level.
void | UpdateMap ()
| Updates the map.
bool | GetShowMap ()
| Indicates whether the mini-map is visible.
MainMovieType | GetMainMovie ()
| Returns the type of current movie.
void | FlushDisplayInfo ()
| Clears the display of instructions.
void | StartDisplayInfo (int index, bool movie)
void | StartDisplayInfo (const std::string &filename, int index)
| Beginning of the displaying of instructions.
void | StopDisplayInfo ()
| End of displaying of instructions.
char * | GetDisplayInfoName (int index)
| Returns the name of the text display.
void | StartSuspend ()
| Beginning of a dialogue during the game.
void | StopSuspend ()
| End of dialogue during the game.
float | GetGameTime ()
| Returns the absolute time of the game.
const std::string & | GetScriptName ()
| Changes game speed.
const std::string & | GetScriptFile ()
| Changes game speed.
bool | GetTrainerPilot ()
| Indicates whether it is possible to control a driving robot.
bool | GetPlusTrainer ()
| Changes game speed.
bool | GetPlusExplorer ()
| Changes game speed.
bool | GetFixScene ()
| Indicates whether the scene is fixed, without interaction.
bool | GetShowSoluce ()
| Changes game speed.
bool | GetSceneSoluce ()
| Changes game speed.
bool | GetShowAll ()
| Changes game speed.
bool | GetRadar ()
| Changes game speed.
MissionType | GetMissionType ()
| Changes game speed.
int | GetGamerFace ()
| Returns the representation to use for the player.
int | GetGamerGlasses ()
| Returns the representation to use for the player.
bool | GetGamerOnlyHead ()
| Returns the mode with just the head.
float | GetPersoAngle ()
| Returns the angle of presentation.
void | SetLevel (LevelCategory cat, int chap, int rank)
| Changes game speed.
LevelCategory | GetLevelCategory ()
| Changes game speed.
int | GetLevelChap ()
| Changes game speed.
int | GetLevelRank ()
| Changes game speed.
std::string | GetCustomLevelDir ()
| Returns folder name of the scene that user selected to play.
void | SetReadScene (std::string path)
| Changes game speed.
void | UpdateChapterPassed ()
| Changes game speed.
void | StartMusic ()
| Starts music with a mission.
void | UpdatePause (PauseType pause)
| Changes game speed.
void | UpdatePauseMusic (PauseMusic music)
| Changes game speed.
void | ClearInterface ()
| Removes hilite and tooltip.
void | ChangeColor ()
| Change the colors and textures.
bool | FreeSpace (Math::Vector &center, float minRadius, float maxRadius, float space, CObject *exclu)
| Calculates a free space.
bool | FlatFreeSpace (Math::Vector &center, float minFlat, float minRadius, float maxRadius, float space, CObject *exclu)
| Calculates a flat free space.

## In-world indicators

float | GetFlatZoneRadius (Math::Vector center, float maxRadius, CObject *exclu)
| Calculates the maximum radius of a free space.
void | HideDropZone (CObject *metal)
| Hides buildable area when a cube of metal is taken up.
void | ShowDropZone (CObject *metal, CObject *transporter)
| Shows the buildable area when a cube of metal is deposited.
void | FlushShowLimit (int i)
| Erases the boundaries shown.
void | SetShowLimit (int i, Gfx::ParticleType parti, CObject *obj, Math::Vector pos, float radius, float duration=SHOWLIMITTIME)
| Specifies the boundaries to show.
void | StartShowLimit ()
| Mount the boundaries of the selected object.
void | FrameShowLimit (float rTime)
| Advances the boundaries shown.
void | SaveAllScript ()
| Saves all programs of all the robots.
void | SaveOneScript (CObject *obj)
| Saves all programs of the robot.
bool | SaveFileStack (CObject *obj, std::ostream &ostr)
| Saves the stack of the program in execution of a robot.
bool | ReadFileStack (CObject *obj, std::istream &istr)
| Resumes the execution stack of the program in a robot.
std::vector< std::string > | GetNewScriptNames (ObjectType type)
| Return list of scripts to load to robot created in BotFactory.
CScoreboard * | GetScoreboard ()
void | SelectPlayer (std::string playerName)
| Changes current player.
CPlayerProfile * | GetPlayerProfile ()
| Calculates the maximum radius of a free space.

## Saved game read/write

bool | IOIsBusy ()
| Seeks if an object occupies in a spot, to prevent a backup of the game.
bool | IOWriteScene (std::string filename, std::string filecbot, std::string filescreenshot, const std::string &info, bool emergencySave=false)
| Saves the current game.
void | IOWriteSceneFinished ()
| Notifies the user that scene write is finished.
CObject * | IOReadScene (std::string filename, std::string filecbot)
| Resumes some part of the game.
void | IOWriteObject (CLevelParserLine *line, CObject *obj, const std::string &programDir, int objRank)
| Writes an object into the backup file.
CObject * | IOReadObject (CLevelParserLine *line, const std::string &programDir, const std::string &objCounterText, float objectProgress, int objRank=-1)
| Resumes the game.
int | CreateSpot (Math::Vector pos, Gfx::Color color)
| Creates a light spot.
CObject * | GetSelect ()
| Find the currently selected object.
void | DisplayError (Error err, CObject *pObj, float time=10.0f)
| Seeks if an object occupies in a spot, to prevent a backup of the game.
void | DisplayError (Error err, Math::Vector goal, float height=15.0f, float dist=60.0f, float time=10.0f)
| Seeks if an object occupies in a spot, to prevent a backup of the game.
void | UpdateCustomLevelList ()
| Seeks if an object occupies in a spot, to prevent a backup of the game.
std::string | GetCustomLevelName (int id)
| Seeks if an object occupies in a spot, to prevent a backup of the game.
const std::vector< std::string > & | GetCustomLevelList ()
| Seeks if an object occupies in a spot, to prevent a backup of the game.
bool | IsLoading ()
| Returns true if the game is on the loading screen.
void | StartMissionTimer ()
| Seeks if an object occupies in a spot, to prevent a backup of the game.

## Autosave management

void | SetAutosave (bool enable)
| Enable mode where completing mission closes the game.
bool | GetAutosave ()
| Enable mode where completing mission closes the game.
void | SetAutosaveInterval (int interval)
| Enable mode where completing mission closes the game.
int | GetAutosaveInterval ()
| Enable mode where completing mission closes the game.
void | SetAutosaveSlots (int slots)
| Enable mode where completing mission closes the game.
int | GetAutosaveSlots ()
| Enable mode where completing mission closes the game.
void | SetExitAfterMission (bool exit)
| Enable mode where completing mission closes the game.
void | LoadSaveFromDirName (const std::string &gameDir)
| Load saved game (used by command line argument).
bool | CanPlayerInteract ()
| Returns true if player can interact with things manually.

## Team definition management

const std::string & | GetTeamName (int id)
| Returns team name for the given team id.
bool | IsTeamColorDefined (int id)
| Returns true if team-specific colored texture is available.

## EnableBuild/EnableResearch/DoneResearch

Management of enabled buildings, enabled researches, and completed researches
int | GetEnableBuild ()
| Get enabled buildings.
void | SetEnableBuild (int enableBuild)
| Set enabled buildings.
int | GetEnableResearch ()
| Get enabled researches.
void | SetEnableResearch (int enableResearch)
| Set enabled researches.
int | GetDoneResearch (int team=0)
| Get done researches.
void | SetDoneResearch (int doneResearch, int team=0)
| Set done researches.
bool | IsBuildingEnabled (BuildType type)
| Check if the given building is enabled.
bool | IsBuildingEnabled (ObjectType type)
| Check if the given building is enabled.
bool | IsResearchEnabled (ResearchType type)
| Check if the given research is enabled.
bool | IsResearchDone (ResearchType type, int team)
| Check if the given research is done.
void | MarkResearchDone (ResearchType type, int team)
| Mark given research as done.
bool | CanBuild (ObjectType type, int team)
| Check if all requirements to build this object are met (EnableBuild + DoneResearch).
Error | CanBuildError (ObjectType type, int team)
| Check if all requirements to build this object are met (EnableBuild + DoneResearch).
bool | CanFactory (ObjectType type, int team)
| Check if all requirements to build this object in BotFactory are met (DoneResearch).
Error | CanFactoryError (ObjectType type, int team)
| Check if all requirements to build this object in BotFactory are met (DoneResearch).
void | CutObjectLink (CObject *object)
| Get enabled buildings.
float | GetGlobalMagnifyDamage ()
| Returns global magnifyDamage setting.
float | GetGlobalNuclearCapacity ()
| Returns global NuclearCell capacity Setting.
float | GetGlobalCellCapacity ()
| Returns global PowerCell capacity setting.
void | StartDetectEffect (COldObject *object, CObject *target)
| Get enabled buildings.
void | SetDebugCrashSpheres (bool draw)
| Enable crash sphere debug rendering.
bool | GetDebugCrashSpheres ()
| Check if crash sphere debug rendering is enabled.
std::set< int > | GetAllTeams ()
| Returns a set of all team IDs in the current level.
std::set< int > | GetAllActiveTeams ()
| Returns a set of all team IDs in the current level that are still active.
bool | EventFrame (const Event &event)
| Advances the entire scene.
bool | EventObject (const Event &event)
| Makes the event for all robots.
void | InitEye ()
| Initializes the view.
void | ShowSaveIndicator (bool show)
| Get enabled buildings.
void | CreateScene (bool soluce, bool fixScene, bool resetObject)
| Creates the whole scene.
void | ResetCreate ()
| Resets all objects to their original position.
void | LevelLoadingError (const std::string &error, const std::runtime_error &exception, Phase exitPhase=PHASE_LEVEL_LIST)
| Get enabled buildings.
int | CreateLight (Math::Vector direction, Gfx::Color color)
| Creates a directional light.
void | HiliteClear ()
| Removes setting evidence of the object with the mouse hovers over.
void | HiliteObject (Math::Point pos)
| Highlights the object with the mouse hovers over.
void | HiliteFrame (float rTime)
| Highlights the object with the mouse hovers over.
void | CreateTooltip (Math::Point pos, const std::string &text)
| Creates a tooltip.
void | ClearTooltip ()
| Clears the previous tooltip.
CObject * | DetectObject (Math::Point pos)
| Detects the object aimed by the mouse.
void | ChangeCamera ()
| Change the mode of the camera.
void | AbortMovie ()
| Cancels the current movie.
void | SelectOneObject (CObject *obj, bool displayError=true)
| Select an object, without deselecting the previous one.
void | HelpObject ()
| Displays help for an object.
bool | DeselectObject ()
| Switch to previous object.
void | DeleteAllObjects ()
| Quickly removes all objects.
void | UpdateInfoText ()
| Updates the text information.
void | StartDisplayVisit (EventType event)
| Start of the visit instead of an error.
void | FrameVisit (float rTime)
| Move the arrow to visit.
void | StopDisplayVisit ()
| End of the visit instead of an error.
void | ExecuteCmd (const std::string &cmd)
| Executes a command.
void | UpdateSpeedLabel ()
| Get enabled buildings.
void | AutosaveRotate ()
| Get enabled buildings.
void | Autosave ()
| Get enabled buildings.
void | QuickSave ()
| Get enabled buildings.
void | QuickLoad ()
| Get enabled buildings.
bool | DestroySelectedObject ()
| Deletes the selected object.
void | PushToSelectionHistory (CObject *obj)
| Get enabled buildings.
CObject * | PopFromSelectionHistory ()
| Get enabled buildings.

## Additional Inherited Members

Static Public Member Functions inherited from CSingleton< CRobotMain >
static CRobotMain & | GetInstance ()
static CRobotMain * | GetInstancePointer ()
static bool | IsCreated ()
Static Protected Attributes inherited from CSingleton< CRobotMain >
static CRobotMain * | m_instance

## Detailed Description

Main class managing the game world.

This is the main class of the whole game engine. It's main job is to manage main parts of the gameplay, like loading levels and checking for win conditions, but it's also a place where all things that don't fit elsewhere have landed.

Todo
  In the future, it would be nice to refactor this class to remove as much unrelated stuff as possible

## Constructor & Destructor Documentation

## CRobotMain()

CRobotMain::CRobotMain | ( |  | ) |

Constructor of robot application.

## ~CRobotMain()

CRobotMain::~CRobotMain | ( |  | ) |

virtual

Destructor of robot application.

## Member Function Documentation

## ChangePhase()

void CRobotMain::ChangePhase | ( | Phase | phase | ) |

Changes phase.

## ProcessEvent()

bool CRobotMain::ProcessEvent | ( | Event & | event | ) |

Processes an event.

## GetPhase()

Phase CRobotMain::GetPhase | ( |  | ) |

Changes phase.

## ScenePerso()

void CRobotMain::ScenePerso | ( |  | ) |

Load the scene for appearance customization.

## SetMovieLock()

void CRobotMain::SetMovieLock | ( | bool | lock | ) |

Management of the lock mode for movies.

## GetMovieLock()

bool CRobotMain::GetMovieLock | ( |  | ) |

Changes phase.

## GetInfoLock()

bool CRobotMain::GetInfoLock | ( |  | ) |

Changes phase.

## SetSatComLock()

void CRobotMain::SetSatComLock | ( | bool | lock | ) |

Management of the blocking of the call of SatCom.

## GetSatComLock()

bool CRobotMain::GetSatComLock | ( |  | ) |

Changes phase.

## SetEditLock()

void CRobotMain::SetEditLock | ( | bool | lock,
|  | bool | edit )

Management of the lock mode for the edition.

## GetEditLock()

bool CRobotMain::GetEditLock | ( |  | ) |

Changes phase.

## SetEditFull()

void CRobotMain::SetEditFull | ( | bool | full | ) |

Management of the fullscreen mode during editing.

## GetEditFull()

bool CRobotMain::GetEditFull | ( |  | ) |

Changes phase.

## SetFriendAim()

void CRobotMain::SetFriendAim | ( | bool | friendAim | ) |

Indicates whether mouse is on an friend object, on which we should not shoot.

## GetFriendAim()

bool CRobotMain::GetFriendAim | ( |  | ) |

Changes phase.

## SetSpeed()

void CRobotMain::SetSpeed | ( | float | speed | ) |

Changes game speed.

## GetSpeed()

float CRobotMain::GetSpeed | ( |  | ) |

Changes game speed.

## CreateShortcuts()

bool CRobotMain::CreateShortcuts | ( |  | ) |

Create the shortcuts at the top of the screen, if they should be visible.

See also
  CMainShort::CreateShortcuts

## UpdateShortcuts()

void CRobotMain::UpdateShortcuts | ( |  | ) |

Update the shortcuts at the top of the screen.

See also
  CMainShort::UpdateShortcuts

## SearchHuman()

CObject * CRobotMain::SearchHuman | ( |  | ) |

Find the astronaut (OBJECT_HUMAN) object.

## SelectObject()

bool CRobotMain::SelectObject | ( | CObject * | obj,
|  | bool | displayError = true )

Select an object.

Parameters

  obj | Object to select
  displayError | If true and the object is currently in error state, automatically display the error message

Note
  This function automatically adds objects to selection history (see PushToSelectionHistory())

## GetSelectObject()

CObject * CRobotMain::GetSelectObject | ( |  | ) |

Return the object that was selected at the start of the scene.

## DeselectAll()

CObject * CRobotMain::DeselectAll | ( |  | ) |

Deselect currently selected object

Returns
  Object that was deselected

## ResetObject()

void CRobotMain::ResetObject | ( |  | ) |

Resets all objects to their original position.

## UpdateAudio()

void CRobotMain::UpdateAudio | ( | bool | frame | ) |

Updates the audiotracks.

## SetMissionResultFromScript()

void CRobotMain::SetMissionResultFromScript | ( | Error | result,
|  | float | delay )

Set mission result from LevelController script.

## CheckEndMission()

Error CRobotMain::CheckEndMission | ( | bool | frame | ) |

Checks if the mission is over.

## ProcessEndMissionTake()

Error CRobotMain::ProcessEndMissionTake | ( |  | ) |

Process EndMissionTake commands, result is stored in m_missionResult If return value is different than ERR_MISSION_NOTERM, assume the mission is finished and pass on the result

## ProcessEndMissionTakeForGroup()

Error CRobotMain::ProcessEndMissionTakeForGroup | ( | std::vector< CSceneEndCondition * > & | endTakes | ) |

Changes game speed.

## GetObligatoryTokenList()

const std::map< std::string, MinMax > & CRobotMain::GetObligatoryTokenList | ( |  | ) |

Returns the list instructions required in CBot program in level.

## UpdateMap()

void CRobotMain::UpdateMap | ( |  | ) |

Updates the map.

## GetShowMap()

bool CRobotMain::GetShowMap | ( |  | ) |

Indicates whether the mini-map is visible.

## GetMainMovie()

MainMovieType CRobotMain::GetMainMovie | ( |  | ) |

Returns the type of current movie.

## FlushDisplayInfo()

void CRobotMain::FlushDisplayInfo | ( |  | ) |

Clears the display of instructions.

## StartDisplayInfo() [1/2]

void CRobotMain::StartDisplayInfo | ( | int | index,
|  | bool | movie )

Beginning of the displaying of instructions. index: SATCOM_*

## StartDisplayInfo() [2/2]

void CRobotMain::StartDisplayInfo | ( | const std::string & | filename,
|  | int | index )

Beginning of the displaying of instructions.

## StopDisplayInfo()

void CRobotMain::StopDisplayInfo | ( |  | ) |

End of displaying of instructions.

## GetDisplayInfoName()

char * CRobotMain::GetDisplayInfoName | ( | int | index | ) |

Returns the name of the text display.

## StartSuspend()

void CRobotMain::StartSuspend | ( |  | ) |

Beginning of a dialogue during the game.

## StopSuspend()

void CRobotMain::StopSuspend | ( |  | ) |

End of dialogue during the game.

## GetGameTime()

float CRobotMain::GetGameTime | ( |  | ) |

Returns the absolute time of the game.

## GetScriptName()

const std::string & CRobotMain::GetScriptName | ( |  | ) |

Changes game speed.

## GetScriptFile()

const std::string & CRobotMain::GetScriptFile | ( |  | ) |

Changes game speed.

## GetTrainerPilot()

bool CRobotMain::GetTrainerPilot | ( |  | ) |

Indicates whether it is possible to control a driving robot.

## GetPlusTrainer()

bool CRobotMain::GetPlusTrainer | ( |  | ) |

Changes game speed.

## GetPlusExplorer()

bool CRobotMain::GetPlusExplorer | ( |  | ) |

Changes game speed.

## GetFixScene()

bool CRobotMain::GetFixScene | ( |  | ) |

Indicates whether the scene is fixed, without interaction.

## GetShowSoluce()

bool CRobotMain::GetShowSoluce | ( |  | ) |

Changes game speed.

## GetSceneSoluce()

bool CRobotMain::GetSceneSoluce | ( |  | ) |

Changes game speed.

## GetShowAll()

bool CRobotMain::GetShowAll | ( |  | ) |

Changes game speed.

## GetRadar()

bool CRobotMain::GetRadar | ( |  | ) |

Changes game speed.

## GetMissionType()

MissionType CRobotMain::GetMissionType | ( |  | ) |

Changes game speed.

## GetGamerFace()

int CRobotMain::GetGamerFace | ( |  | ) |

Returns the representation to use for the player.

## GetGamerGlasses()

int CRobotMain::GetGamerGlasses | ( |  | ) |

Returns the representation to use for the player.

## GetGamerOnlyHead()

bool CRobotMain::GetGamerOnlyHead | ( |  | ) |

Returns the mode with just the head.

## GetPersoAngle()

float CRobotMain::GetPersoAngle | ( |  | ) |

Returns the angle of presentation.

## SetLevel()

void CRobotMain::SetLevel | ( | LevelCategory | cat,
|  | int | chap,
|  | int | rank )

Changes game speed.

## GetLevelCategory()

LevelCategory CRobotMain::GetLevelCategory | ( |  | ) |

Changes game speed.

## GetLevelChap()

int CRobotMain::GetLevelChap | ( |  | ) |

Changes game speed.

## GetLevelRank()

int CRobotMain::GetLevelRank | ( |  | ) |

Changes game speed.

## GetCustomLevelDir()

std::string CRobotMain::GetCustomLevelDir | ( |  | ) |

Returns folder name of the scene that user selected to play.

## SetReadScene()

void CRobotMain::SetReadScene | ( | std::string | path | ) |

Changes game speed.

## UpdateChapterPassed()

void CRobotMain::UpdateChapterPassed | ( |  | ) |

Changes game speed.

## StartMusic()

void CRobotMain::StartMusic | ( |  | ) |

Starts music with a mission.

## UpdatePause()

void CRobotMain::UpdatePause | ( | PauseType | pause | ) |

Changes game speed.

## UpdatePauseMusic()

void CRobotMain::UpdatePauseMusic | ( | PauseMusic | music | ) |

Changes game speed.

## ClearInterface()

void CRobotMain::ClearInterface | ( |  | ) |

Removes hilite and tooltip.

## ChangeColor()

void CRobotMain::ChangeColor | ( |  | ) |

Change the colors and textures.

## FreeSpace()

bool CRobotMain::FreeSpace | ( | Math::Vector & | center,
|  | float | minRadius,
|  | float | maxRadius,
|  | float | space,
|  | CObject * | exclu )

Calculates a free space.

## FlatFreeSpace()

bool CRobotMain::FlatFreeSpace | ( | Math::Vector & | center,
|  | float | minFlat,
|  | float | minRadius,
|  | float | maxRadius,
|  | float | space,
|  | CObject * | exclu )

Calculates a flat free space.

## GetFlatZoneRadius()

float CRobotMain::GetFlatZoneRadius | ( | Math::Vector | center,
|  | float | maxRadius,
|  | CObject * | exclu )

Calculates the maximum radius of a free space.

## HideDropZone()

void CRobotMain::HideDropZone | ( | CObject * | metal | ) |

Hides buildable area when a cube of metal is taken up.

## ShowDropZone()

void CRobotMain::ShowDropZone | ( | CObject * | metal,
|  | CObject * | transporter )

Shows the buildable area when a cube of metal is deposited.

## FlushShowLimit()

void CRobotMain::FlushShowLimit | ( | int | i | ) |

Erases the boundaries shown.

## SetShowLimit()

void CRobotMain::SetShowLimit | ( | int | i,
|  | Gfx::ParticleType | parti,
|  | CObject * | obj,
|  | Math::Vector | pos,
|  | float | radius,
|  | float | duration = SHOWLIMITTIME )

Specifies the boundaries to show.

## StartShowLimit()

void CRobotMain::StartShowLimit | ( |  | ) |

Mount the boundaries of the selected object.

## FrameShowLimit()

void CRobotMain::FrameShowLimit | ( | float | rTime | ) |

Advances the boundaries shown.

## SaveAllScript()

void CRobotMain::SaveAllScript | ( |  | ) |

Saves all programs of all the robots.

## SaveOneScript()

void CRobotMain::SaveOneScript | ( | CObject * | obj | ) |

Saves all programs of the robot.

## SaveFileStack()

bool CRobotMain::SaveFileStack | ( | CObject * | obj,
|  | std::ostream & | ostr )

Saves the stack of the program in execution of a robot.

## ReadFileStack()

bool CRobotMain::ReadFileStack | ( | CObject * | obj,
|  | std::istream & | istr )

Resumes the execution stack of the program in a robot.

## GetNewScriptNames()

std::vector< std::string > CRobotMain::GetNewScriptNames | ( | ObjectType | type | ) |

Return list of scripts to load to robot created in BotFactory.

## GetScoreboard()

CScoreboard * CRobotMain::GetScoreboard | ( |  | ) |

Return the scoreboard manager Note: this may return nullptr if the scoreboard is not enabled!

## SelectPlayer()

void CRobotMain::SelectPlayer | ( | std::string | playerName | ) |

Changes current player.

## GetPlayerProfile()

CPlayerProfile * CRobotMain::GetPlayerProfile | ( |  | ) |

Calculates the maximum radius of a free space.

## IOIsBusy()

bool CRobotMain::IOIsBusy | ( |  | ) |

Seeks if an object occupies in a spot, to prevent a backup of the game.

## IOWriteScene()

bool CRobotMain::IOWriteScene | ( | std::string | filename,
|  | std::string | filecbot,
|  | std::string | filescreenshot,
|  | const std::string & | info,
|  | bool | emergencySave = false )

Saves the current game.

## IOWriteSceneFinished()

void CRobotMain::IOWriteSceneFinished | ( |  | ) |

Notifies the user that scene write is finished.

## IOReadScene()

CObject * CRobotMain::IOReadScene | ( | std::string | filename,
|  | std::string | filecbot )

Resumes some part of the game.

## IOWriteObject()

void CRobotMain::IOWriteObject | ( | CLevelParserLine * | line,
|  | CObject * | obj,
|  | const std::string & | programDir,
|  | int | objRank )

Writes an object into the backup file.

## IOReadObject()

CObject * CRobotMain::IOReadObject | ( | CLevelParserLine * | line,
|  | const std::string & | programDir,
|  | const std::string & | objCounterText,
|  | float | objectProgress,
|  | int | objRank = -1 )

Resumes the game.

## CreateSpot()

int CRobotMain::CreateSpot | ( | Math::Vector | pos,
|  | Gfx::Color | color )

Creates a light spot.

## GetSelect()

CObject * CRobotMain::GetSelect | ( |  | ) |

Find the currently selected object.

## DisplayError() [1/2]

void CRobotMain::DisplayError | ( | Error | err,
|  | CObject * | pObj,
|  | float | time = 10.0f )

Seeks if an object occupies in a spot, to prevent a backup of the game.

## DisplayError() [2/2]

void CRobotMain::DisplayError | ( | Error | err,
|  | Math::Vector | goal,
|  | float | height = 15.0f,
|  | float | dist = 60.0f,
|  | float | time = 10.0f )

Seeks if an object occupies in a spot, to prevent a backup of the game.

## UpdateCustomLevelList()

void CRobotMain::UpdateCustomLevelList | ( |  | ) |

Seeks if an object occupies in a spot, to prevent a backup of the game.

## GetCustomLevelName()

std::string CRobotMain::GetCustomLevelName | ( | int | id | ) |

Seeks if an object occupies in a spot, to prevent a backup of the game.

## GetCustomLevelList()

const std::vector< std::string > & CRobotMain::GetCustomLevelList | ( |  | ) |

Seeks if an object occupies in a spot, to prevent a backup of the game.

## IsLoading()

bool CRobotMain::IsLoading | ( |  | ) |

Returns true if the game is on the loading screen.

## StartMissionTimer()

void CRobotMain::StartMissionTimer | ( |  | ) |

Seeks if an object occupies in a spot, to prevent a backup of the game.

## SetAutosave()

void CRobotMain::SetAutosave | ( | bool | enable | ) |

Enable mode where completing mission closes the game.

## GetAutosave()

bool CRobotMain::GetAutosave | ( |  | ) |

Enable mode where completing mission closes the game.

## SetAutosaveInterval()

void CRobotMain::SetAutosaveInterval | ( | int | interval | ) |

Enable mode where completing mission closes the game.

## GetAutosaveInterval()

int CRobotMain::GetAutosaveInterval | ( |  | ) |

Enable mode where completing mission closes the game.

## SetAutosaveSlots()

void CRobotMain::SetAutosaveSlots | ( | int | slots | ) |

Enable mode where completing mission closes the game.

## GetAutosaveSlots()

int CRobotMain::GetAutosaveSlots | ( |  | ) |

Enable mode where completing mission closes the game.

## SetExitAfterMission()

void CRobotMain::SetExitAfterMission | ( | bool | exit | ) |

Enable mode where completing mission closes the game.

## LoadSaveFromDirName()

void CRobotMain::LoadSaveFromDirName | ( | const std::string & | gameDir | ) |

Load saved game (used by command line argument).

## CanPlayerInteract()

bool CRobotMain::CanPlayerInteract | ( |  | ) |

Returns true if player can interact with things manually.

## GetTeamName()

const std::string & CRobotMain::GetTeamName | ( | int | id | ) |

Returns team name for the given team id.

## IsTeamColorDefined()

bool CRobotMain::IsTeamColorDefined | ( | int | id | ) |

Returns true if team-specific colored texture is available.

## GetEnableBuild()

int CRobotMain::GetEnableBuild | ( |  | ) |

Get enabled buildings.

Returns
  Bitmask of BuildType values

## SetEnableBuild()

void CRobotMain::SetEnableBuild | ( | int | enableBuild | ) |

Set enabled buildings.

Parameters

  enableBuild | Bitmask of BuildType values

## GetEnableResearch()

int CRobotMain::GetEnableResearch | ( |  | ) |

Get enabled researches.

Returns
  Bitmask of ResearchType values

## SetEnableResearch()

void CRobotMain::SetEnableResearch | ( | int | enableResearch | ) |

Set enabled researches.

Parameters

  enableResearch | Bitmask of ResearchType values

## GetDoneResearch()

int CRobotMain::GetDoneResearch | ( | int | team = 0 | ) |

Get done researches.

Parameters

  team | Team to get researches for

Returns
  Bitmask of ResearchType values

## SetDoneResearch()

void CRobotMain::SetDoneResearch | ( | int | doneResearch,
|  | int | team = 0 )

Set done researches.

Parameters

  doneResearch | Bitmask of ResearchType values
  team | Team to set researches for

## IsBuildingEnabled() [1/2]

bool CRobotMain::IsBuildingEnabled | ( | BuildType | type | ) |

Check if the given building is enabled.

## IsBuildingEnabled() [2/2]

bool CRobotMain::IsBuildingEnabled | ( | ObjectType | type | ) |

Check if the given building is enabled.

## IsResearchEnabled()

bool CRobotMain::IsResearchEnabled | ( | ResearchType | type | ) |

Check if the given research is enabled.

## IsResearchDone()

bool CRobotMain::IsResearchDone | ( | ResearchType | type,
|  | int | team )

Check if the given research is done.

## MarkResearchDone()

void CRobotMain::MarkResearchDone | ( | ResearchType | type,
|  | int | team )

Mark given research as done.

## CanBuild()

bool CRobotMain::CanBuild | ( | ObjectType | type,
|  | int | team )

inline

Check if all requirements to build this object are met (EnableBuild + DoneResearch).

Returns
  true if the building can be built, false otherwise

See also
  CanBuildError() for a version which returns a specific reason for the build being denied

## CanBuildError()

Error CRobotMain::CanBuildError | ( | ObjectType | type,
|  | int | team )

Check if all requirements to build this object are met (EnableBuild + DoneResearch).

Returns
  One of Error values - ERR_OK if the building can be built, ERR_BUILD_DISABLED or ERR_BUILD_RESEARCH otherwise

See also
  CanBuild() for a version which returns a boolean

## CanFactory()

bool CRobotMain::CanFactory | ( | ObjectType | type,
|  | int | team )

inline

Check if all requirements to build this object in BotFactory are met (DoneResearch).

Returns
  true if the robot can be built, false otherwise

See also
  CanFactoryError() for a version which returns a specific reason for the build being denied

## CanFactoryError()

Error CRobotMain::CanFactoryError | ( | ObjectType | type,
|  | int | team )

Check if all requirements to build this object in BotFactory are met (DoneResearch).

Returns
  One of Error values - ERR_OK if the robot can be built, ERR_BUILD_DISABLED or ERR_BUILD_RESEARCH otherwise

See also
  CanFactory() for a version which returns a boolean

## CutObjectLink()

void CRobotMain::CutObjectLink | ( | CObject * | object | ) |

Get enabled buildings.

Returns
  Bitmask of BuildType values

## GetGlobalMagnifyDamage()

float CRobotMain::GetGlobalMagnifyDamage | ( |  | ) |

Returns global magnifyDamage setting.

## GetGlobalNuclearCapacity()

float CRobotMain::GetGlobalNuclearCapacity | ( |  | ) |

Returns global NuclearCell capacity Setting.

## GetGlobalCellCapacity()

float CRobotMain::GetGlobalCellCapacity | ( |  | ) |

Returns global PowerCell capacity setting.

## StartDetectEffect()

void CRobotMain::StartDetectEffect | ( | COldObject * | object,
|  | CObject * | target )

Get enabled buildings.

Returns
  Bitmask of BuildType values

## SetDebugCrashSpheres()

void CRobotMain::SetDebugCrashSpheres | ( | bool | draw | ) |

Enable crash sphere debug rendering.

## GetDebugCrashSpheres()

bool CRobotMain::GetDebugCrashSpheres | ( |  | ) |

Check if crash sphere debug rendering is enabled.

## GetAllTeams()

std::set< int > CRobotMain::GetAllTeams | ( |  | ) |

Returns a set of all team IDs in the current level.

## GetAllActiveTeams()

std::set< int > CRobotMain::GetAllActiveTeams | ( |  | ) |

Returns a set of all team IDs in the current level that are still active.

## EventFrame()

bool CRobotMain::EventFrame | ( | const Event & | event | ) |

protected

Advances the entire scene.

## EventObject()

bool CRobotMain::EventObject | ( | const Event & | event | ) |

protected

Makes the event for all robots.

## InitEye()

void CRobotMain::InitEye | ( |  | ) |

protected

Initializes the view.

## ShowSaveIndicator()

void CRobotMain::ShowSaveIndicator | ( | bool | show | ) |

protected

Get enabled buildings.

Returns
  Bitmask of BuildType values

## CreateScene()

void CRobotMain::CreateScene | ( | bool | soluce,
|  | bool | fixScene,
|  | bool | resetObject )

protected

Creates the whole scene.

Note: This feature may be changed in next releases, Places new viewpoint, which can be selected later in (currently only in Code Battle) UI. Usage: View eye=x; y; z lookat=x; y; z

## ResetCreate()

void CRobotMain::ResetCreate | ( |  | ) |

protected

Resets all objects to their original position.

## LevelLoadingError()

void CRobotMain::LevelLoadingError | ( | const std::string & | error,
|  | const std::runtime_error & | exception,
|  | Phase | exitPhase = PHASE_LEVEL_LIST )

protected

Get enabled buildings.

Returns
  Bitmask of BuildType values

## CreateLight()

int CRobotMain::CreateLight | ( | Math::Vector | direction,
|  | Gfx::Color | color )

protected

Creates a directional light.

## HiliteClear()

void CRobotMain::HiliteClear | ( |  | ) |

protected

Removes setting evidence of the object with the mouse hovers over.

## HiliteObject()

void CRobotMain::HiliteObject | ( | Math::Point | pos | ) |

protected

Highlights the object with the mouse hovers over.

## HiliteFrame()

void CRobotMain::HiliteFrame | ( | float | rTime | ) |

protected

Highlights the object with the mouse hovers over.

## CreateTooltip()

void CRobotMain::CreateTooltip | ( | Math::Point | pos,
|  | const std::string & | text )

protected

Creates a tooltip.

## ClearTooltip()

void CRobotMain::ClearTooltip | ( |  | ) |

protected

Clears the previous tooltip.

## DetectObject()

CObject * CRobotMain::DetectObject | ( | Math::Point | pos | ) |

protected

Detects the object aimed by the mouse.

## ChangeCamera()

void CRobotMain::ChangeCamera | ( |  | ) |

protected

Change the mode of the camera.

## AbortMovie()

void CRobotMain::AbortMovie | ( |  | ) |

protected

Cancels the current movie.

## SelectOneObject()

void CRobotMain::SelectOneObject | ( | CObject * | obj,
|  | bool | displayError = true )

protected

Select an object, without deselecting the previous one.

Selects an object, without attending to deselect the rest.

## HelpObject()

void CRobotMain::HelpObject | ( |  | ) |

protected

Displays help for an object.

## DeselectObject()

bool CRobotMain::DeselectObject | ( |  | ) |

protected

Switch to previous object.

See also
  PopFromSelectionHistory()

## DeleteAllObjects()

void CRobotMain::DeleteAllObjects | ( |  | ) |

protected

Quickly removes all objects.

## UpdateInfoText()

void CRobotMain::UpdateInfoText | ( |  | ) |

protected

Updates the text information.

## StartDisplayVisit()

void CRobotMain::StartDisplayVisit | ( | EventType | event | ) |

protected

Start of the visit instead of an error.

## FrameVisit()

void CRobotMain::FrameVisit | ( | float | rTime | ) |

protected

Move the arrow to visit.

## StopDisplayVisit()

void CRobotMain::StopDisplayVisit | ( |  | ) |

protected

End of the visit instead of an error.

## ExecuteCmd()

void CRobotMain::ExecuteCmd | ( | const std::string & | cmd | ) |

protected

Executes a command.

## UpdateSpeedLabel()

void CRobotMain::UpdateSpeedLabel | ( |  | ) |

protected

Get enabled buildings.

Returns
  Bitmask of BuildType values

## AutosaveRotate()

void CRobotMain::AutosaveRotate | ( |  | ) |

protected

Get enabled buildings.

Returns
  Bitmask of BuildType values

## Autosave()

void CRobotMain::Autosave | ( |  | ) |

protected

Get enabled buildings.

Returns
  Bitmask of BuildType values

## QuickSave()

void CRobotMain::QuickSave | ( |  | ) |

protected

Get enabled buildings.

Returns
  Bitmask of BuildType values

## QuickLoad()

void CRobotMain::QuickLoad | ( |  | ) |

protected

Get enabled buildings.

Returns
  Bitmask of BuildType values

## DestroySelectedObject()

bool CRobotMain::DestroySelectedObject | ( |  | ) |

protected

Deletes the selected object.

## PushToSelectionHistory()

void CRobotMain::PushToSelectionHistory | ( | CObject * | obj | ) |

protected

Get enabled buildings.

Returns
  Bitmask of BuildType values

## PopFromSelectionHistory()

CObject * CRobotMain::PopFromSelectionHistory | ( |  | ) |

protected

Get enabled buildings.

Returns
  Bitmask of BuildType values

## CreateCodeBattleInterface()

void CRobotMain::CreateCodeBattleInterface | ( |  | ) |

protected

Progress of loaded player.

## UpdateCodeBattleInterface()

void CRobotMain::UpdateCodeBattleInterface | ( |  | ) |

protected

Progress of loaded player.

## ApplyCodeBattleInterface()

void CRobotMain::ApplyCodeBattleInterface | ( |  | ) |

protected

Progress of loaded player.

## DestroyCodeBattleInterface()

void CRobotMain::DestroyCodeBattleInterface | ( |  | ) |

protected

Progress of loaded player.

## SetCodeBattleSpectatorMode()

void CRobotMain::SetCodeBattleSpectatorMode | ( | bool | mode | ) |

protected

Progress of loaded player.

## UpdateDebugCrashSpheres()

void CRobotMain::UpdateDebugCrashSpheres | ( |  | ) |

protected

Progress of loaded player.

## PushToCommandHistory()

void CRobotMain::PushToCommandHistory | ( | std::string | cmd | ) |

protected

Adds element to the beginning of command history.

## GetNextFromCommandHistory()

std::string CRobotMain::GetNextFromCommandHistory | ( |  | ) |

protected

Returns next/previous element from command history and updates index.

## GetPreviousFromCommandHistory()

std::string CRobotMain::GetPreviousFromCommandHistory | ( |  | ) |

protected

Progress of loaded player.

## Member Data Documentation

## m_app

CApplication* CRobotMain::m_app = nullptr

protected

Progress of loaded player.

## m_eventQueue

CEventQueue* CRobotMain::m_eventQueue = nullptr

protected

Progress of loaded player.

## m_engine

Gfx::CEngine* CRobotMain::m_engine = nullptr

protected

Progress of loaded player.

## m_particle

Gfx::CParticle* CRobotMain::m_particle = nullptr

protected

Progress of loaded player.

## m_water

Gfx::CWater* CRobotMain::m_water = nullptr

protected

Progress of loaded player.

## m_cloud

Gfx::CCloud* CRobotMain::m_cloud = nullptr

protected

Progress of loaded player.

## m_lightning

Gfx::CLightning* CRobotMain::m_lightning = nullptr

protected

Progress of loaded player.

## m_planet

Gfx::CPlanet* CRobotMain::m_planet = nullptr

protected

Progress of loaded player.

## m_oldModelManager

Gfx::COldModelManager* CRobotMain::m_oldModelManager = nullptr

protected

Progress of loaded player.

## m_lightMan

Gfx::CLightManager* CRobotMain::m_lightMan = nullptr

protected

Progress of loaded player.

## m_sound

CSoundInterface* CRobotMain::m_sound = nullptr

protected

Progress of loaded player.

## m_input

CInput* CRobotMain::m_input = nullptr

protected

Progress of loaded player.

## m_objMan

std::unique_ptr<CObjectManager> CRobotMain::m_objMan

protected

Progress of loaded player.

## m_movie

std::unique_ptr<CMainMovie> CRobotMain::m_movie

protected

Progress of loaded player.

## m_pause

std::unique_ptr<CPauseManager> CRobotMain::m_pause

protected

Progress of loaded player.

## m_modelManager

std::unique_ptr<Gfx::CModelManager> CRobotMain::m_modelManager

protected

Progress of loaded player.

## m_terrain

std::unique_ptr<Gfx::CTerrain> CRobotMain::m_terrain

protected

Progress of loaded player.

## m_camera

std::unique_ptr<Gfx::CCamera> CRobotMain::m_camera

protected

Progress of loaded player.

## m_ui

std::unique_ptr<Ui::CMainUserInterface> CRobotMain::m_ui

protected

Progress of loaded player.

## m_short

std::unique_ptr<Ui::CMainShort> CRobotMain::m_short

protected

Progress of loaded player.

## m_map

std::unique_ptr<Ui::CMainMap> CRobotMain::m_map

protected

Progress of loaded player.

## m_interface

std::unique_ptr<Ui::CInterface> CRobotMain::m_interface

protected

Progress of loaded player.

## m_displayInfo

std::unique_ptr<Ui::CDisplayInfo> CRobotMain::m_displayInfo

protected

Progress of loaded player.

## m_displayText

std::unique_ptr<Ui::CDisplayText> CRobotMain::m_displayText

protected

Progress of loaded player.

## m_debugMenu

std::unique_ptr<Ui::CDebugMenu> CRobotMain::m_debugMenu

protected

Progress of loaded player.

## m_settings

std::unique_ptr<CSettings> CRobotMain::m_settings

protected

Progress of loaded player.

## m_playerProfile

std::unique_ptr<CPlayerProfile> CRobotMain::m_playerProfile

protected

Progress of loaded player.

## m_time

float CRobotMain::m_time = 0.0f

protected

Time since level start, including pause and intro movie.

## m_gameTime

float CRobotMain::m_gameTime = 0.0f

protected

Playing time since level start.

## m_gameTimeAbsolute

float CRobotMain::m_gameTimeAbsolute = 0.0f

protected

Playing time since level start, not dependent on simulation speed.

## m_levelCategory

LevelCategory CRobotMain::m_levelCategory

protected

Progress of loaded player.

## m_levelChap

int CRobotMain::m_levelChap = 0

protected

Progress of loaded player.

## m_levelRank

int CRobotMain::m_levelRank = 0

protected

Progress of loaded player.

## m_levelFile

std::string CRobotMain::m_levelFile = ""

protected

if set, loads this file instead of building from category/chap/rank

## m_sceneReadPath

std::string CRobotMain::m_sceneReadPath

protected

Progress of loaded player.

## m_winDelay

float CRobotMain::m_winDelay = 0.0f

protected

Progress of loaded player.

## m_lostDelay

float CRobotMain::m_lostDelay = 0.0f

protected

Progress of loaded player.

## m_fixScene

bool CRobotMain::m_fixScene = false

protected

Progress of loaded player.

## m_base

CObject* CRobotMain::m_base = nullptr

protected

Progress of loaded player.

## m_selectObject

CObject* CRobotMain::m_selectObject = nullptr

protected

Progress of loaded player.

## m_phase

Phase CRobotMain::m_phase = PHASE_WELCOME1

protected

Progress of loaded player.

## m_userPause

ActivePause* CRobotMain::m_userPause = nullptr

protected

Progress of loaded player.

## m_focusPause

ActivePause* CRobotMain::m_focusPause = nullptr

protected

Progress of loaded player.

## m_freePhotoPause

ActivePause* CRobotMain::m_freePhotoPause = nullptr

protected

Progress of loaded player.

## m_cmdEdit

bool CRobotMain::m_cmdEdit = false

protected

Progress of loaded player.

## m_cmdEditPause

ActivePause* CRobotMain::m_cmdEditPause = nullptr

protected

Progress of loaded player.

## m_cheatSelectInsect

bool CRobotMain::m_cheatSelectInsect = false

protected

Progress of loaded player.

## m_cheatShowSoluce

bool CRobotMain::m_cheatShowSoluce = false

protected

Progress of loaded player.

## m_cheatAllMission

bool CRobotMain::m_cheatAllMission = false

protected

Progress of loaded player.

## m_cheatRadar

bool CRobotMain::m_cheatRadar = false

protected

Progress of loaded player.

## m_shortCut

bool CRobotMain::m_shortCut = false

protected

Progress of loaded player.

## m_audioTrack

std::string CRobotMain::m_audioTrack

protected

Progress of loaded player.

## m_audioRepeat

bool CRobotMain::m_audioRepeat = false

protected

Progress of loaded player.

## m_satcomTrack

std::string CRobotMain::m_satcomTrack

protected

Progress of loaded player.

## m_satcomRepeat

bool CRobotMain::m_satcomRepeat = false

protected

Progress of loaded player.

## m_editorTrack

std::string CRobotMain::m_editorTrack

protected

Progress of loaded player.

## m_editorRepeat

bool CRobotMain::m_editorRepeat = false

protected

Progress of loaded player.

## m_movieInfoIndex

int CRobotMain::m_movieInfoIndex = 0

protected

Progress of loaded player.

## m_controller

CObject* CRobotMain::m_controller = nullptr

protected

Progress of loaded player.

## m_missionType

MissionType CRobotMain::m_missionType = MISSION_NORMAL

protected

Progress of loaded player.

## m_immediatSatCom

bool CRobotMain::m_immediatSatCom = false

protected

Progress of loaded player.

## m_beginSatCom

bool CRobotMain::m_beginSatCom = false

protected

Progress of loaded player.

## m_lockedSatCom

bool CRobotMain::m_lockedSatCom = false

protected

Progress of loaded player.

## m_movieLock

bool CRobotMain::m_movieLock = false

protected

Progress of loaded player.

## m_satComLock

bool CRobotMain::m_satComLock = false

protected

Progress of loaded player.

## m_editLock

bool CRobotMain::m_editLock = false

protected

Progress of loaded player.

## m_editFull

bool CRobotMain::m_editFull = false

protected

Progress of loaded player.

## m_hilite

bool CRobotMain::m_hilite = false

protected

Progress of loaded player.

## m_cheatTrainerPilot

bool CRobotMain::m_cheatTrainerPilot = false

protected

Progress of loaded player.

## m_friendAim

bool CRobotMain::m_friendAim = false

protected

Progress of loaded player.

## m_resetCreate

bool CRobotMain::m_resetCreate = false

protected

Progress of loaded player.

## m_mapShow

bool CRobotMain::m_mapShow = false

protected

Progress of loaded player.

## m_mapImage

bool CRobotMain::m_mapImage = false

protected

Progress of loaded player.

## m_mapFilename

char CRobotMain::m_mapFilename[100] = {}

protected

Progress of loaded player.

## m_suspend

ActivePause* CRobotMain::m_suspend = nullptr

protected

Progress of loaded player.

## m_tooltipPos

Math::Point CRobotMain::m_tooltipPos

protected

Progress of loaded player.

## m_tooltipName

std::string CRobotMain::m_tooltipName

protected

Progress of loaded player.

## m_tooltipTime

float CRobotMain::m_tooltipTime = 0.0f

protected

Progress of loaded player.

## m_infoFilename

char CRobotMain::m_infoFilename[SATCOM_MAX][100] = {}

protected

Progress of loaded player.

## m_infoObject

CObject* CRobotMain::m_infoObject = nullptr

protected

Progress of loaded player.

## m_infoUsed

int CRobotMain::m_infoUsed = 0

protected

Progress of loaded player.

## m_satcomMoviePause

ActivePause* CRobotMain::m_satcomMoviePause = nullptr

protected

Progress of loaded player.

## m_scriptName

std::string CRobotMain::m_scriptName = ""

protected

Progress of loaded player.

## m_scriptFile

std::string CRobotMain::m_scriptFile = ""

protected

Progress of loaded player.

## m_endingWin

std::string CRobotMain::m_endingWin = ""

protected

Progress of loaded player.

## m_endingLost

std::string CRobotMain::m_endingLost = ""

protected

Progress of loaded player.

## m_winTerminate

bool CRobotMain::m_winTerminate = false

protected

Progress of loaded player.

## m_globalMagnifyDamage

float CRobotMain::m_globalMagnifyDamage = 0.0f

protected

Progress of loaded player.

## m_globalNuclearCapacity

float CRobotMain::m_globalNuclearCapacity = 10.0f

protected

Progress of loaded player.

## m_globalCellCapacity

float CRobotMain::m_globalCellCapacity = 1.0f

protected

Progress of loaded player.

## m_exitAfterMission

bool CRobotMain::m_exitAfterMission = false

protected

Progress of loaded player.

## m_codeBattleInit

bool CRobotMain::m_codeBattleInit = false

protected

Progress of loaded player.

## m_codeBattleStarted

bool CRobotMain::m_codeBattleStarted = false

protected

Progress of loaded player.

## m_codeBattleSpectator

bool CRobotMain::m_codeBattleSpectator = true

protected

Code battle spectator mode, hides object UI, changes camera to CAM_TYPE_PLANE and allows for switching to free camera by clicking outside of any object.

## m_teamNames

std::map<int, std::string> CRobotMain::m_teamNames

protected

Progress of loaded player.

## m_newScriptName

std::vector<NewScriptName> CRobotMain::m_newScriptName

protected

Progress of loaded player.

## m_visitLast

EventType CRobotMain::m_visitLast = EVENT_NULL

protected

Progress of loaded player.

## m_visitObject

CObject* CRobotMain::m_visitObject = nullptr

protected

Progress of loaded player.

## m_visitArrow

CObject* CRobotMain::m_visitArrow = nullptr

protected

Progress of loaded player.

## m_visitTime

float CRobotMain::m_visitTime = 0.0f

protected

Progress of loaded player.

## m_visitParticle

float CRobotMain::m_visitParticle = 0.0f

protected

Progress of loaded player.

## m_visitPos

Math::Vector CRobotMain::m_visitPos

protected

Progress of loaded player.

## m_visitPosArrow

Math::Vector CRobotMain::m_visitPosArrow

protected

Progress of loaded player.

## m_visitPause

ActivePause* CRobotMain::m_visitPause = nullptr

protected

Progress of loaded player.

## m_endTake

std::vector<std::unique_ptr<CSceneEndCondition> > CRobotMain::m_endTake

protected

Progress of loaded player.

## m_endTakeImmediat

bool CRobotMain::m_endTakeImmediat = false

protected

If true, the mission ends immediately after completing the requirements without requiring SpaceShip takeoff.

## m_endTakeResearch

long CRobotMain::m_endTakeResearch = 0

protected

Progress of loaded player.

## m_endTakeTimeout

float CRobotMain::m_endTakeTimeout = -1.0f

protected

Progress of loaded player.

## m_endTakeTeamImmediateWin

bool CRobotMain::m_endTakeTeamImmediateWin = false

protected

Progress of loaded player.

## m_endTakeWinDelay

float CRobotMain::m_endTakeWinDelay = 0.0f

protected

Progress of loaded player.

## m_endTakeLostDelay

float CRobotMain::m_endTakeLostDelay = 0.0f

protected

Progress of loaded player.

## m_teamFinished

std::map<int, bool> CRobotMain::m_teamFinished

protected

Set to true for teams that have already finished.

## m_audioChange

std::vector<std::unique_ptr<CAudioChangeCondition> > CRobotMain::m_audioChange

protected

Progress of loaded player.

## m_scoreboard

std::unique_ptr<CScoreboard> CRobotMain::m_scoreboard

protected

The scoreboard If the scoreboard is not enabled for this level, this will be null

## m_obligatoryTokens

std::map<std::string, MinMax> CRobotMain::m_obligatoryTokens

protected

Progress of loaded player.

## m_build

int CRobotMain::m_build = 0

protected

Enabled buildings.

## m_researchEnable

long CRobotMain::m_researchEnable = 0

protected

Available researches.

## m_researchDone

std::map<int, int> CRobotMain::m_researchDone

protected

Done researches for each team.

## m_missionResult

Error CRobotMain::m_missionResult = ERR_OK

protected

Progress of loaded player.

## m_missionResultFromScript

bool CRobotMain::m_missionResultFromScript = false

protected

true if m_missionResult has been set by LevelController script, this disables normal EndMissionTake processing

## m_showLimit

ShowLimit CRobotMain::m_showLimit[MAXSHOWLIMIT]

protected

Progress of loaded player.

## m_colorNewBot

std::map<int, Gfx::Color> CRobotMain::m_colorNewBot

protected

Progress of loaded player.

## m_colorNewAlien

Gfx::Color CRobotMain::m_colorNewAlien

protected

Progress of loaded player.

## m_colorNewGreen

Gfx::Color CRobotMain::m_colorNewGreen

protected

Progress of loaded player.

## m_colorNewWater

Gfx::Color CRobotMain::m_colorNewWater

protected

Progress of loaded player.

## m_colorShiftWater

float CRobotMain::m_colorShiftWater = 0.0f

protected

Progress of loaded player.

## m_missionTimerEnabled

bool CRobotMain::m_missionTimerEnabled = false

protected

Progress of loaded player.

## m_missionTimerStarted

bool CRobotMain::m_missionTimerStarted = false

protected

Progress of loaded player.

## m_missionTimer

float CRobotMain::m_missionTimer = 0.0f

protected

Progress of loaded player.

## m_autosave

bool CRobotMain::m_autosave = false

protected

Progress of loaded player.

## m_autosaveInterval

int CRobotMain::m_autosaveInterval = 0

protected

Progress of loaded player.

## m_autosaveSlots

int CRobotMain::m_autosaveSlots = 0

protected

Progress of loaded player.

## m_autosaveLast

float CRobotMain::m_autosaveLast = 0.0f

protected

Progress of loaded player.

## m_shotSaving

int CRobotMain::m_shotSaving = 0

protected

Progress of loaded player.

## m_selectionHistory

std::deque<CObject*> CRobotMain::m_selectionHistory

protected

Progress of loaded player.

## m_debugCrashSpheres

bool CRobotMain::m_debugCrashSpheres

protected

Progress of loaded player.

## m_commandHistory

std::deque<std::string> CRobotMain::m_commandHistory

protected

Cheat console command history.

## m_commandHistoryIndex

int CRobotMain::m_commandHistoryIndex

protected

Index of currently selected element in command history.

## m_viewpoints

std::vector<Viewpoint> CRobotMain::m_viewpoints

protected

Vector of available viewpoints.

The documentation for this class was generated from the following files:

- src/level/robotmain.h
- src/level/robotmain.cpp