PRooFPS-dd Dev Doc 1.0
PRooFPS-dd Developer Documentation
Loading...
Searching...
No Matches
proofps_dd::TeamRoundGameMode Class Reference

In Team Round Game mode, players are grouped into teams, same way as in Team DeathMatch. More...

Detailed Description

In Team Round Game mode, players are grouped into teams, same way as in Team DeathMatch.

However, the game mode features rounds.

Unlike in deathmatch-style game modes, here players cannot respawn immediately after being killed: isRespawnAllowedAfterDie() return false. Instead, they have to wait for the next round to start.

Each round ends when any of the teams loses all its players.

The team reaching the predefined round win limit earlier wins the game, or the team with the most round wins if time limit is reached. The round win limit is configured by the server.

Note that although setFragLimit() functionality is inherited from parent classes, it is not used.

Each round has different states, governed by RoundStateFSM.

Note that when the game is won, RoundStateFSM might stay in Prepare or Play states, for example if game won reason is game time limit reached (getTimeLimitSecs()).

Definition at line 677 of file GameMode.h.

#include <GameMode.h>

+ Inheritance diagram for proofps_dd::TeamRoundGameMode:

Classes

class  RoundStateFSM
 

Public Member Functions

virtual ~TeamRoundGameMode ()
 
 TeamRoundGameMode (const TeamRoundGameMode &)=delete
 
TeamRoundGameModeoperator= (const TeamRoundGameMode &)=delete
 
 TeamRoundGameMode (TeamRoundGameMode &&)=delete
 
TeamRoundGameMode && operator= (TeamRoundGameMode &&)=delete
 
virtual void fetchConfig (PGEcfgProfiles &cfgProfiles, pge_network::PgeINetwork &network) override
 Fetches configuration from the given PGEcfgProfiles instance.
 
virtual void restartWithoutRemovingPlayers (pge_network::PgeINetwork &network, const proofps_dd::GameRestartType_KeepPlayers &eRestartType) override
 Resets winning time and winning condition, also zeros out relevant members of PlayersTableRow for all players.
 
virtual bool serverCheckAndUpdateWinningConditions (pge_network::PgeINetwork &network) override
 Altering parent class implementation by checking won rounds per team, instead of frag limit.
 
virtual void serverTickUpdateWinningConditions (pge_network::PgeINetwork &network) override
 Extending original implementation with focus on RoundStateFSM.
 
virtual void clientTickUpdateWinningConditions (pge_network::PgeINetwork &network) override
 Extending original implementation with focus on RoundStateFSM.
 
virtual bool addPlayer (const Player &player, pge_network::PgeINetwork &network) override
 Extending parent class implementation by rejecting player if team id is not in [0-2] range.
 
virtual bool removePlayer (const Player &player, pge_network::PgeINetwork &network) override
 Removes data for the specified player.
 
virtual bool isRoundBased () const override
 
virtual bool isRespawnAllowedAfterDie () const override
 
virtual bool isPlayerMovementAllowed () const override
 
unsigned int getRoundWinLimit () const
 
void setRoundWinLimit (unsigned int limit)
 Set the round win limit for the game.
 
unsigned int getTeamRoundWins (unsigned int iTeamId) const
 
RoundStateFSMgetFSM ()
 
const RoundStateFSMgetFSM () const
 
bool hasJustTransitionedTo_RoundPrepareState_InThisTick () const
 Returns if RoundStateFSM has been just detected as transitioned to Prepare state in this tick i.e.
 
bool hasJustTransitionedTo_RoundPlayState_InThisTick () const
 Returns if RoundStateFSM has been just detected as transitioned to Play state in this tick i.e.
 
bool hasJustTransitionedTo_RoundWaitForResetState_InThisTick () const
 Returns if RoundStateFSM has been just detected as transitioned to WaitForReset state in this tick i.e.
 
bool hasCurrentRoundJustBeenWon_InThisTick () const
 
bool clientHandleGameRoundStateFromServer (pge_network::PgeINetwork &network, const MsgGameRoundStateFromServer &msgRoundState)
 
bool serverSendRoundStateToClient (pge_network::PgeINetwork &network, const pge_network::PgeNetworkConnectionHandle &connHandle)
 
bool serverSendRoundStateToClients (pge_network::PgeINetwork &network)
 
- Public Member Functions inherited from proofps_dd::TeamDeathMatchMode
virtual ~TeamDeathMatchMode ()
 
 TeamDeathMatchMode (const TeamDeathMatchMode &)=delete
 
TeamDeathMatchModeoperator= (const TeamDeathMatchMode &)=delete
 
 TeamDeathMatchMode (TeamDeathMatchMode &&)=delete
 
TeamDeathMatchMode && operator= (TeamDeathMatchMode &&)=delete
 
virtual bool updatePlayer (const Player &player, pge_network::PgeINetwork &network) override
 Extending parent class implementation by rejecting player if team id is not in [0-2] range.
 
virtual bool isTeamBasedGame () const override
 Derived class shall return false if it is non-team-based game, otherwise true.
 
virtual bool isPlayerAllowedForGameplay (const Player &player) const override
 Extending parent class implementation by rejecting player if team id is 0.
 
int getTeamFrags (unsigned int iTeamId) const
 
unsigned int getTeamPlayersCount (unsigned int iTeamId) const
 
unsigned int getAliveTeamPlayersCount (unsigned int iTeamId) const
 
- Public Member Functions inherited from proofps_dd::DeathMatchMode
virtual ~DeathMatchMode ()
 
 DeathMatchMode (const DeathMatchMode &)=delete
 
DeathMatchModeoperator= (const DeathMatchMode &)=delete
 
 DeathMatchMode (DeathMatchMode &&)=delete
 
DeathMatchMode && operator= (DeathMatchMode &&)=delete
 
unsigned int getFragLimit () const
 
void setFragLimit (unsigned int limit)
 Set the frag limit for the game.
 
- Public Member Functions inherited from proofps_dd::GameMode
CConsole & getConsole () const
 
virtual ~GameMode ()
 
GameModeType getGameModeType () const
 
const char * getGameModeTypeName () const
 
const std::chrono::time_point< std::chrono::steady_clock > & getResetTime () const
 
unsigned int getTimeLimitSecs () const
 
void setTimeLimitSecs (unsigned int secs)
 Set the time limit for the game.
 
unsigned int getTimeRemainingMillisecs () const
 
void clientUpdateTimeRemainingMillisecs (const unsigned int &nRemMillisecs, pge_network::PgeINetwork &network)
 Updates the remaining time on client side, based on the remaining time received from server.
 
virtual void restart (pge_network::PgeINetwork &network)
 Similar to restartWithoutRemovingPlayers() but it also removes all players from this GameMode instance.
 
void clientReceiveAndUpdateWinningConditions (pge_network::PgeINetwork &network, bool bGameSessionWon)
 Handles server's update about current game session goal, e.g.
 
bool isGameWon () const
 Returns the current game session win state i.e.
 
bool wasGameWonAlreadyInPreviousTick () const
 Returns if the current game session was already won in the previous tick.
 
bool hasJustBeenWonThisTick () const
 Returns if the current game session has been just detected as won in this tick i.e.
 
const std::chrono::time_point< std::chrono::steady_clock > & getWinTime () const
 
const std::list< PlayersTableRow > & getPlayersTable () const
 
const std::map< pge_network::PgeNetworkConnectionHandle, proofps_dd::Player > & getExternalPlayersContainer () const
 
bool renamePlayer (const std::string &sOldName, const std::string &sNewName)
 Renames the player.
 
unsigned int getSpectatorModePlayersCount () const
 
void text (PR00FsUltimateRenderingEngine &pure, const std::string &s, int x, int y) const
 

Static Public Member Functions

static std::unique_ptr< TeamRoundGameModecreateGameMode (const std::map< pge_network::PgeNetworkConnectionHandle, proofps_dd::Player > &mapPlayers)
 Used by GameMode::createGameMode(), this way we don't need to be friend with GameMode.
 
- Static Public Member Functions inherited from proofps_dd::TeamDeathMatchMode
static const PureColor & getTeamColor (unsigned int iTeamId)
 
static std::unique_ptr< TeamDeathMatchModecreateGameMode (const std::map< pge_network::PgeNetworkConnectionHandle, proofps_dd::Player > &mapPlayers)
 Used by GameMode::createGameMode(), this way we don't need to be friend with GameMode.
 
- Static Public Member Functions inherited from proofps_dd::DeathMatchMode
static std::unique_ptr< DeathMatchModecreateGameMode (const std::map< pge_network::PgeNetworkConnectionHandle, proofps_dd::Player > &mapPlayers)
 Used by GameMode::createGameMode(), this way we don't need to be friend with GameMode.
 
- Static Public Member Functions inherited from proofps_dd::GameMode
static const char * getLoggerModuleName ()
 
static GameModecreateGameMode (GameModeType gm, const std::map< pge_network::PgeNetworkConnectionHandle, proofps_dd::Player > &mapPlayers)
 Similar to singleton design pattern, there is always maximum one instance.
 
static GameModegetGameMode ()
 
static bool isTeamBasedGame (GameModeType gm)
 
static bool isRoundBased (GameModeType gm)
 
static const char * getGameModeTypeName (GameModeType gm)
 
static GameModeType getGameModeTypeFromConfig (PGEcfgProfiles &cfgProfiles)
 
static const char * getRank (const PlayersTableRow &row)
 

Protected Member Functions

 TeamRoundGameMode (const std::map< pge_network::PgeNetworkConnectionHandle, proofps_dd::Player > &mapPlayers)
 
virtual bool serverSendGameSessionStateToClient (pge_network::PgeINetwork &network, const pge_network::PgeNetworkConnectionHandle &connHandle) override
 Extends original behavior by also sending out MsgGameRoundStateFromServer to the specific client.
 
virtual bool serverSendGameSessionStateToClients (pge_network::PgeINetwork &network, const proofps_dd::GameRestartType_KeepPlayers &eRestartType) override
 Extends original behavior by also sending out MsgGameRoundStateFromServer to all clients.
 
void setTeamRoundWins (unsigned int iTeamId, unsigned int nRoundWins)
 
- Protected Member Functions inherited from proofps_dd::TeamDeathMatchMode
 TeamDeathMatchMode (const std::map< pge_network::PgeNetworkConnectionHandle, proofps_dd::Player > &mapPlayers)
 
- Protected Member Functions inherited from proofps_dd::DeathMatchMode
 DeathMatchMode (const std::map< pge_network::PgeNetworkConnectionHandle, proofps_dd::Player > &mapPlayers)
 
- Protected Member Functions inherited from proofps_dd::GameMode
 GameMode (GameModeType gm, const std::map< pge_network::PgeNetworkConnectionHandle, proofps_dd::Player > &mapPlayers)
 
 GameMode (const GameMode &)=delete
 
GameModeoperator= (const GameMode &)=delete
 
 GameMode (GameMode &&)=delete
 
GameMode && operator= (GameMode &&)=delete
 
void handleEventGameWon (pge_network::PgeINetwork &network)
 

Private Attributes

unsigned int m_nRoundWinLimit { GameMode::nSvRgmRoundWinLimitDef }
 
unsigned int m_nTeam1RoundWins { 0 }
 
unsigned int m_nTeam2RoundWins { 0 }
 
RoundStateFSM m_fsm
 
RoundStateFSM::RoundState m_oldFsmState { RoundStateFSM::RoundState::Prepare }
 
bool m_bFsmStateTransitionHasJustHappenedThisTick_Sticky { true }
 Sticky because it requires explicit clear at the end of a tick.
 
bool m_bFirstTick { true }
 
bool m_bCurrentRoundHasJustBeenWon_Sticky { false }
 Sticky because it requires explicit clear at the end of a tick.
 

Friends

class GameModeTest
 

Additional Inherited Members

- Static Public Attributes inherited from proofps_dd::TeamDeathMatchMode
static constexpr char * szCvarSvTdmFriendlyFire = "sv_tdm_friendlyfire"
 
- Static Public Attributes inherited from proofps_dd::GameMode
static constexpr char * szCvarSvGamemode = "sv_gamemode"
 
static constexpr char * szCvarSvGmTimeLimit = "sv_gm_timelimit_secs"
 
static constexpr char * szCvarSvDmFragLimit = "sv_dm_fraglimit"
 
static constexpr char * szCvarSvRgmRoundWinLimit = "sv_rgm_roundwinlimit"
 
static constexpr int nSvGmTimeLimitSecsDef = 0
 
static constexpr int nSvGmTimeLimitSecsMin = 0
 
static constexpr int nSvGmTimeLimitSecsMax = 60 * 60 * 24
 
static constexpr int nSvDmFragLimitDef = 10
 
static constexpr int nSvDmFragLimitMin = 0
 
static constexpr int nSvDmFragLimitMax = 999
 
static constexpr int nSvRgmRoundWinLimitDef = 5
 
static constexpr int nSvRgmRoundWinLimitMin = 1
 
static constexpr int nSvRgmRoundWinLimitMax = 999
 
- Protected Attributes inherited from proofps_dd::DeathMatchMode
unsigned int m_nFragLimit {}
 
- Protected Attributes inherited from proofps_dd::GameMode
std::chrono::time_point< std::chrono::steady_clock > m_timeWin
 
std::list< PlayersTableRowm_players
 
const std::map< pge_network::PgeNetworkConnectionHandle, proofps_dd::Player > & m_mapPlayersExternal
 
bool m_bWon { false }
 
bool m_bWonPrevious { false }
 
GameModeType m_gameModeType
 

Constructor & Destructor Documentation

◆ ~TeamRoundGameMode()

proofps_dd::TeamRoundGameMode::~TeamRoundGameMode ( )
virtual

Definition at line 1173 of file GameMode.cpp.

◆ TeamRoundGameMode() [1/3]

proofps_dd::TeamRoundGameMode::TeamRoundGameMode ( const TeamRoundGameMode & )
delete

◆ TeamRoundGameMode() [2/3]

proofps_dd::TeamRoundGameMode::TeamRoundGameMode ( TeamRoundGameMode && )
delete

◆ TeamRoundGameMode() [3/3]

proofps_dd::TeamRoundGameMode::TeamRoundGameMode ( const std::map< pge_network::PgeNetworkConnectionHandle, proofps_dd::Player > & mapPlayers)
protected

Definition at line 1471 of file GameMode.cpp.

Member Function Documentation

◆ addPlayer()

bool proofps_dd::TeamRoundGameMode::addPlayer ( const Player & player,
pge_network::PgeINetwork & network )
overridevirtual

Extending parent class implementation by rejecting player if team id is not in [0-2] range.

Reimplemented from proofps_dd::TeamDeathMatchMode.

Definition at line 1302 of file GameMode.cpp.

◆ clientHandleGameRoundStateFromServer()

bool proofps_dd::TeamRoundGameMode::clientHandleGameRoundStateFromServer ( pge_network::PgeINetwork & network,
const MsgGameRoundStateFromServer & msgRoundState )

Definition at line 1397 of file GameMode.cpp.

◆ clientTickUpdateWinningConditions()

void proofps_dd::TeamRoundGameMode::clientTickUpdateWinningConditions ( pge_network::PgeINetwork & network)
overridevirtual

Extending original implementation with focus on RoundStateFSM.

See original GameMode::clientTickUpdateWinningConditions() documentation for details.

This function is for client instance only.

Reimplemented from proofps_dd::GameMode.

Definition at line 1292 of file GameMode.cpp.

◆ createGameMode()

std::unique_ptr< proofps_dd::TeamRoundGameMode > proofps_dd::TeamRoundGameMode::createGameMode ( const std::map< pge_network::PgeNetworkConnectionHandle, proofps_dd::Player > & mapPlayers)
static

Used by GameMode::createGameMode(), this way we don't need to be friend with GameMode.

The previous GameMode instance is destroyed automatically. See GameMode::createGameMode() for more details.

Returns
Smart pointer to the created TeamRoundGameMode instance.

Definition at line 1166 of file GameMode.cpp.

◆ fetchConfig()

void proofps_dd::TeamRoundGameMode::fetchConfig ( PGEcfgProfiles & cfgProfiles,
pge_network::PgeINetwork & network )
overridevirtual

Fetches configuration from the given PGEcfgProfiles instance.

Derived class shall extend this function by overriding and calling this parent implementation from the specialized implementation.

For now it does not do validation, as all validations are currently implemented in the Config class. TODO: on the long run, validation should be also done, by proper planning and implementing an IConfigHandler interface, as described in the comment above.

Parameters
cfgProfilesThe current user config profile from where we can fetch value of GameMode-specific CVARs.
networkPGE network instance to be used to know if we are server or client.

Reimplemented from proofps_dd::DeathMatchMode.

Definition at line 1177 of file GameMode.cpp.

◆ getFSM() [1/2]

proofps_dd::TeamRoundGameMode::RoundStateFSM & proofps_dd::TeamRoundGameMode::getFSM ( )

Definition at line 1367 of file GameMode.cpp.

◆ getFSM() [2/2]

const proofps_dd::TeamRoundGameMode::RoundStateFSM & proofps_dd::TeamRoundGameMode::getFSM ( ) const

Definition at line 1372 of file GameMode.cpp.

◆ getRoundWinLimit()

unsigned int proofps_dd::TeamRoundGameMode::getRoundWinLimit ( ) const
Returns
Configured round win limit previously set by setRoundWinLimit().

Definition at line 1343 of file GameMode.cpp.

◆ getTeamRoundWins()

unsigned int proofps_dd::TeamRoundGameMode::getTeamRoundWins ( unsigned int iTeamId) const
Parameters
iTeamIdTeam ID for which team we want to get the total number of won rounds.
Returns
Total number of won rounds for the given team. Always 0 when iTeamId is 0.

Definition at line 1361 of file GameMode.cpp.

◆ hasCurrentRoundJustBeenWon_InThisTick()

bool proofps_dd::TeamRoundGameMode::hasCurrentRoundJustBeenWon_InThisTick ( ) const

Definition at line 1392 of file GameMode.cpp.

◆ hasJustTransitionedTo_RoundPlayState_InThisTick()

bool proofps_dd::TeamRoundGameMode::hasJustTransitionedTo_RoundPlayState_InThisTick ( ) const

Returns if RoundStateFSM has been just detected as transitioned to Play state in this tick i.e.

it was in different state in the previous tick.

This function is the recommended way for both server and client instances to check for and handle the change.

It is true only for a short period of time slice which can be 1 tick or 1 frame, depending on how often your game instance invokes either serverCheckAndUpdateWinningConditions() or clientTickUpdateWinningConditions().

The idea is the following:

Definition at line 1382 of file GameMode.cpp.

◆ hasJustTransitionedTo_RoundPrepareState_InThisTick()

bool proofps_dd::TeamRoundGameMode::hasJustTransitionedTo_RoundPrepareState_InThisTick ( ) const

Returns if RoundStateFSM has been just detected as transitioned to Prepare state in this tick i.e.

it was in different state in the previous tick.

This function is the recommended way for both server and client instances to check for and handle the change to a new round.

It is true only for a short period of time slice which can be 1 tick or 1 frame, depending on how often your game instance invokes either serverCheckAndUpdateWinningConditions() or clientTickUpdateWinningConditions().

The idea is the following:

Definition at line 1377 of file GameMode.cpp.

◆ hasJustTransitionedTo_RoundWaitForResetState_InThisTick()

bool proofps_dd::TeamRoundGameMode::hasJustTransitionedTo_RoundWaitForResetState_InThisTick ( ) const

Returns if RoundStateFSM has been just detected as transitioned to WaitForReset state in this tick i.e.

it was in different state in the previous tick.

This function is the recommended way for both server and client instances to check for and handle round end.

It is true only for a short period of time slice which can be 1 tick or 1 frame, depending on how often your game instance invokes either serverCheckAndUpdateWinningConditions() or clientTickUpdateWinningConditions().

The idea is the following:

Definition at line 1387 of file GameMode.cpp.

◆ isPlayerMovementAllowed()

bool proofps_dd::TeamRoundGameMode::isPlayerMovementAllowed ( ) const
overridevirtual
Returns
True if player movement is allowed, false otherwise.

Reimplemented from proofps_dd::GameMode.

Definition at line 1338 of file GameMode.cpp.

◆ isRespawnAllowedAfterDie()

bool proofps_dd::TeamRoundGameMode::isRespawnAllowedAfterDie ( ) const
overridevirtual

Reimplemented from proofps_dd::DeathMatchMode.

Definition at line 1333 of file GameMode.cpp.

◆ isRoundBased()

bool proofps_dd::TeamRoundGameMode::isRoundBased ( ) const
overridevirtual

Reimplemented from proofps_dd::DeathMatchMode.

Definition at line 1328 of file GameMode.cpp.

◆ operator=() [1/2]

TeamRoundGameMode & proofps_dd::TeamRoundGameMode::operator= ( const TeamRoundGameMode & )
delete

◆ operator=() [2/2]

TeamRoundGameMode && proofps_dd::TeamRoundGameMode::operator= ( TeamRoundGameMode && )
delete

◆ removePlayer()

bool proofps_dd::TeamRoundGameMode::removePlayer ( const Player & player,
pge_network::PgeINetwork & network )
overridevirtual

Removes data for the specified player.

Fails if player with same cannot be found.

Does not evaluate winning conditions, since once a game is won, it stays won even if all players are removed, until explicit call to restart().

Returns
True if removed the existing player, false otherwise.

Reimplemented from proofps_dd::DeathMatchMode.

Definition at line 1315 of file GameMode.cpp.

◆ restartWithoutRemovingPlayers()

void proofps_dd::TeamRoundGameMode::restartWithoutRemovingPlayers ( pge_network::PgeINetwork & network,
const proofps_dd::GameRestartType_KeepPlayers & eRestartType )
overridevirtual

Resets winning time and winning condition, also zeros out relevant members of PlayersTableRow for all players.

It is recommended to first invoke updatePlayer() for all players with zeroed values and then call this.

Used by both server and clients: clients invoke it upon receiving MsgGameSessionStateFromServer.

Parameters
networkPGE network instance to be used to send out MsgGameSessionStateFromServer to clients.
eRestartTypePlayers stats are defaulted depending on restart type. Cannot be GameRestartType_KeepPlayers::None.

Reimplemented from proofps_dd::GameMode.

Definition at line 1185 of file GameMode.cpp.

◆ serverCheckAndUpdateWinningConditions()

bool proofps_dd::TeamRoundGameMode::serverCheckAndUpdateWinningConditions ( pge_network::PgeINetwork & network)
overridevirtual

Altering parent class implementation by checking won rounds per team, instead of frag limit.

Frag limit is not considered at all. Time limit is still considered.

This also drives RoundStateFSM. Note that when the game is won, RoundStateFSM might stay in Prepare or Play states, for example if game won reason is game time limit reached (getTimeLimitSecs()).

Reimplemented from proofps_dd::TeamDeathMatchMode.

Definition at line 1198 of file GameMode.cpp.

◆ serverSendGameSessionStateToClient()

bool proofps_dd::TeamRoundGameMode::serverSendGameSessionStateToClient ( pge_network::PgeINetwork & network,
const pge_network::PgeNetworkConnectionHandle & connHandle )
overrideprotectedvirtual

Extends original behavior by also sending out MsgGameRoundStateFromServer to the specific client.

Reimplemented from proofps_dd::GameMode.

Definition at line 1479 of file GameMode.cpp.

◆ serverSendGameSessionStateToClients()

bool proofps_dd::TeamRoundGameMode::serverSendGameSessionStateToClients ( pge_network::PgeINetwork & network,
const proofps_dd::GameRestartType_KeepPlayers & eRestartType )
overrideprotectedvirtual

Extends original behavior by also sending out MsgGameRoundStateFromServer to all clients.

Reimplemented from proofps_dd::GameMode.

Definition at line 1488 of file GameMode.cpp.

◆ serverSendRoundStateToClient()

bool proofps_dd::TeamRoundGameMode::serverSendRoundStateToClient ( pge_network::PgeINetwork & network,
const pge_network::PgeNetworkConnectionHandle & connHandle )

Definition at line 1427 of file GameMode.cpp.

◆ serverSendRoundStateToClients()

bool proofps_dd::TeamRoundGameMode::serverSendRoundStateToClients ( pge_network::PgeINetwork & network)

Definition at line 1447 of file GameMode.cpp.

◆ serverTickUpdateWinningConditions()

void proofps_dd::TeamRoundGameMode::serverTickUpdateWinningConditions ( pge_network::PgeINetwork & network)
overridevirtual

Extending original implementation with focus on RoundStateFSM.

See original GameMode::serverTickUpdateWinningConditions() documentation for details.

This function is for server instance only.

Reimplemented from proofps_dd::GameMode.

Definition at line 1285 of file GameMode.cpp.

◆ setRoundWinLimit()

void proofps_dd::TeamRoundGameMode::setRoundWinLimit ( unsigned int limit)

Set the round win limit for the game.

If the round win limit is reached, the winner is the team which reached it, even if time limit is not yet reached or there is no time limit set.

Note: behavior is unspecified if this value is changed on-the-fly during a game. For now, please also call restart() explicitly.

Parameters
limitThe round win limit. Must be positive value.

Definition at line 1348 of file GameMode.cpp.

◆ setTeamRoundWins()

void proofps_dd::TeamRoundGameMode::setTeamRoundWins ( unsigned int iTeamId,
unsigned int nRoundWins )
protected

Definition at line 1497 of file GameMode.cpp.

Friends And Related Symbol Documentation

◆ GameModeTest

friend class GameModeTest
friend

Definition at line 955 of file GameMode.h.

Member Data Documentation

◆ m_bCurrentRoundHasJustBeenWon_Sticky

bool proofps_dd::TeamRoundGameMode::m_bCurrentRoundHasJustBeenWon_Sticky { false }
private

Sticky because it requires explicit clear at the end of a tick.

Definition at line 968 of file GameMode.h.

◆ m_bFirstTick

bool proofps_dd::TeamRoundGameMode::m_bFirstTick { true }
private

Definition at line 967 of file GameMode.h.

◆ m_bFsmStateTransitionHasJustHappenedThisTick_Sticky

bool proofps_dd::TeamRoundGameMode::m_bFsmStateTransitionHasJustHappenedThisTick_Sticky { true }
private

Sticky because it requires explicit clear at the end of a tick.

Definition at line 966 of file GameMode.h.

◆ m_fsm

RoundStateFSM proofps_dd::TeamRoundGameMode::m_fsm
private

Definition at line 964 of file GameMode.h.

◆ m_nRoundWinLimit

unsigned int proofps_dd::TeamRoundGameMode::m_nRoundWinLimit { GameMode::nSvRgmRoundWinLimitDef }
private

Definition at line 961 of file GameMode.h.

◆ m_nTeam1RoundWins

unsigned int proofps_dd::TeamRoundGameMode::m_nTeam1RoundWins { 0 }
private

Definition at line 962 of file GameMode.h.

◆ m_nTeam2RoundWins

unsigned int proofps_dd::TeamRoundGameMode::m_nTeam2RoundWins { 0 }
private

Definition at line 963 of file GameMode.h.

◆ m_oldFsmState

RoundStateFSM::RoundState proofps_dd::TeamRoundGameMode::m_oldFsmState { RoundStateFSM::RoundState::Prepare }
private

Definition at line 965 of file GameMode.h.


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