Colobot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
CRobotMain Class Reference
Inheritance diagram for CRobotMain:
Inheritance graph
[legend]

Public Member Functions

 CRobotMain (CApplication *app, bool loadProfile)
 Constructor of robot application.
virtual ~CRobotMain ()
 Destructor of robot application.
Gfx::CCameraGetCamera ()
Gfx::CTerrainGetTerrain ()
Ui::CInterfaceGetInterface ()
Ui::CDisplayTextGetDisplayText ()
void LoadSceneOnStart (const std::string &name, int rank)
 Caused the given mission to be loaded immediately after start.
void CreateIni ()
 Creates the file colobot.ini at the first time.
void SetDefaultInputBindings ()
 Sets the default input bindings (key and axes)
void ResetKeyStates ()
 Resets tracked key states (motion vectors)
void ChangePhase (Phase phase)
 Changes phase.
bool ProcessEvent (Event &event)
 Processes an event.
bool CreateShortcuts ()
 Creates interface shortcuts to the units.
void ScenePerso ()
 Load the scene for the character.
void SetMovieLock (bool lock)
 Management of the lock mode for movies.
bool GetMovieLock ()
bool GetInfoLock ()
void SetSatComLock (bool lock)
 Management of the blocking of the call of SatCom.
bool GetSatComLock ()
void SetEditLock (bool lock, bool edit)
 Management of the lock mode for the edition.
bool GetEditLock ()
void SetEditFull (bool full)
 Management of the fullscreen mode during editing.
bool GetEditFull ()
bool GetFreePhoto ()
void SetFriendAim (bool friendAim)
 Indicates whether mouse is on an friend object, on which we should not shoot.
bool GetFriendAim ()
void SetTracePrecision (float factor)
 Management of the precision of drawing the ground.
float GetTracePrecision ()
void ChangePause (PauseType pause)
 Changes on the pause mode.
void SetSpeed (float speed)
 Changes game speed.
float GetSpeed ()
void UpdateShortcuts ()
 Updates all the shortcuts.
void SelectHuman ()
 Selects the human.
CObjectSearchHuman ()
 Returns the object human.
CObjectSearchToto ()
 Returns the object toto.
CObjectSearchNearest (Math::Vector pos, CObject *pExclu)
 Returns the nearest selectable object from a given position.
bool SelectObject (CObject *pObj, bool displayError=true)
 Selects the object aimed by the mouse.
CObjectGetSelectObject ()
 Returns the object that default was select after the creation of a scene.
CObjectDeselectAll ()
 Deselects everything, and returns the object that was selected.
bool DeleteObject ()
 Deletes the selected object.
void ResetObject ()
 Resets all objects to their original position.
void ResetCreate ()
 Resets all objects to their original position.
void UpdateAudio (bool frame)
 Updates the audiotracks.
void SetEndMission (Error result, float delay)
Error CheckEndMission (bool frame)
 Checks if the mission is over.
void CheckEndMessage (const char *message)
 Checks if the mission is finished after displaying a message.
int GetObligatoryToken ()
 Returns the number of instructions required.
char * GetObligatoryToken (int i)
 Returns the name of a required instruction.
int IsObligatoryToken (const char *token)
 Checks if an instruction is part of the obligatory list.
bool IsProhibitedToken (const char *token)
 Checks if an instruction is not part of the banned list.
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 char *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.
int GetDisplayInfoPosition (int index)
 Returns the name of the text display.
void SetDisplayInfoPosition (int index, int pos)
 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.
void SetFontSize (float size)
 Managing the size of the default fonts.
float GetFontSize ()
void SetWindowPos (Math::Point pos)
 Managing the size of the default window.
Math::Point GetWindowPos ()
void SetWindowDim (Math::Point dim)
Math::Point GetWindowDim ()
void SetIOPublic (bool mode)
 Managing windows open/save.
bool GetIOPublic ()
void SetIOPos (Math::Point pos)
Math::Point GetIOPos ()
void SetIODim (Math::Point dim)
Math::Point GetIODim ()
char * GetTitle ()
char * GetResume ()
char * GetScriptName ()
char * GetScriptFile ()
bool GetTrainerPilot ()
 Indicates whether it is possible to control a driving robot.
bool GetFixScene ()
 Indicates whether the scene is fixed, without interaction.
bool GetGlint ()
bool GetSoluce4 ()
bool GetMovies ()
bool GetNiceReset ()
bool GetHimselfDamage ()
bool GetShowSoluce ()
bool GetSceneSoluce ()
bool GetShowAll ()
bool GetRadar ()
const char * GetSavegameDir ()
const char * GetPublicDir ()
const char * GetFilesDir ()
bool GetRetroMode ()
void SetGamerName (const char *name)
 Change the player's name.
char * GetGamerName ()
 Gets the player's name.
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 StartMusic ()
 Starts music with a mission.
void StartPauseMusic (PauseType pause)
 Starts pause music.
void ClearInterface ()
 Removes hilite and tooltip.
void ChangeColor ()
 Change the colors and textures.
float SearchNearestObject (Math::Vector center, CObject *exclu)
 Calculates the distance to the nearest object.
bool FreeSpace (Math::Vector &center, float minRadius, float maxRadius, float space, CObject *exclu)
 Calculates a free space.
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 *truck)
 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 *pObj, Math::Vector pos, float radius, float duration=SHOWLIMITTIME)
 Specifies the boundaries to show.
void AdjustShowLimit (int i, Math::Vector pos)
 Adjusts the boundaries to show.
void StartShowLimit ()
 Mount the boundaries of the selected object.
void FrameShowLimit (float rTime)
 Advances the boundaries shown.
void CompileScript (bool soluce)
 Compiles all scripts of robots.
void LoadOneScript (CObject *pObj, int &nerror)
 Load all programs of the robot.
void LoadFileScript (CObject *pObj, const char *filename, int objRank, int &nerror)
 Load all programs of the robot.
void SaveAllScript ()
 Saves all programs of all the robots.
void SaveOneScript (CObject *pObj)
void SaveFileScript (CObject *pObj, const char *filename, int objRank)
bool SaveFileStack (CObject *pObj, FILE *file, int objRank)
 Saves the stack of the program in execution of a robot.
bool ReadFileStack (CObject *pObj, FILE *file, int objRank)
 Resumes the execution stack of the program in a robot.
bool FlushNewScriptName ()
 Empty the list.
bool AddNewScriptName (ObjectType type, char *name)
 Adds a script name.
char * GetNewScriptName (ObjectType type, int rank)
 Seeks a script name for a given type.
void WriteFreeParam ()
 Writes the global parameters for free play.
void ReadFreeParam ()
 Reads the global parameters for free play.
bool IsBusy ()
 Seeks if an object occupies in a spot, to prevent a backup of the game.
bool IOWriteScene (const char *filename, const char *filecbot, char *info)
 Saves the current game.
CObjectIOReadScene (const char *filename, const char *filecbot)
 Resumes some part of the game.
void IOWriteObject (FILE *file, CObject *pObj, const char *cmd)
 Writes an object into the backup file.
CObjectIOReadObject (char *line, const char *filename, int objRank)
 Resumes the game.
int CreateSpot (Math::Vector pos, Gfx::Color color)
 Creates a light spot.
void SetNumericLocale ()
void RestoreNumericLocale ()
CObjectGetSelect ()
 Returns the selected object.
void DisplayError (Error err, CObject *pObj, float time=10.0f)
void DisplayError (Error err, Math::Vector goal, float height=15.0f, float dist=60.0f, float time=10.0f)
void SetInputBinding (InputSlot slot, InputBinding binding)
 Management of input bindings.
const InputBindingGetInputBinding (InputSlot slot)
void SetJoyAxisBinding (JoyAxisSlot slot, JoyAxisBinding binding)
 Management of joystick axis bindings.
const JoyAxisBindingGetJoyAxisBinding (JoyAxisSlot slot)
void SetJoystickDeadzone (float zone)
 Management of joystick deadzone.
float GetJoystickDeadzone ()

Protected Member Functions

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 Convert ()
 Conversion of units.
void CreateScene (bool soluce, bool fixScene, bool resetObject)
 Creates the whole scene.
Math::Vector LookatPoint (Math::Vector eye, float angleH, float angleV, float length)
 Calculates the point of arrival of the camera.
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.
CObjectDetectObject (Math::Point pos)
 Detects the object aimed by the mouse.
void ChangeCamera ()
 Change the mode of the camera.
void RemoteCamera (float pan, float zoom, float rTime)
 Panned with the camera if a button is pressed.
void KeyCamera (EventType event, unsigned int key)
 Remote control the camera using the arrow keys.
void AbortMovie ()
 Cancels the current movie.
bool IsSelectable (CObject *pObj)
 Indicates whether an object is selectable.
void SelectOneObject (CObject *pObj, bool displayError=true)
 Selects an object, without attending to deselect the rest.
void HelpObject ()
 Displays help for an object.
bool DeselectObject ()
 Deselects the selected object.
void DeleteAllObjects ()
 Quickly removes all objects.
void UpdateInfoText ()
 Updates the text information.
CObjectSearchObject (ObjectType type)
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 (char *cmd)
 Executes a command.
bool TestGadgetQuantity (int rank)
 Updates the number of unnecessary objects.
void UpdateSpeedLabel ()

Protected Attributes

CApplicationm_app
CEventQueuem_eventQueue
CMainMoviem_movie
Gfx::CEnginem_engine
Gfx::CParticlem_particle
Gfx::CWaterm_water
Gfx::CCloudm_cloud
Gfx::CLightningm_lightning
Gfx::CPlanetm_planet
Gfx::CLightManagerm_lightMan
Gfx::CTerrainm_terrain
Gfx::CCameram_camera
Ui::CMainDialogm_dialog
Ui::CMainShortm_short
Ui::CMainMapm_map
Ui::CInterfacem_interface
Ui::CDisplayTextm_displayText
Ui::CDisplayInfom_displayInfo
CSoundInterfacem_sound
CPauseManagerm_pause
InputBinding m_inputBindings [INPUT_SLOT_MAX]
 Bindings for user inputs.
JoyAxisBinding m_joyAxisBindings [JOY_AXIS_SLOT_MAX]
float m_joystickDeadzone
Math::Vector m_keyMotion
 Motion vector set by keyboard or joystick buttons.
Math::Vector m_joyMotion
 Motion vector set by joystick axes.
float m_time
float m_gameTime
float m_checkEndTime
float m_winDelay
float m_lostDelay
bool m_fixScene
bool m_base
Math::Point m_lastMousePos
CObjectm_selectObject
Phase m_phase
int m_cameraRank
Gfx::Color m_color
bool m_freePhoto
bool m_cmdEdit
bool m_showPos
bool m_selectInsect
bool m_showSoluce
bool m_showAll
bool m_cheatRadar
bool m_shortCut
std::string m_audioTrack
bool m_audioRepeat
std::string m_satcomTrack
bool m_satcomRepeat
std::string m_editorTrack
bool m_editorRepeat
int m_delayWriteMessage
int m_movieInfoIndex
CObjectm_controller
bool m_beginObject
bool m_terrainGenerate
bool m_terrainInitTextures
bool m_terrainInit
bool m_terrainCreate
int m_version
bool m_retroStyle
bool m_immediatSatCom
bool m_beginSatCom
bool m_lockedSatCom
bool m_movieLock
bool m_satComLock
bool m_editLock
bool m_editFull
bool m_hilite
bool m_trainerPilot
bool m_suspend
bool m_friendAim
bool m_resetCreate
bool m_mapShow
bool m_mapImage
char m_mapFilename [100]
Math::Point m_tooltipPos
std::string m_tooltipName
float m_tooltipTime
char m_infoFilename [SATCOM_MAX][100]
CObjectm_infoObject
int m_infoIndex
int m_infoPos [SATCOM_MAX]
int m_infoUsed
char m_title [100]
char m_resume [500]
char m_scriptName [100]
char m_scriptFile [100]
int m_endingWinRank
int m_endingLostRank
bool m_winTerminate
bool m_exitAfterMission
float m_fontSize
Math::Point m_windowPos
Math::Point m_windowDim
bool m_IOPublic
Math::Point m_IOPos
Math::Point m_IODim
NewScriptName m_newScriptName [MAXNEWSCRIPTNAME]
float m_cameraPan
float m_cameraZoom
EventType m_visitLast
CObjectm_visitObject
CObjectm_visitArrow
float m_visitTime
float m_visitParticle
Math::Vector m_visitPos
Math::Vector m_visitPosArrow
int m_endTakeTotal
EndTake m_endTake [10]
long m_endTakeResearch
bool m_endTakeNever
float m_endTakeWinDelay
float m_endTakeLostDelay
int m_audioChangeTotal
AudioChange m_audioChange [10]
int m_obligatoryTotal
char m_obligatoryToken [100][20]
int m_prohibitedTotal
char m_prohibitedToken [100][20]
std::string m_gamerName
int m_freeBuild
int m_freeResearch
Error m_missionResult
ShowLimit m_showLimit [MAXSHOWLIMIT]
Gfx::Color m_colorRefBot
Gfx::Color m_colorNewBot
Gfx::Color m_colorRefAlien
Gfx::Color m_colorNewAlien
Gfx::Color m_colorRefGreen
Gfx::Color m_colorNewGreen
Gfx::Color m_colorRefWater
Gfx::Color m_colorNewWater
float m_colorShiftWater
std::string m_oldLocale

Additional Inherited Members

- Static Public Member Functions inherited from CSingleton< CRobotMain >
static CRobotMainGetInstance ()
static CRobotMainGetInstancePointer ()
static bool IsCreated ()
- Static Protected Attributes inherited from CSingleton< CRobotMain >
static CRobotMainm_instance = nullptr

Member Function Documentation

void CRobotMain::SaveFileScript ( CObject obj,
const char *  filename,
int  objRank 
)

Saves all programs of the robot. If a program does not exist, the corresponding file is destroyed.

void CRobotMain::SaveOneScript ( CObject obj)

Saves all programs of the robot. If a program does not exist, the corresponding file is destroyed.

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

Beginning of the displaying of instructions. index: SATCOM_*


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