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

#include <GameInfo.h>

Inherited by GameSpyGameInfo, GameSpyStagingRoom, LANGameInfo, ReplayGameInfo, and SkirmishGameInfo.

Public Member Functions

 GameInfo ()
 
void init (void)
 
virtual void reset (void)
 
void clearSlotList (void)
 
Int getNumPlayers (void) const
 How many players (human and AI) are in the game?
 
Int getNumNonObserverPlayers (void) const
 How many non-observer players (human and AI) are in the game?
 
Int getMaxPlayers (void) const
 How many players (human and AI) can be in the game?
 
void enterGame (void)
 Mark us as having entered the game.
 
void leaveGame (void)
 Mark us as having left the game.
 
virtual void startGame (Int gameID)
 Mark our game as started, and record the game ID.
 
void endGame (void)
 Mark us as out of game.
 
Int getGameID (void) const
 Get the game ID of the current game or the last one if we're not in game.
 
void setInGame (void)
 set the m_inGame flag
 
Bool isInGame (void) const
 Are we (in game or in game setup)? As opposed to chatting, matching, etc.
 
Bool isGameInProgress (void) const
 Is the game in progress?
 
void setGameInProgress (Bool inProgress)
 Set whether the game is in progress or not.
 
void setSlot (Int slotNum, GameSlot slotInfo)
 Set the slot state (human, open, AI, etc)
 
GameSlotgetSlot (Int slotNum)
 Get the slot.
 
const GameSlotgetConstSlot (Int slotNum) const
 Get the slot.
 
virtual Bool amIHost (void) const
 Convenience function - is the local player the game host?
 
virtual Int getLocalSlotNum (void) const
 Get the local slot number, or -1 if we're not present.
 
Int getSlotNum (AsciiString userName) const
 Get the slot number corresponding to a specific user, or -1 if he's not present.
 
void setMap (AsciiString mapName)
 Set the map to play on.
 
void setMapCRC (UnsignedInt mapCRC)
 Set the map CRC.
 
void setMapSize (UnsignedInt mapSize)
 Set the map size.
 
void setMapContentsMask (Int mask)
 Set the map contents mask (1=map,2=preview,4=map.ini)
 
AsciiString getMap (void) const
 Get the game map.
 
UnsignedInt getMapCRC (void) const
 Get the map CRC.
 
UnsignedInt getMapSize (void) const
 Get the map size.
 
Int getMapContentsMask (void) const
 Get the map contents mask.
 
void setSeed (Int seed)
 Set the random seed for the game.
 
Int getSeed (void) const
 Get the game seed.
 
Int getUseStats (void) const
 Does this game count towards gamespy stats?
 
void setUseStats (Int useStats)
 
UnsignedShort getSuperweaponRestriction (void) const
 Get any optional limits on superweapons.
 
void setSuperweaponRestriction (UnsignedShort restriction)
 Set the optional limits on superweapons.
 
const MoneygetStartingCash (void) const
 
void setStartingCash (const Money &startingCash)
 
void setSlotPointer (Int index, GameSlot *slot)
 Set the slot info pointer.
 
void setLocalIP (UnsignedInt ip)
 Set the local IP.
 
UnsignedInt getLocalIP (void) const
 Get the local IP.
 
Bool isColorTaken (Int colorIdx, Int slotToIgnore=-1) const
 
Bool isStartPositionTaken (Int positionIdx, Int slotToIgnore=-1) const
 
virtual void resetAccepted (void)
 Reset the accepted flag on all players.
 
virtual void resetStartSpots (void)
 reset the start spots for the new map.
 
virtual void adjustSlotsForMap (void)
 adjusts the slots to open and closed depending on the players in the game and the number of players the map can hold.
 
virtual void closeOpenSlots (void)
 close all slots that are currently unoccupied.
 
void setCRCInterval (Int val)
 
Int getCRCInterval (void) const
 
Bool haveWeSurrendered (void)
 
void markAsSurrendered (void)
 
Bool isSkirmish (void)
 
Bool isMultiPlayer (void)
 
Bool isSandbox (void)
 
Bool isPlayerPreorder (Int index)
 
void markPlayerAsPreorder (Int index)
 
Bool oldFactionsOnly (void) const
 
void setOldFactionsOnly (Bool oldFactionsOnly)
 

Protected Attributes

Int m_preorderMask
 
Int m_crcInterval
 
Bool m_inGame
 
Bool m_inProgress
 
Bool m_surrendered
 
Int m_gameID
 
GameSlotm_slot [MAX_SLOTS]
 
UnsignedInt m_localIP
 
AsciiString m_mapName
 
UnsignedInt m_mapCRC
 
UnsignedInt m_mapSize
 
Int m_mapMask
 
Int m_seed
 
Int m_useStats
 
Money m_startingCash
 
UnsignedShort m_superweaponRestriction
 
Bool m_oldFactionsOnly
 

Detailed Description

GameInfo class - maintains information about the game setup and the contents of its slot list hroughout the game.

Definition at line 155 of file GameInfo.h.

Constructor & Destructor Documentation

◆ GameInfo()

GameInfo::GameInfo ( )

Definition at line 289 of file GameInfo.cpp.

Member Function Documentation

◆ adjustSlotsForMap()

void GameInfo::adjustSlotsForMap ( void )
virtual

adjusts the slots to open and closed depending on the players in the game and the number of players the map can hold.

Definition at line 763 of file GameInfo.cpp.

◆ amIHost()

Bool GameInfo::amIHost ( void ) const
virtual

Convenience function - is the local player the game host?

Reimplemented in GameSpyStagingRoom.

Definition at line 504 of file GameInfo.cpp.

◆ clearSlotList()

void GameInfo::clearSlotList ( void )

Definition at line 349 of file GameInfo.cpp.

◆ closeOpenSlots()

void GameInfo::closeOpenSlots ( void )
virtual

close all slots that are currently unoccupied.

Definition at line 813 of file GameInfo.cpp.

◆ endGame()

void GameInfo::endGame ( void )

Mark us as out of game.

Definition at line 416 of file GameInfo.cpp.

◆ enterGame()

void GameInfo::enterGame ( void )

Mark us as having entered the game.

Definition at line 394 of file GameInfo.cpp.

◆ getConstSlot()

const GameSlot * GameInfo::getConstSlot ( Int slotNum) const

Get the slot.

Definition at line 460 of file GameInfo.cpp.

◆ getCRCInterval()

Int GameInfo::getCRCInterval ( void ) const
inline

Definition at line 221 of file GameInfo.h.

◆ getGameID()

Int GameInfo::getGameID ( void ) const
inline

Get the game ID of the current game or the last one if we're not in game.

Definition at line 262 of file GameInfo.h.

◆ getLocalIP()

UnsignedInt GameInfo::getLocalIP ( void ) const
inline

Get the local IP.

Definition at line 208 of file GameInfo.h.

◆ getLocalSlotNum()

Int GameInfo::getLocalSlotNum ( void ) const
virtual

Get the local slot number, or -1 if we're not present.

Reimplemented in GameSpyGameInfo, GameSpyStagingRoom, and LANGameInfo.

Definition at line 469 of file GameInfo.cpp.

◆ getMap()

AsciiString GameInfo::getMap ( void ) const
inline

Get the game map.

Definition at line 263 of file GameInfo.h.

◆ getMapContentsMask()

Int GameInfo::getMapContentsMask ( void ) const
inline

Get the map contents mask.

Definition at line 266 of file GameInfo.h.

◆ getMapCRC()

UnsignedInt GameInfo::getMapCRC ( void ) const
inline

Get the map CRC.

Definition at line 264 of file GameInfo.h.

◆ getMapSize()

UnsignedInt GameInfo::getMapSize ( void ) const
inline

Get the map size.

Definition at line 265 of file GameInfo.h.

◆ getMaxPlayers()

Int GameInfo::getMaxPlayers ( void ) const

How many players (human and AI) can be in the game?

Definition at line 380 of file GameInfo.cpp.

◆ getNumNonObserverPlayers()

Int GameInfo::getNumNonObserverPlayers ( void ) const

How many non-observer players (human and AI) are in the game?

Definition at line 369 of file GameInfo.cpp.

◆ getNumPlayers()

Int GameInfo::getNumPlayers ( void ) const

How many players (human and AI) are in the game?

Definition at line 358 of file GameInfo.cpp.

◆ getSeed()

Int GameInfo::getSeed ( void ) const
inline

Get the game seed.

Definition at line 267 of file GameInfo.h.

◆ getSlot()

GameSlot * GameInfo::getSlot ( Int slotNum)

Get the slot.

Definition at line 451 of file GameInfo.cpp.

◆ getSlotNum()

Int GameInfo::getSlotNum ( AsciiString userName) const

Get the slot number corresponding to a specific user, or -1 if he's not present.

Definition at line 487 of file GameInfo.cpp.

◆ getStartingCash()

const Money & GameInfo::getStartingCash ( void ) const
inline

Definition at line 274 of file GameInfo.h.

◆ getSuperweaponRestriction()

UnsignedShort GameInfo::getSuperweaponRestriction ( void ) const
inline

Get any optional limits on superweapons.

Definition at line 275 of file GameInfo.h.

◆ getUseStats()

Int GameInfo::getUseStats ( void ) const
inline

Does this game count towards gamespy stats?

Definition at line 272 of file GameInfo.h.

◆ haveWeSurrendered()

Bool GameInfo::haveWeSurrendered ( void )
inline

Definition at line 223 of file GameInfo.h.

◆ init()

void GameInfo::init ( void )

Definition at line 298 of file GameInfo.cpp.

◆ isColorTaken()

Bool GameInfo::isColorTaken ( Int colorIdx,
Int slotToIgnore = -1 ) const

Definition at line 712 of file GameInfo.cpp.

◆ isGameInProgress()

Bool GameInfo::isGameInProgress ( void ) const
inline

Is the game in progress?

Definition at line 270 of file GameInfo.h.

◆ isInGame()

Bool GameInfo::isInGame ( void ) const
inline

Are we (in game or in game setup)? As opposed to chatting, matching, etc.

Definition at line 268 of file GameInfo.h.

◆ isMultiPlayer()

Bool GameInfo::isMultiPlayer ( void )

Definition at line 864 of file GameInfo.cpp.

◆ isPlayerPreorder()

Bool GameInfo::isPlayerPreorder ( Int index)

Definition at line 335 of file GameInfo.cpp.

◆ isSandbox()

Bool GameInfo::isSandbox ( void )

Definition at line 878 of file GameInfo.cpp.

◆ isSkirmish()

Bool GameInfo::isSkirmish ( void )

Definition at line 842 of file GameInfo.cpp.

◆ isStartPositionTaken()

Bool GameInfo::isStartPositionTaken ( Int positionIdx,
Int slotToIgnore = -1 ) const

Definition at line 723 of file GameInfo.cpp.

◆ leaveGame()

void GameInfo::leaveGame ( void )

Mark us as having left the game.

Definition at line 402 of file GameInfo.cpp.

◆ markAsSurrendered()

void GameInfo::markAsSurrendered ( void )
inline

Definition at line 224 of file GameInfo.h.

◆ markPlayerAsPreorder()

void GameInfo::markPlayerAsPreorder ( Int index)

Definition at line 342 of file GameInfo.cpp.

◆ oldFactionsOnly()

Bool GameInfo::oldFactionsOnly ( void ) const
inline

Definition at line 276 of file GameInfo.h.

◆ reset()

void GameInfo::reset ( void )
virtual

Reimplemented in GameSpyStagingRoom.

Definition at line 303 of file GameInfo.cpp.

◆ resetAccepted()

void GameInfo::resetAccepted ( void )
virtual

Reset the accepted flag on all players.

Reimplemented in GameSpyGameInfo, GameSpyStagingRoom, and LANGameInfo.

Definition at line 734 of file GameInfo.cpp.

◆ resetStartSpots()

void GameInfo::resetStartSpots ( void )
virtual

reset the start spots for the new map.

Definition at line 747 of file GameInfo.cpp.

◆ setCRCInterval()

void GameInfo::setCRCInterval ( Int val)
inline

Definition at line 220 of file GameInfo.h.

◆ setGameInProgress()

void GameInfo::setGameInProgress ( Bool inProgress)
inline

Set whether the game is in progress or not.

Definition at line 271 of file GameInfo.h.

◆ setInGame()

void GameInfo::setInGame ( void )
inline

set the m_inGame flag

Definition at line 269 of file GameInfo.h.

◆ setLocalIP()

void GameInfo::setLocalIP ( UnsignedInt ip)
inline

Set the local IP.

Definition at line 207 of file GameInfo.h.

◆ setMap()

void GameInfo::setMap ( AsciiString mapName)

Set the map to play on.

Definition at line 513 of file GameInfo.cpp.

◆ setMapContentsMask()

void GameInfo::setMapContentsMask ( Int mask)

Set the map contents mask (1=map,2=preview,4=map.ini)

Definition at line 613 of file GameInfo.cpp.

◆ setMapCRC()

void GameInfo::setMapCRC ( UnsignedInt mapCRC)

Set the map CRC.

Definition at line 618 of file GameInfo.cpp.

◆ setMapSize()

void GameInfo::setMapSize ( UnsignedInt mapSize)

Set the map size.

Definition at line 658 of file GameInfo.cpp.

◆ setOldFactionsOnly()

void GameInfo::setOldFactionsOnly ( Bool oldFactionsOnly)
inline

Definition at line 277 of file GameInfo.h.

◆ setSeed()

void GameInfo::setSeed ( Int seed)

Set the random seed for the game.

Definition at line 689 of file GameInfo.cpp.

◆ setSlot()

void GameInfo::setSlot ( Int slotNum,
GameSlot slotInfo )

Set the slot state (human, open, AI, etc)

Definition at line 423 of file GameInfo.cpp.

◆ setSlotPointer()

void GameInfo::setSlotPointer ( Int index,
GameSlot * slot )

Set the slot info pointer.

Definition at line 694 of file GameInfo.cpp.

◆ setStartingCash()

void GameInfo::setStartingCash ( const Money & startingCash)

Definition at line 707 of file GameInfo.cpp.

◆ setSuperweaponRestriction()

void GameInfo::setSuperweaponRestriction ( UnsignedShort restriction)

Set the optional limits on superweapons.

Definition at line 702 of file GameInfo.cpp.

◆ setUseStats()

void GameInfo::setUseStats ( Int useStats)
inline

Definition at line 273 of file GameInfo.h.

◆ startGame()

void GameInfo::startGame ( Int gameID)
virtual

Mark our game as started, and record the game ID.

Reimplemented in GameSpyGameInfo, and GameSpyStagingRoom.

Definition at line 408 of file GameInfo.cpp.

Member Data Documentation

◆ m_crcInterval

Int GameInfo::m_crcInterval
protected

Definition at line 238 of file GameInfo.h.

◆ m_gameID

Int GameInfo::m_gameID
protected

Definition at line 242 of file GameInfo.h.

◆ m_inGame

Bool GameInfo::m_inGame
protected

Definition at line 239 of file GameInfo.h.

◆ m_inProgress

Bool GameInfo::m_inProgress
protected

Definition at line 240 of file GameInfo.h.

◆ m_localIP

UnsignedInt GameInfo::m_localIP
protected

Definition at line 245 of file GameInfo.h.

◆ m_mapCRC

UnsignedInt GameInfo::m_mapCRC
protected

Definition at line 249 of file GameInfo.h.

◆ m_mapMask

Int GameInfo::m_mapMask
protected

Definition at line 251 of file GameInfo.h.

◆ m_mapName

AsciiString GameInfo::m_mapName
protected

Definition at line 248 of file GameInfo.h.

◆ m_mapSize

UnsignedInt GameInfo::m_mapSize
protected

Definition at line 250 of file GameInfo.h.

◆ m_oldFactionsOnly

Bool GameInfo::m_oldFactionsOnly
protected

Definition at line 256 of file GameInfo.h.

◆ m_preorderMask

Int GameInfo::m_preorderMask
protected

Definition at line 237 of file GameInfo.h.

◆ m_seed

Int GameInfo::m_seed
protected

Definition at line 252 of file GameInfo.h.

◆ m_slot

GameSlot* GameInfo::m_slot[MAX_SLOTS]
protected

Definition at line 243 of file GameInfo.h.

◆ m_startingCash

Money GameInfo::m_startingCash
protected

Definition at line 254 of file GameInfo.h.

◆ m_superweaponRestriction

UnsignedShort GameInfo::m_superweaponRestriction
protected

Definition at line 255 of file GameInfo.h.

◆ m_surrendered

Bool GameInfo::m_surrendered
protected

Definition at line 241 of file GameInfo.h.

◆ m_useStats

Int GameInfo::m_useStats
protected

Definition at line 253 of file GameInfo.h.


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