OpenMortal Apocalypse mirror
Sourceforge mirror Logo
      News | Info | Characters | Arenas | Screenshots | Forums | Download  
Developer: Making of | Character-HOWTO | AI Design | Submit a Character
Documentation: Main Page | Modules | Class Hierarchy | Class List | File List

SState Struct Reference
[Game logic (frontend + backend connection)]

SState aggregates all the state variables of OpenMortal that do not belong to the backend. More...

#include <State.h>

List of all members.

Public Types

enum  TGameMode {
enum  TTeamModeEnum { Team_ONE_VS_ONE, Team_GOOD_VS_EVIL, Team_CUSTOM }

Public Member Functions

 SState ()
void Load ()
void Save ()
void ToggleFullscreen ()
void SetLanguage (const char *a_pcLanguage)
void SetServer (const char *a_pcServer)

Public Attributes

enum SState::TGameMode m_enGameMode
bool m_bQuitFlag
const char * m_pcArgv0
int m_iNumPlayers
enum SState::TTeamModeEnum m_enTeamMode
int m_iTeamSize
int m_bTeamMultiselect
int m_iGameTime
int m_iHitPoints
int m_iGameSpeed
bool m_bFullscreen
int m_iChannels
int m_iMixingRate
int m_iMixingBits
int m_iMusicVolume
int m_iSoundVolume
int m_aiPlayerKeys [MAXPLAYERS][9]
char m_acLanguage [10]
int m_iLanguageCode
char m_acLatestServer [256]
bool m_bServer
char m_acNick [128]

Detailed Description

SState aggregates all the state variables of OpenMortal that do not belong to the backend.

This includes transient variables such as the current game mode (e.g. SStade::IN_DEMO) and configuration variables (such as the keyboard layout).

SState is a singlular object, and is accessed with a global pointer, g_oState. All other frontend modules access the state through this object. The state is made persistent through it's methods, Load() and Save(). Load() is called on program start, Save() is called when the program exits.

The State is the way the CMenu communicate with the rest of the system. For example, if the user chooses "Quit" from the menu, the m_bQuitFlag is set to true, and the program will react accordingly.

The state's most important properties are:

Member Enumeration Documentation

enum SState::TGameMode

Enumeration values:
IN_DEMO  The game is currently in "demo" mode: displaying the intro screens, etc.
IN_SINGLE  The game is in single-player mode.
IN_MULTI  The game is in multi-player mode.
IN_NETWORK  There is against a network opponent in progress.
IN_CHAT  The user is on MortalNet.

enum SState::TTeamModeEnum

Enumeration values:

Constructor & Destructor Documentation

SState::SState  ) 

Member Function Documentation

void SState::Load  ) 

void SState::Save  ) 

void SState::SetLanguage const char *  a_pcLanguage  ) 

void SState::SetServer const char *  a_pcServer  ) 

void SState::ToggleFullscreen  ) 

Member Data Documentation

char SState::m_acLanguage[10]

char SState::m_acLatestServer[256]

char SState::m_acNick[128]

int SState::m_aiPlayerKeys[MAXPLAYERS][9]

bool SState::m_bFullscreen

bool SState::m_bQuitFlag

bool SState::m_bServer

int SState::m_bTeamMultiselect

enum SState::TGameMode SState::m_enGameMode

enum SState::TTeamModeEnum SState::m_enTeamMode

int SState::m_iChannels

int SState::m_iGameSpeed

int SState::m_iGameTime

int SState::m_iHitPoints

int SState::m_iLanguageCode

int SState::m_iMixingBits

int SState::m_iMixingRate

int SState::m_iMusicVolume

int SState::m_iNumPlayers

int SState::m_iSoundVolume

int SState::m_iTeamSize

const char* SState::m_pcArgv0

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