#include <C4RoundResults.h>
Public Types | |
enum | NetResult { NR_None =0 , NR_LeagueOK , NR_LeagueError , NR_NetError } |
Public Member Functions | |
C4RoundResults ()=default | |
~C4RoundResults () | |
void | Clear () |
void | Init () |
void | CompileFunc (StdCompiler *pComp) |
void | EvaluateGame () |
void | EvaluateLeague (const char *szResultMsg, bool fSuccess, const C4RoundResultsPlayers &rLeagueInfo) |
void | EvaluatePlayer (C4Player *pPlr) |
void | EvaluateNetwork (NetResult eResult, const char *szResultsString) |
void | AddCustomEvaluationString (const char *szCustomString, int32_t idPlayer) |
void | HideSettlementScore (bool fHide=true) |
bool | SettlementScoreIsHidden () |
void | SetLeaguePerformance (int32_t iNewPerf, int32_t idPlayer=0) |
int32_t | GetLeaguePerformance (int32_t idPlayer=0) const |
StdCopyStrBuf | GetStatistics () const |
const C4RoundResultsPlayers & | GetPlayers () const |
const char * | GetCustomEvaluationStrings () const |
NetResult | GetNetResult () const |
const char * | GetNetResultString () const |
bool | HasNetResult () const |
bool | Load (C4Group &hGroup, const char *szFilename=C4CFN_RoundResults) |
bool | Save (C4Group &hGroup, const char *szFilename=C4CFN_RoundResults) |
const C4IDList & | GetGoals () const |
const C4IDList & | GetFulfilledGoals () const |
Static Public Member Functions | |
static void | EvaluateGoals (C4IDList &GoalList, C4IDList &FulfilledGoalList, int32_t iPlayerNumber) |
Definition at line 124 of file C4RoundResults.h.
Enumerator | |
---|---|
NR_None | |
NR_LeagueOK | |
NR_LeagueError | |
NR_NetError |
Definition at line 127 of file C4RoundResults.h.
|
default |
|
inline |
Definition at line 156 of file C4RoundResults.h.
References Clear().
void C4RoundResults::AddCustomEvaluationString | ( | const char * | szCustomString, |
int32_t | idPlayer | ||
) |
Definition at line 357 of file C4RoundResults.cpp.
References C4RoundResultsPlayer::AddCustomEvaluationString(), StdStrBuf::Append(), StdStrBuf::AppendChar(), C4RoundResultsPlayers::GetCreateByID(), and StdStrBuf::getLength().
void C4RoundResults::Clear | ( | ) |
Definition at line 241 of file C4RoundResults.cpp.
References C4RoundResultsPlayers::Clear(), StdStrBuf::Clear(), C4IDList::Clear(), and NR_None.
Referenced by C4Game::Clear(), CompileFunc(), Load(), and ~C4RoundResults().
void C4RoundResults::CompileFunc | ( | StdCompiler * | pComp | ) |
Definition at line 261 of file C4RoundResults.cpp.
References C4Game::C4S, Clear(), Game, C4Scenario::Game, StdCompiler::isDeserializer(), C4SGame::IsMelee(), mkNamingAdapt(), NR_LeagueError, NR_LeagueOK, NR_NetError, NR_None, and StdCompiler::Value().
void C4RoundResults::EvaluateGame | ( | ) |
Definition at line 304 of file C4RoundResults.cpp.
References C4VNull, C4PropList::Call(), DebugLogF(), EvaluateGoals(), Game, C4AulScriptEngine::GetPropList(), NO_OWNER, C4Player::Number, PSF_CollectStatistics, ScriptEngine, C4Game::Time, and C4JSONSerializationError::what().
Referenced by C4Game::Evaluate().
|
static |
Definition at line 282 of file C4RoundResults.cpp.
References C4D_Goal, C4Id2Def(), C4PropList::Call(), C4IDList::Clear(), Definitions, C4ObjectList::Find(), C4ObjectList::GetListID(), C4DefList::ID2Def(), Objects, PSF_IsFulfilled, and C4IDList::SetIDCount().
Referenced by C4MainMenu::ActivateGoals(), and EvaluateGame().
void C4RoundResults::EvaluateLeague | ( | const char * | szResultMsg, |
bool | fSuccess, | ||
const C4RoundResultsPlayers & | rLeagueInfo | ||
) |
Definition at line 336 of file C4RoundResults.cpp.
References C4RoundResultsPlayer::EvaluateLeague(), EvaluateNetwork(), Game, C4RoundResultsPlayers::GetByIndex(), C4RoundResultsPlayers::GetCreateByID(), C4RoundResultsPlayer::GetID(), NR_LeagueError, NR_LeagueOK, and C4Game::RoundResults.
Referenced by C4Network2Players::HandlePacket(), and C4Network2::LeagueEnd().
void C4RoundResults::EvaluateNetwork | ( | C4RoundResults::NetResult | eNetResult, |
const char * | szResultsString | ||
) |
Definition at line 326 of file C4RoundResults.cpp.
References StdStrBuf::Clear(), StdStrBuf::Copy(), and HasNetResult().
Referenced by EvaluateLeague(), C4MainMenu::MenuCommand(), and C4Network2::OnClientDisconnect().
void C4RoundResults::EvaluatePlayer | ( | C4Player * | pPlr | ) |
Definition at line 349 of file C4RoundResults.cpp.
References C4RoundResultsPlayer::EvaluatePlayer(), C4RoundResultsPlayers::GetCreateByID(), and C4Player::ID.
Referenced by C4Player::Evaluate(), and C4PlayerList::Remove().
|
inline |
Definition at line 197 of file C4RoundResults.h.
References StdStrBuf::getData().
Referenced by C4GameOverDlg::C4GameOverDlg().
|
inline |
Definition at line 206 of file C4RoundResults.h.
Referenced by C4GameOverDlg::C4GameOverDlg().
|
inline |
Definition at line 205 of file C4RoundResults.h.
Referenced by C4GameOverDlg::C4GameOverDlg().
int32_t C4RoundResults::GetLeaguePerformance | ( | int32_t | idPlayer = 0 | ) | const |
Definition at line 397 of file C4RoundResults.cpp.
References C4RoundResultsPlayers::GetByID().
|
inline |
Definition at line 198 of file C4RoundResults.h.
|
inline |
Definition at line 199 of file C4RoundResults.h.
References StdStrBuf::getData().
Referenced by C4GameOverDlg::C4GameOverDlg().
|
inline |
|
inline |
Definition at line 194 of file C4RoundResults.h.
|
inline |
Definition at line 200 of file C4RoundResults.h.
References NR_None.
Referenced by C4GameOverDlg::C4GameOverDlg(), and EvaluateNetwork().
void C4RoundResults::HideSettlementScore | ( | bool | fHide = true | ) |
Definition at line 373 of file C4RoundResults.cpp.
void C4RoundResults::Init | ( | ) |
Definition at line 254 of file C4RoundResults.cpp.
References C4Game::C4S, Game, C4Scenario::Game, and C4SGame::IsMelee().
bool C4RoundResults::Load | ( | C4Group & | hGroup, |
const char * | szFilename = C4CFN_RoundResults |
||
) |
Definition at line 407 of file C4RoundResults.cpp.
References Clear(), C4Group::LoadEntryString(), and mkNamingAdapt().
bool C4RoundResults::Save | ( | C4Group & | hGroup, |
const char * | szFilename = C4CFN_RoundResults |
||
) |
Definition at line 420 of file C4RoundResults.cpp.
References C4Group::Add(), C4Group::DeleteEntry(), StdStrBuf::getLength(), and mkNamingAdapt().
void C4RoundResults::SetLeaguePerformance | ( | int32_t | iNewPerf, |
int32_t | idPlayer = 0 |
||
) |
Definition at line 383 of file C4RoundResults.cpp.
References C4RoundResultsPlayers::GetCreateByID(), and C4RoundResultsPlayer::SetLeaguePerformance().
bool C4RoundResults::SettlementScoreIsHidden | ( | ) |
Definition at line 378 of file C4RoundResults.cpp.