Colobot
|
Main class managing the game world. More...
#include <src/level/robotmain.h>
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 ¢er, float minRadius, float maxRadius, float space, CObject *exclu) |
Calculates a free space. | |
bool | FlatFreeSpace (Math::Vector ¢er, 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 CRobotMain & | GetInstance () |
static CRobotMain * | GetInstancePointer () |
static bool | IsCreated () |
![]() | |
static CRobotMain * | m_instance |
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.
CRobotMain::CRobotMain | ( | ) |
Constructor of robot application.
|
virtual |
Destructor of robot application.
void CRobotMain::ChangePhase | ( | Phase | phase | ) |
Changes phase.
bool CRobotMain::ProcessEvent | ( | Event & | event | ) |
Processes an event.
Phase CRobotMain::GetPhase | ( | ) |
Changes phase.
void CRobotMain::ScenePerso | ( | ) |
Load the scene for appearance customization.
void CRobotMain::SetMovieLock | ( | bool | lock | ) |
Management of the lock mode for movies.
bool CRobotMain::GetMovieLock | ( | ) |
Changes phase.
bool CRobotMain::GetInfoLock | ( | ) |
Changes phase.
void CRobotMain::SetSatComLock | ( | bool | lock | ) |
Management of the blocking of the call of SatCom.
bool CRobotMain::GetSatComLock | ( | ) |
Changes phase.
void CRobotMain::SetEditLock | ( | bool | lock, |
bool | edit | ||
) |
Management of the lock mode for the edition.
bool CRobotMain::GetEditLock | ( | ) |
Changes phase.
void CRobotMain::SetEditFull | ( | bool | full | ) |
Management of the fullscreen mode during editing.
bool CRobotMain::GetEditFull | ( | ) |
Changes phase.
void CRobotMain::SetFriendAim | ( | bool | friendAim | ) |
Indicates whether mouse is on an friend object, on which we should not shoot.
bool CRobotMain::GetFriendAim | ( | ) |
Changes phase.
void CRobotMain::SetSpeed | ( | float | speed | ) |
Changes game speed.
float CRobotMain::GetSpeed | ( | ) |
Changes game speed.
bool CRobotMain::CreateShortcuts | ( | ) |
Create the shortcuts at the top of the screen, if they should be visible.
void CRobotMain::UpdateShortcuts | ( | ) |
Update the shortcuts at the top of the screen.
CObject * CRobotMain::SearchHuman | ( | ) |
Find the astronaut (OBJECT_HUMAN) object.
bool CRobotMain::SelectObject | ( | CObject * | obj, |
bool | displayError = true |
||
) |
Select an object.
obj | Object to select |
displayError | If true and the object is currently in error state, automatically display the error message |
CObject * CRobotMain::GetSelectObject | ( | ) |
Return the object that was selected at the start of the scene.
CObject * CRobotMain::DeselectAll | ( | ) |
Deselect currently selected object
void CRobotMain::ResetObject | ( | ) |
Resets all objects to their original position.
void CRobotMain::UpdateAudio | ( | bool | frame | ) |
Updates the audiotracks.
void CRobotMain::SetMissionResultFromScript | ( | Error | result, |
float | delay | ||
) |
Set mission result from LevelController script.
Error CRobotMain::CheckEndMission | ( | bool | frame | ) |
Checks if the mission is over.
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
Error CRobotMain::ProcessEndMissionTakeForGroup | ( | std::vector< CSceneEndCondition * > & | endTakes | ) |
Changes game speed.
const std::map< std::string, MinMax > & CRobotMain::GetObligatoryTokenList | ( | ) |
Returns the list instructions required in CBot program in level.
void CRobotMain::UpdateMap | ( | ) |
Updates the map.
bool CRobotMain::GetShowMap | ( | ) |
Indicates whether the mini-map is visible.
MainMovieType CRobotMain::GetMainMovie | ( | ) |
Returns the type of current movie.
void CRobotMain::FlushDisplayInfo | ( | ) |
Clears the display of instructions.
void CRobotMain::StartDisplayInfo | ( | int | index, |
bool | movie | ||
) |
Beginning of the displaying of instructions. index: SATCOM_*
void CRobotMain::StartDisplayInfo | ( | const std::string & | filename, |
int | index | ||
) |
Beginning of the displaying of instructions.
void CRobotMain::StopDisplayInfo | ( | ) |
End of displaying of instructions.
char * CRobotMain::GetDisplayInfoName | ( | int | index | ) |
Returns the name of the text display.
void CRobotMain::StartSuspend | ( | ) |
Beginning of a dialogue during the game.
void CRobotMain::StopSuspend | ( | ) |
End of dialogue during the game.
float CRobotMain::GetGameTime | ( | ) |
Returns the absolute time of the game.
const std::string & CRobotMain::GetScriptName | ( | ) |
Changes game speed.
const std::string & CRobotMain::GetScriptFile | ( | ) |
Changes game speed.
bool CRobotMain::GetTrainerPilot | ( | ) |
Indicates whether it is possible to control a driving robot.
bool CRobotMain::GetPlusTrainer | ( | ) |
Changes game speed.
bool CRobotMain::GetPlusExplorer | ( | ) |
Changes game speed.
bool CRobotMain::GetFixScene | ( | ) |
Indicates whether the scene is fixed, without interaction.
bool CRobotMain::GetShowSoluce | ( | ) |
Changes game speed.
bool CRobotMain::GetSceneSoluce | ( | ) |
Changes game speed.
bool CRobotMain::GetShowAll | ( | ) |
Changes game speed.
bool CRobotMain::GetRadar | ( | ) |
Changes game speed.
MissionType CRobotMain::GetMissionType | ( | ) |
Changes game speed.
int CRobotMain::GetGamerFace | ( | ) |
Returns the representation to use for the player.
int CRobotMain::GetGamerGlasses | ( | ) |
Returns the representation to use for the player.
bool CRobotMain::GetGamerOnlyHead | ( | ) |
Returns the mode with just the head.
float CRobotMain::GetPersoAngle | ( | ) |
Returns the angle of presentation.
void CRobotMain::SetLevel | ( | LevelCategory | cat, |
int | chap, | ||
int | rank | ||
) |
Changes game speed.
LevelCategory CRobotMain::GetLevelCategory | ( | ) |
Changes game speed.
int CRobotMain::GetLevelChap | ( | ) |
Changes game speed.
int CRobotMain::GetLevelRank | ( | ) |
Changes game speed.
std::string CRobotMain::GetCustomLevelDir | ( | ) |
Returns folder name of the scene that user selected to play.
void CRobotMain::SetReadScene | ( | std::string | path | ) |
Changes game speed.
void CRobotMain::UpdateChapterPassed | ( | ) |
Changes game speed.
void CRobotMain::StartMusic | ( | ) |
Starts music with a mission.
void CRobotMain::UpdatePause | ( | PauseType | pause | ) |
Changes game speed.
void CRobotMain::UpdatePauseMusic | ( | PauseMusic | music | ) |
Changes game speed.
void CRobotMain::ClearInterface | ( | ) |
Removes hilite and tooltip.
void CRobotMain::ChangeColor | ( | ) |
Change the colors and textures.
bool CRobotMain::FreeSpace | ( | Math::Vector & | center, |
float | minRadius, | ||
float | maxRadius, | ||
float | space, | ||
CObject * | exclu | ||
) |
Calculates a free space.
bool CRobotMain::FlatFreeSpace | ( | Math::Vector & | center, |
float | minFlat, | ||
float | minRadius, | ||
float | maxRadius, | ||
float | space, | ||
CObject * | exclu | ||
) |
Calculates a flat free space.
float CRobotMain::GetFlatZoneRadius | ( | Math::Vector | center, |
float | maxRadius, | ||
CObject * | exclu | ||
) |
Calculates the maximum radius of a free space.
void CRobotMain::HideDropZone | ( | CObject * | metal | ) |
Hides buildable area when a cube of metal is taken up.
Shows the buildable area when a cube of metal is deposited.
void CRobotMain::FlushShowLimit | ( | int | i | ) |
Erases the boundaries shown.
void CRobotMain::SetShowLimit | ( | int | i, |
Gfx::ParticleType | parti, | ||
CObject * | obj, | ||
Math::Vector | pos, | ||
float | radius, | ||
float | duration = SHOWLIMITTIME |
||
) |
Specifies the boundaries to show.
void CRobotMain::StartShowLimit | ( | ) |
Mount the boundaries of the selected object.
void CRobotMain::FrameShowLimit | ( | float | rTime | ) |
Advances the boundaries shown.
void CRobotMain::SaveAllScript | ( | ) |
Saves all programs of all the robots.
void CRobotMain::SaveOneScript | ( | CObject * | obj | ) |
Saves all programs of the robot.
bool CRobotMain::SaveFileStack | ( | CObject * | obj, |
std::ostream & | ostr | ||
) |
Saves the stack of the program in execution of a robot.
bool CRobotMain::ReadFileStack | ( | CObject * | obj, |
std::istream & | istr | ||
) |
Resumes the execution stack of the program in a robot.
std::vector< std::string > CRobotMain::GetNewScriptNames | ( | ObjectType | type | ) |
Return list of scripts to load to robot created in BotFactory.
CScoreboard * CRobotMain::GetScoreboard | ( | ) |
Return the scoreboard manager Note: this may return nullptr if the scoreboard is not enabled!
void CRobotMain::SelectPlayer | ( | std::string | playerName | ) |
Changes current player.
CPlayerProfile * CRobotMain::GetPlayerProfile | ( | ) |
Calculates the maximum radius of a free space.
bool CRobotMain::IOIsBusy | ( | ) |
Seeks if an object occupies in a spot, to prevent a backup of the game.
bool CRobotMain::IOWriteScene | ( | std::string | filename, |
std::string | filecbot, | ||
std::string | filescreenshot, | ||
const std::string & | info, | ||
bool | emergencySave = false |
||
) |
Saves the current game.
void CRobotMain::IOWriteSceneFinished | ( | ) |
Notifies the user that scene write is finished.
CObject * CRobotMain::IOReadScene | ( | std::string | filename, |
std::string | filecbot | ||
) |
Resumes some part of the game.
void CRobotMain::IOWriteObject | ( | CLevelParserLine * | line, |
CObject * | obj, | ||
const std::string & | programDir, | ||
int | objRank | ||
) |
Writes an object into the backup file.
CObject * CRobotMain::IOReadObject | ( | CLevelParserLine * | line, |
const std::string & | programDir, | ||
const std::string & | objCounterText, | ||
float | objectProgress, | ||
int | objRank = -1 |
||
) |
Resumes the game.
int CRobotMain::CreateSpot | ( | Math::Vector | pos, |
Gfx::Color | color | ||
) |
Creates a light spot.
CObject * CRobotMain::GetSelect | ( | ) |
Find the currently selected object.
Seeks if an object occupies in a spot, to prevent a backup of the game.
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.
void CRobotMain::UpdateCustomLevelList | ( | ) |
Seeks if an object occupies in a spot, to prevent a backup of the game.
std::string CRobotMain::GetCustomLevelName | ( | int | id | ) |
Seeks if an object occupies in a spot, to prevent a backup of the game.
const std::vector< std::string > & CRobotMain::GetCustomLevelList | ( | ) |
Seeks if an object occupies in a spot, to prevent a backup of the game.
bool CRobotMain::IsLoading | ( | ) |
Returns true if the game is on the loading screen.
void CRobotMain::StartMissionTimer | ( | ) |
Seeks if an object occupies in a spot, to prevent a backup of the game.
void CRobotMain::SetAutosave | ( | bool | enable | ) |
Enable mode where completing mission closes the game.
bool CRobotMain::GetAutosave | ( | ) |
Enable mode where completing mission closes the game.
void CRobotMain::SetAutosaveInterval | ( | int | interval | ) |
Enable mode where completing mission closes the game.
int CRobotMain::GetAutosaveInterval | ( | ) |
Enable mode where completing mission closes the game.
void CRobotMain::SetAutosaveSlots | ( | int | slots | ) |
Enable mode where completing mission closes the game.
int CRobotMain::GetAutosaveSlots | ( | ) |
Enable mode where completing mission closes the game.
void CRobotMain::SetExitAfterMission | ( | bool | exit | ) |
Enable mode where completing mission closes the game.
void CRobotMain::LoadSaveFromDirName | ( | const std::string & | gameDir | ) |
Load saved game (used by command line argument)
bool CRobotMain::CanPlayerInteract | ( | ) |
Returns true if player can interact with things manually.
const std::string & CRobotMain::GetTeamName | ( | int | id | ) |
Returns team name for the given team id.
bool CRobotMain::IsTeamColorDefined | ( | int | id | ) |
Returns true if team-specific colored texture is available.
int CRobotMain::GetEnableBuild | ( | ) |
Get enabled buildings.
void CRobotMain::SetEnableBuild | ( | int | enableBuild | ) |
Set enabled buildings.
enableBuild | Bitmask of BuildType values |
int CRobotMain::GetEnableResearch | ( | ) |
Get enabled researches.
void CRobotMain::SetEnableResearch | ( | int | enableResearch | ) |
Set enabled researches.
enableResearch | Bitmask of ResearchType values |
int CRobotMain::GetDoneResearch | ( | int | team = 0 | ) |
Get done researches.
team | Team to get researches for |
void CRobotMain::SetDoneResearch | ( | int | doneResearch, |
int | team = 0 |
||
) |
Set done researches.
doneResearch | Bitmask of ResearchType values |
team | Team to set researches for |
bool CRobotMain::IsBuildingEnabled | ( | BuildType | type | ) |
Check if the given building is enabled.
bool CRobotMain::IsBuildingEnabled | ( | ObjectType | type | ) |
Check if the given building is enabled.
bool CRobotMain::IsResearchEnabled | ( | ResearchType | type | ) |
Check if the given research is enabled.
bool CRobotMain::IsResearchDone | ( | ResearchType | type, |
int | team | ||
) |
Check if the given research is done.
void CRobotMain::MarkResearchDone | ( | ResearchType | type, |
int | team | ||
) |
Mark given research as done.
|
inline |
Check if all requirements to build this object are met (EnableBuild + DoneResearch)
Error CRobotMain::CanBuildError | ( | ObjectType | type, |
int | team | ||
) |
Check if all requirements to build this object are met (EnableBuild + DoneResearch)
|
inline |
Check if all requirements to build this object in BotFactory are met (DoneResearch)
Error CRobotMain::CanFactoryError | ( | ObjectType | type, |
int | team | ||
) |
Check if all requirements to build this object in BotFactory are met (DoneResearch)
void CRobotMain::CutObjectLink | ( | CObject * | object | ) |
Get enabled buildings.
float CRobotMain::GetGlobalMagnifyDamage | ( | ) |
Returns global magnifyDamage setting.
float CRobotMain::GetGlobalNuclearCapacity | ( | ) |
Returns global NuclearCell capacity Setting.
float CRobotMain::GetGlobalCellCapacity | ( | ) |
Returns global PowerCell capacity setting.
void CRobotMain::StartDetectEffect | ( | COldObject * | object, |
CObject * | target | ||
) |
Get enabled buildings.
void CRobotMain::SetDebugCrashSpheres | ( | bool | draw | ) |
Enable crash sphere debug rendering.
bool CRobotMain::GetDebugCrashSpheres | ( | ) |
Check if crash sphere debug rendering is enabled.
std::set< int > CRobotMain::GetAllTeams | ( | ) |
Returns a set of all team IDs in the current level.
std::set< int > CRobotMain::GetAllActiveTeams | ( | ) |
Returns a set of all team IDs in the current level that are still active.
|
protected |
Advances the entire scene.
|
protected |
Makes the event for all robots.
|
protected |
Initializes the view.
|
protected |
Get enabled buildings.
|
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
|
protected |
Resets all objects to their original position.
|
protected |
Get enabled buildings.
|
protected |
Creates a directional light.
|
protected |
Removes setting evidence of the object with the mouse hovers over.
|
protected |
Highlights the object with the mouse hovers over.
|
protected |
Highlights the object with the mouse hovers over.
|
protected |
Creates a tooltip.
|
protected |
Clears the previous tooltip.
|
protected |
Detects the object aimed by the mouse.
|
protected |
Change the mode of the camera.
|
protected |
Cancels the current movie.
|
protected |
Select an object, without deselecting the previous one.
Selects an object, without attending to deselect the rest.
|
protected |
Displays help for an object.
|
protected |
Switch to previous object.
|
protected |
Quickly removes all objects.
|
protected |
Updates the text information.
|
protected |
Start of the visit instead of an error.
|
protected |
Move the arrow to visit.
|
protected |
End of the visit instead of an error.
|
protected |
Executes a command.
|
protected |
Get enabled buildings.
|
protected |
Get enabled buildings.
|
protected |
Get enabled buildings.
|
protected |
Get enabled buildings.
|
protected |
Get enabled buildings.
|
protected |
Deletes the selected object.
|
protected |
Get enabled buildings.
|
protected |
Get enabled buildings.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Adds element to the beginning of command history.
|
protected |
Returns next/previous element from command history and updates index.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Time since level start, including pause and intro movie.
|
protected |
Playing time since level start.
|
protected |
Playing time since level start, not dependent on simulation speed.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
if set, loads this file instead of building from category/chap/rank
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
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.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
If true, the mission ends immediately after completing the requirements without requiring SpaceShip takeoff.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Set to true for teams that have already finished.
|
protected |
Progress of loaded player.
|
protected |
The scoreboard If the scoreboard is not enabled for this level, this will be null
|
protected |
Progress of loaded player.
|
protected |
Enabled buildings.
|
protected |
Available researches.
|
protected |
Done researches for each team.
|
protected |
true if m_missionResult has been set by LevelController script, this disables normal EndMissionTake processing
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Progress of loaded player.
|
protected |
Cheat console command history.
|
protected |
Index of currently selected element in command history.
|
protected |
Vector of available viewpoints.