Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
GameState Class Reference

#include <GameState.h>

Inherits SubsystemInterface, and Snapshot.

Public Member Functions

 GameState (void)
 
virtual ~GameState (void)
 
virtual void init (void)
 
virtual void reset (void)
 
virtual void update (void)
 
SaveCode saveGame (AsciiString filename, UnicodeString desc, SaveFileType saveType, SnapshotType which=SNAPSHOT_SAVELOAD)
 save a game
 
SaveCode missionSave (void)
 do a in between mission save
 
SaveCode loadGame (AvailableGameInfo gameInfo)
 load a save file
 
SaveGameInfogetSaveGameInfo (void)
 
void addPostProcessSnapshot (Snapshot *snapshot)
 add snapshot to post process laod
 
Bool doesSaveGameExist (AsciiString filename)
 does the save file exist
 
void populateSaveGameListbox (GameWindow *listbox, SaveLoadLayoutType layoutType)
 populate listbox with available save games
 
void getSaveGameInfoFromFile (AsciiString filename, SaveGameInfo *saveGameInfo)
 get save game info from file
 
void friend_xferSaveDataForCRC (Xfer *xfer, SnapshotType which)
 This should only be called to DeepCRC sanity checking.
 
Bool isInLoadGame (void)
 
void setPristineMapName (AsciiString name)
 
AsciiString getPristineMapName (void)
 
AsciiString getSaveDirectory () const
 
AsciiString getFilePathInSaveDirectory (const AsciiString &leaf) const
 
Bool isInSaveDirectory (const AsciiString &path) const
 
AsciiString realMapPathToPortableMapPath (const AsciiString &in) const
 
AsciiString portableMapPathToRealMapPath (const AsciiString &in) const
 
AsciiString getMapLeafName (const AsciiString &in) const
 
- Public Member Functions inherited from SubsystemInterface
 SubsystemInterface ()
 
virtual ~SubsystemInterface ()
 
virtual void postProcessLoad ()
 
virtual void draw (void)
 
void UPDATE (void)
 
void DRAW (void)
 
AsciiString getName (void)
 
void setName (AsciiString name)
 
- Public Member Functions inherited from Snapshot
 Snapshot (void)
 
 ~Snapshot (void)
 

Protected Member Functions

virtual void crc (Xfer *xfer)
 run the "light" crc check on this data structure
 
virtual void xfer (Xfer *xfer)
 
virtual void loadPostProcess (void)
 

Additional Inherited Members

- Protected Attributes inherited from SubsystemInterface
AsciiString m_name
 

Detailed Description

Definition at line 151 of file GameState.h.

Constructor & Destructor Documentation

◆ GameState()

GameState::GameState ( void )

Definition at line 281 of file GameState.cpp.

◆ ~GameState()

GameState::~GameState ( void )
virtual

Definition at line 291 of file GameState.cpp.

Member Function Documentation

◆ addPostProcessSnapshot()

void GameState::addPostProcessSnapshot ( Snapshot * snapshot)

add snapshot to post process laod

Add a snapshot to the post process list for later

Definition at line 1487 of file GameState.cpp.

◆ crc()

virtual void GameState::crc ( Xfer * xfer)
inlineprotectedvirtual

run the "light" crc check on this data structure

Implements Snapshot.

Definition at line 201 of file GameState.h.

◆ doesSaveGameExist()

Bool GameState::doesSaveGameExist ( AsciiString filename)

does the save file exist

Does the save game file exist

Definition at line 939 of file GameState.cpp.

◆ friend_xferSaveDataForCRC()

void GameState::friend_xferSaveDataForCRC ( Xfer * xfer,
SnapshotType which )

This should only be called to DeepCRC sanity checking.

Save game to xfer or load game using xfer

Definition at line 1322 of file GameState.cpp.

◆ getFilePathInSaveDirectory()

AsciiString GameState::getFilePathInSaveDirectory ( const AsciiString & leaf) const

Definition at line 776 of file GameState.cpp.

◆ getMapLeafName()

AsciiString GameState::getMapLeafName ( const AsciiString & in) const

Definition at line 790 of file GameState.cpp.

◆ getPristineMapName()

AsciiString GameState::getPristineMapName ( void )
inline

Definition at line 187 of file GameState.h.

◆ getSaveDirectory()

AsciiString GameState::getSaveDirectory ( ) const

Definition at line 768 of file GameState.cpp.

◆ getSaveGameInfo()

SaveGameInfo * GameState::getSaveGameInfo ( void )
inline

Definition at line 172 of file GameState.h.

◆ getSaveGameInfoFromFile()

void GameState::getSaveGameInfoFromFile ( AsciiString filename,
SaveGameInfo * saveGameInfo )

get save game info from file

Get save game info from the filename specified

Definition at line 972 of file GameState.cpp.

◆ init()

void GameState::init ( void )
virtual

Init the game state subsystem

Implements SubsystemInterface.

Definition at line 309 of file GameState.cpp.

◆ isInLoadGame()

Bool GameState::isInLoadGame ( void )
inline

Definition at line 184 of file GameState.h.

◆ isInSaveDirectory()

Bool GameState::isInSaveDirectory ( const AsciiString & path) const

Definition at line 784 of file GameState.cpp.

◆ loadGame()

SaveCode GameState::loadGame ( AvailableGameInfo gameInfo)

load a save file

Load the save game pointed to by filename

Definition at line 652 of file GameState.cpp.

◆ loadPostProcess()

virtual void GameState::loadPostProcess ( void )
inlineprotectedvirtual

post process phase for loading save games. All save systems have their xfer run using XferLoad mode, and then all systems each have their post process run

Implements Snapshot.

Definition at line 203 of file GameState.h.

◆ missionSave()

SaveCode GameState::missionSave ( void )

do a in between mission save

A mission save

Definition at line 630 of file GameState.cpp.

◆ populateSaveGameListbox()

void GameState::populateSaveGameListbox ( GameWindow * listbox,
SaveLoadLayoutType layoutType )

populate listbox with available save games

Populate the listbox passed in with a list of the save games present on the hard drive

Definition at line 1151 of file GameState.cpp.

◆ portableMapPathToRealMapPath()

AsciiString GameState::portableMapPathToRealMapPath ( const AsciiString & in) const

Definition at line 902 of file GameState.cpp.

◆ realMapPathToPortableMapPath()

AsciiString GameState::realMapPathToPortableMapPath ( const AsciiString & in) const

Definition at line 872 of file GameState.cpp.

◆ reset()

void GameState::reset ( void )
virtual

Reset

Implements SubsystemInterface.

Definition at line 346 of file GameState.cpp.

◆ saveGame()

SaveCode GameState::saveGame ( AsciiString filename,
UnicodeString desc,
SaveFileType saveType,
SnapshotType which = SNAPSHOT_SAVELOAD )

save a game

Save the current state of the engine in a save file NOTE: filename is a filename only

Definition at line 542 of file GameState.cpp.

◆ setPristineMapName()

void GameState::setPristineMapName ( AsciiString name)
inline

Definition at line 186 of file GameState.h.

◆ update()

virtual void GameState::update ( void )
inlinevirtual
  • Update methods are the place to do system per frame processing. You should call the system update once each time through the game loop to service the system.
    • Note that currently the GameClient and GameLogic will be updating at different rates where the logic is running real time, and the client will adjust how many loops can be done during one server time slice in order to improve performance on low end machines.

Implements SubsystemInterface.

Definition at line 163 of file GameState.h.

◆ xfer()

void GameState::xfer ( Xfer * xfer)
protectedvirtual

Xfer method for the game state itself Version Info: 1: Initial version 2: Added save file type and mission map name (regular save vs automatic mission save)

Implements Snapshot.

Definition at line 1563 of file GameState.cpp.


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