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

#include <GameInfo.h>

Inherited by GameSpyGameSlot, GameSpyGameSlot, and LANGameSlot.

Public Member Functions

 GameSlot ()
 
virtual void reset ()
 
void setAccept (void)
 Accept the current options.
 
void unAccept (void)
 Unaccept (options changed, etc)
 
Bool isAccepted (void) const
 Non-human slots are always accepted.
 
void setMapAvailability (Bool hasMap)
 Set whether the slot has the map.
 
Bool hasMap (void) const
 Non-human slots always have the map.
 
void setState (SlotState state, UnicodeString name=UnicodeString::TheEmptyString, UnsignedInt IP=0)
 Set the slot's state (human, AI, open, etc)
 
SlotState getState (void) const
 Get the slot state.
 
void setColor (Int color)
 
Int getColor (void) const
 
void setStartPos (Int startPos)
 
Int getStartPos (void) const
 
void setPlayerTemplate (Int playerTemplate)
 
Int getPlayerTemplate (void) const
 
void setTeamNumber (Int teamNumber)
 
Int getTeamNumber (void) const
 
void setName (UnicodeString name)
 
UnicodeString getName (void) const
 
void setIP (UnsignedInt IP)
 
UnsignedInt getIP (void) const
 
void setPort (UnsignedShort port)
 
UnsignedShort getPort (void) const
 
void setNATBehavior (FirewallHelperClass::FirewallBehaviorType NATBehavior)
 
FirewallHelperClass::FirewallBehaviorType getNATBehavior () const
 
void saveOffOriginalInfo (void)
 
Int getOriginalPlayerTemplate (void) const
 
Int getOriginalColor (void) const
 
Int getOriginalStartPos (void) const
 
Int getApparentPlayerTemplate (void) const
 
Int getApparentColor (void) const
 
Int getApparentStartPos (void) const
 
UnicodeString getApparentPlayerTemplateDisplayName (void) const
 
Bool isHuman (void) const
 Is this slot occupied by a human player?
 
Bool isOccupied (void) const
 Is this slot occupied (by a human or an AI)?
 
Bool isAI (void) const
 Is this slot occupied by an AI?
 
Bool isPlayer (AsciiString userName) const
 Does this slot contain the given user?
 
Bool isPlayer (UnicodeString userName) const
 Does this slot contain the given user?
 
Bool isPlayer (UnsignedInt ip) const
 Is this slot at this IP?
 
Bool isOpen (void) const
 
void setLastFrameInGame (UnsignedInt frame)
 
void markAsDisconnected (void)
 
UnsignedInt lastFrameInGame (void) const
 
Bool disconnected (void) const
 
void mute (Bool isMuted)
 
Bool isMuted (void) const
 

Protected Attributes

SlotState m_state
 
Bool m_isAccepted
 
Bool m_hasMap
 
Bool m_isMuted
 
Int m_color
 color, or -1 for random
 
Int m_startPos
 start position, or -1 for random
 
Int m_playerTemplate
 PlayerTemplate.
 
Int m_teamNumber
 alliance, -1 for none
 
Int m_origColor
 color, or -1 for random
 
Int m_origStartPos
 start position, or -1 for random
 
Int m_origPlayerTemplate
 PlayerTemplate.
 
UnicodeString m_name
 Only valid for human players.
 
UnsignedInt m_IP
 Only valid for human players in LAN/WOL.
 
UnsignedShort m_port
 Only valid for human players in LAN/WOL.
 
FirewallHelperClass::FirewallBehaviorType m_NATBehavior
 The NAT behavior for this slot's player.
 
UnsignedInt m_lastFrameInGame
 
Bool m_disconnected
 

Detailed Description

GameSlot class - maintains information about the contents of a game slot. This persists throughout the game.

Definition at line 60 of file GameInfo.h.

Constructor & Destructor Documentation

◆ GameSlot()

GameSlot::GameSlot ( )

Definition at line 59 of file GameInfo.cpp.

Member Function Documentation

◆ disconnected()

Bool GameSlot::disconnected ( void ) const
inline

Definition at line 127 of file GameInfo.h.

◆ getApparentColor()

Int GameSlot::getApparentColor ( void ) const

Definition at line 160 of file GameInfo.cpp.

◆ getApparentPlayerTemplate()

Int GameSlot::getApparentPlayerTemplate ( void ) const

Definition at line 150 of file GameInfo.cpp.

◆ getApparentPlayerTemplateDisplayName()

UnicodeString GameSlot::getApparentPlayerTemplateDisplayName ( void ) const

Definition at line 130 of file GameInfo.cpp.

◆ getApparentStartPos()

Int GameSlot::getApparentStartPos ( void ) const

Definition at line 173 of file GameInfo.cpp.

◆ getColor()

Int GameSlot::getColor ( void ) const
inline

Definition at line 79 of file GameInfo.h.

◆ getIP()

UnsignedInt GameSlot::getIP ( void ) const
inline

Definition at line 98 of file GameInfo.h.

◆ getName()

UnicodeString GameSlot::getName ( void ) const
inline

Definition at line 95 of file GameInfo.h.

◆ getNATBehavior()

FirewallHelperClass::FirewallBehaviorType GameSlot::getNATBehavior ( ) const
inline

Definition at line 104 of file GameInfo.h.

◆ getOriginalColor()

Int GameSlot::getOriginalColor ( void ) const
inline

Definition at line 108 of file GameInfo.h.

◆ getOriginalPlayerTemplate()

Int GameSlot::getOriginalPlayerTemplate ( void ) const
inline

Definition at line 107 of file GameInfo.h.

◆ getOriginalStartPos()

Int GameSlot::getOriginalStartPos ( void ) const
inline

Definition at line 109 of file GameInfo.h.

◆ getPlayerTemplate()

Int GameSlot::getPlayerTemplate ( void ) const
inline

Definition at line 89 of file GameInfo.h.

◆ getPort()

UnsignedShort GameSlot::getPort ( void ) const
inline

Definition at line 101 of file GameInfo.h.

◆ getStartPos()

Int GameSlot::getStartPos ( void ) const
inline

Definition at line 82 of file GameInfo.h.

◆ getState()

SlotState GameSlot::getState ( void ) const
inline

Get the slot state.

Definition at line 76 of file GameInfo.h.

◆ getTeamNumber()

Int GameSlot::getTeamNumber ( void ) const
inline

Definition at line 92 of file GameInfo.h.

◆ hasMap()

Bool GameSlot::hasMap ( void ) const
inline

Non-human slots always have the map.

Definition at line 71 of file GameInfo.h.

◆ isAccepted()

Bool GameSlot::isAccepted ( void ) const
inline

Non-human slots are always accepted.

Definition at line 68 of file GameInfo.h.

◆ isAI()

Bool GameSlot::isAI ( void ) const

Is this slot occupied by an AI?

Definition at line 260 of file GameInfo.cpp.

◆ isHuman()

Bool GameSlot::isHuman ( void ) const

Is this slot occupied by a human player?

Definition at line 250 of file GameInfo.cpp.

◆ isMuted()

Bool GameSlot::isMuted ( void ) const
inline

Definition at line 130 of file GameInfo.h.

◆ isOccupied()

Bool GameSlot::isOccupied ( void ) const

Is this slot occupied (by a human or an AI)?

Definition at line 255 of file GameInfo.cpp.

◆ isOpen()

Bool GameSlot::isOpen ( void ) const

Definition at line 282 of file GameInfo.cpp.

◆ isPlayer() [1/3]

Bool GameSlot::isPlayer ( AsciiString userName) const

Does this slot contain the given user?

Definition at line 265 of file GameInfo.cpp.

◆ isPlayer() [2/3]

Bool GameSlot::isPlayer ( UnicodeString userName) const

Does this slot contain the given user?

Definition at line 272 of file GameInfo.cpp.

◆ isPlayer() [3/3]

Bool GameSlot::isPlayer ( UnsignedInt ip) const

Is this slot at this IP?

Definition at line 277 of file GameInfo.cpp.

◆ lastFrameInGame()

UnsignedInt GameSlot::lastFrameInGame ( void ) const
inline

Definition at line 126 of file GameInfo.h.

◆ markAsDisconnected()

void GameSlot::markAsDisconnected ( void )
inline

Definition at line 125 of file GameInfo.h.

◆ mute()

void GameSlot::mute ( Bool isMuted)
inline

Definition at line 129 of file GameInfo.h.

◆ reset()

void GameSlot::reset ( )
virtual

Definition at line 64 of file GameInfo.cpp.

◆ saveOffOriginalInfo()

void GameSlot::saveOffOriginalInfo ( void )

Definition at line 83 of file GameInfo.cpp.

◆ setAccept()

void GameSlot::setAccept ( void )
inline

Accept the current options.

Definition at line 66 of file GameInfo.h.

◆ setColor()

void GameSlot::setColor ( Int color)
inline

Definition at line 78 of file GameInfo.h.

◆ setIP()

void GameSlot::setIP ( UnsignedInt IP)
inline

Definition at line 97 of file GameInfo.h.

◆ setLastFrameInGame()

void GameSlot::setLastFrameInGame ( UnsignedInt frame)
inline

Definition at line 124 of file GameInfo.h.

◆ setMapAvailability()

void GameSlot::setMapAvailability ( Bool hasMap)

Set whether the slot has the map.

Definition at line 192 of file GameInfo.cpp.

◆ setName()

void GameSlot::setName ( UnicodeString name)
inline

Definition at line 94 of file GameInfo.h.

◆ setNATBehavior()

void GameSlot::setNATBehavior ( FirewallHelperClass::FirewallBehaviorType NATBehavior)
inline

Definition at line 103 of file GameInfo.h.

◆ setPlayerTemplate()

void GameSlot::setPlayerTemplate ( Int playerTemplate)
inline

Definition at line 84 of file GameInfo.h.

◆ setPort()

void GameSlot::setPort ( UnsignedShort port)
inline

Definition at line 100 of file GameInfo.h.

◆ setStartPos()

void GameSlot::setStartPos ( Int startPos)
inline

Definition at line 81 of file GameInfo.h.

◆ setState()

void GameSlot::setState ( SlotState state,
UnicodeString name = UnicodeString::TheEmptyString,
UnsignedInt IP = 0 )

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

Definition at line 200 of file GameInfo.cpp.

◆ setTeamNumber()

void GameSlot::setTeamNumber ( Int teamNumber)
inline

Definition at line 91 of file GameInfo.h.

◆ unAccept()

void GameSlot::unAccept ( void )

Unaccept (options changed, etc)

Definition at line 184 of file GameInfo.cpp.

Member Data Documentation

◆ m_color

Int GameSlot::m_color
protected

color, or -1 for random

Definition at line 136 of file GameInfo.h.

◆ m_disconnected

Bool GameSlot::m_disconnected
protected

Definition at line 148 of file GameInfo.h.

◆ m_hasMap

Bool GameSlot::m_hasMap
protected

Definition at line 134 of file GameInfo.h.

◆ m_IP

UnsignedInt GameSlot::m_IP
protected

Only valid for human players in LAN/WOL.

Definition at line 144 of file GameInfo.h.

◆ m_isAccepted

Bool GameSlot::m_isAccepted
protected

Definition at line 133 of file GameInfo.h.

◆ m_isMuted

Bool GameSlot::m_isMuted
protected

Definition at line 135 of file GameInfo.h.

◆ m_lastFrameInGame

UnsignedInt GameSlot::m_lastFrameInGame
protected

Definition at line 147 of file GameInfo.h.

◆ m_name

UnicodeString GameSlot::m_name
protected

Only valid for human players.

Definition at line 143 of file GameInfo.h.

◆ m_NATBehavior

FirewallHelperClass::FirewallBehaviorType GameSlot::m_NATBehavior
protected

The NAT behavior for this slot's player.

Definition at line 146 of file GameInfo.h.

◆ m_origColor

Int GameSlot::m_origColor
protected

color, or -1 for random

Definition at line 140 of file GameInfo.h.

◆ m_origPlayerTemplate

Int GameSlot::m_origPlayerTemplate
protected

PlayerTemplate.

Definition at line 142 of file GameInfo.h.

◆ m_origStartPos

Int GameSlot::m_origStartPos
protected

start position, or -1 for random

Definition at line 141 of file GameInfo.h.

◆ m_playerTemplate

Int GameSlot::m_playerTemplate
protected

PlayerTemplate.

Definition at line 138 of file GameInfo.h.

◆ m_port

UnsignedShort GameSlot::m_port
protected

Only valid for human players in LAN/WOL.

Definition at line 145 of file GameInfo.h.

◆ m_startPos

Int GameSlot::m_startPos
protected

start position, or -1 for random

Definition at line 137 of file GameInfo.h.

◆ m_state

SlotState GameSlot::m_state
protected

Definition at line 132 of file GameInfo.h.

◆ m_teamNumber

Int GameSlot::m_teamNumber
protected

alliance, -1 for none

Definition at line 139 of file GameInfo.h.


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