#include <C4PlayerList.h>
Public Member Functions | |
C4PlayerList () | |
~C4PlayerList () | |
void | Default () |
void | Clear () |
void | Execute () |
void | DenumeratePointers () |
void | ClearPointers (C4Object *pObj) |
int | GetCount () const |
int | GetCount (C4PlayerType eType) const |
int | GetIndex (C4Player *pPlr) const |
int | GetCountNotEliminated () const |
int | AverageScoreGain () const |
C4Player * | Get (int iPlayer) const |
C4Player * | GetByIndex (int iIndex) const |
C4Player * | GetByIndex (int iIndex, C4PlayerType eType) const |
C4Player * | GetByName (const char *szName, int iExcluding=NO_OWNER) const |
C4Player * | GetLocalByIndex (int iIndex) const |
C4Player * | GetAtClient (int iClient, int iIndex=0) const |
C4Player * | GetAtClient (const char *szName, int iIndex=0) const |
C4Player * | GetAtRemoteClient (int iIndex=0) const |
C4Player * | GetByInfoID (int iInfoID) const |
C4Player * | Join (const char *szFilename, bool fScenarioInit, int iAtClient, const char *szAtClientName, class C4PlayerInfo *pInfo, C4ValueNumbers *) |
void | JoinNew (const char *szFilename) |
bool | CtrlJoin (const class C4Network2ResCore &ResCore, int iClientID, int idPlayerInfo) |
bool | FileInUse (const char *szFilename) const |
bool | Retire (C4Player *pPlr) |
bool | Evaluate () |
bool | Save (bool fSaveLocalOnly) |
bool | Save (C4Group &hGroup, bool fStoreTiny, const C4PlayerInfoList &rStoreList) |
bool | Remove (int iPlayer, bool fDisonnected, bool fNoCalls) |
bool | RemoveUnjoined (int32_t iPlayer) |
bool | Remove (C4Player *pPlr, bool fDisonnected, bool fNoCalls) |
bool | RemoveAtRemoteClient (bool fDisonnected, bool fNoCalls) |
bool | RemoveLocal (bool fDisonnected, bool fNoCalls) |
bool | MouseControlTaken () const |
bool | RemoveAtClient (int iClient, bool fDisconnect) |
bool | RemoveAtClient (const char *szName, bool fDisconnect) |
bool | CtrlRemove (int iPlayer, bool fDisonnected) |
bool | CtrlRemoveAtClient (int iClient, bool fDisonnected) |
bool | CtrlRemoveAtClient (const char *szName, bool fDisonnected) |
bool | Valid (int iPlayer) const |
bool | Hostile (int iPlayer1, int iPlayer2) const |
bool | HostilityDeclared (int iPlayer1, int iPlayer2) const |
bool | PositionTaken (int iPosition) const |
int | CheckColorDw (DWORD dwColor, C4Player *pExclude) |
bool | SynchronizeLocalFiles () |
bool | HasPlayerInTeamSelection () |
Public Attributes | |
C4Player * | First |
Protected Member Functions | |
int | GetFreeNumber () const |
void | RecheckPlayerSort (C4Player *pForPlayer) |
Friends | |
class | C4Player |
Definition at line 25 of file C4PlayerList.h.
C4PlayerList::C4PlayerList | ( | ) |
Definition at line 35 of file C4PlayerList.cpp.
References Default().
C4PlayerList::~C4PlayerList | ( | ) |
Definition at line 40 of file C4PlayerList.cpp.
References Clear().
int C4PlayerList::AverageScoreGain | ( | ) | const |
Definition at line 408 of file C4PlayerList.cpp.
References First, GetCount(), iResult, and C4Player::Next.
Referenced by C4Player::Evaluate().
Definition at line 116 of file C4PlayerList.cpp.
References Abs(), First, GetBlueValue, GetGreenValue, GetRedValue, and C4Player::Next.
void C4PlayerList::Clear | ( | ) |
Definition at line 50 of file C4PlayerList.cpp.
References First, and C4Player::Next.
Referenced by C4Game::Clear(), and ~C4PlayerList().
void C4PlayerList::ClearPointers | ( | C4Object * | pObj | ) |
Definition at line 70 of file C4PlayerList.cpp.
References First, and C4Player::Next.
Referenced by C4Game::ClearPointers(), and C4Object::GrabInfo().
bool C4PlayerList::CtrlJoin | ( | const class C4Network2ResCore & | ResCore, |
int | iClientID, | ||
int | idPlayerInfo | ||
) |
bool C4PlayerList::CtrlRemove | ( | int | iPlayer, |
bool | fDisonnected | ||
) |
Definition at line 490 of file C4PlayerList.cpp.
References C4Control::Add(), CID_RemovePlr, Game, and C4Game::Input.
Referenced by CtrlRemoveAtClient().
bool C4PlayerList::CtrlRemoveAtClient | ( | const char * | szName, |
bool | fDisonnected | ||
) |
Definition at line 507 of file C4PlayerList.cpp.
References CtrlRemove(), First, C4Player::Next, and SEqual().
bool C4PlayerList::CtrlRemoveAtClient | ( | int | iClient, |
bool | fDisonnected | ||
) |
Definition at line 497 of file C4PlayerList.cpp.
References CtrlRemove(), First, and C4Player::Next.
void C4PlayerList::Default | ( | ) |
Definition at line 45 of file C4PlayerList.cpp.
References First.
Referenced by C4PlayerList(), and C4Game::Default().
void C4PlayerList::DenumeratePointers | ( | ) |
Definition at line 586 of file C4PlayerList.cpp.
References First, and C4Player::Next.
bool C4PlayerList::Evaluate | ( | ) |
Definition at line 387 of file C4PlayerList.cpp.
References First, and C4Player::Next.
Referenced by C4Game::Evaluate().
void C4PlayerList::Execute | ( | ) |
Definition at line 58 of file C4PlayerList.cpp.
References C4Player::Eliminated, C4Player::Execute(), First, C4Player::Next, Retire(), and C4Player::RetireDelay.
Referenced by C4Game::Execute().
bool C4PlayerList::FileInUse | ( | const char * | szFilename | ) | const |
Definition at line 429 of file C4PlayerList.cpp.
References _MAX_PATH_LEN, C4Game::Clients, C4Player::Filename, First, Game, GetFilename(), C4ClientList::getLocalName(), C4Network2::isEnabled(), ItemIdentical(), Network, C4Player::Next, SCopy(), SEqualNoCase(), and SetClientPrefix().
Referenced by C4MainMenu::ActivateNewPlayer(), and Join().
C4Player * C4PlayerList::Get | ( | int | iPlayer | ) | const |
Definition at line 135 of file C4PlayerList.cpp.
References First, and C4Player::Next.
Referenced by C4MainMenu::ActivateMain(), C4Viewport::AdjustPosition(), C4Object::AssignDeath(), C4Object::AssignInfo(), C4MouseControl::ButtonUpDragScript(), C4Viewport::CalculateZoom(), C4Object::ChangeDef(), ConsoleDlgProc(), C4ViewportList::CreateViewport(), C4MouseControl::DoMoveInput(), C4MainMenu::DoRefillInternal(), C4Viewport::Draw(), C4Viewport::DrawMenu(), C4Viewport::DrawPlayerStartup(), C4Viewport::EnableFoW(), C4Game::FindVisObject(), C4Object::GetDataString(), C4Object::GrabInfo(), C4Menu::HasMouse(), Hostile(), HostilityDeclared(), C4Object::Init(), C4ViewportWindow::Init(), C4Viewport::InitZoom(), C4Object::IsPlayerObject(), C4ObjectMenu::IsReadOnly(), C4Object::IsUserPlayerObject(), C4Viewport::IsViewportMenu(), C4MainMenu::MenuCommand(), C4MouseControl::Move(), C4Viewport::NextPlayer(), C4ChatInputDialog::OnChatCancel(), C4ChatInputDialog::OnChatInput(), Remove(), C4Player::SetHostility(), C4Viewport::SetOutputSize(), C4Object::SetOwner(), C4ViewportList::SortViewportsByPlayerControl(), C4MouseControl::UpdateCursorTarget(), C4Viewport::UpdateOutputSize(), and C4MouseControl::UpdateSingleSelection().
C4Player * C4PlayerList::GetAtClient | ( | const char * | szName, |
int | iIndex = 0 |
||
) | const |
Definition at line 529 of file C4PlayerList.cpp.
References First, C4Player::Next, and SEqualNoCase().
C4Player * C4PlayerList::GetAtClient | ( | int | iClient, |
int | iIndex = 0 |
||
) | const |
Definition at line 517 of file C4PlayerList.cpp.
References First, and C4Player::Next.
Referenced by C4Player::Eliminate(), C4MainMenu::MenuCommand(), C4MessageInput::ProcessCommand(), RemoveAtClient(), and C4Network2ClientList::UpdateClientActivity().
C4Player * C4PlayerList::GetAtRemoteClient | ( | int | iIndex = 0 | ) | const |
Definition at line 555 of file C4PlayerList.cpp.
References C4GameControl::ClientID(), Control, First, and C4Player::Next.
Referenced by RemoveAtRemoteClient().
C4Player * C4PlayerList::GetByIndex | ( | int | iIndex | ) | const |
Definition at line 152 of file C4PlayerList.cpp.
References First, and C4Player::Next.
Referenced by C4MainMenu::DoRefillInternal(), C4Player::DrawHostility(), and C4Game::InitGameFinal().
C4Player * C4PlayerList::GetByIndex | ( | int | iIndex, |
C4PlayerType | eType | ||
) | const |
C4Player * C4PlayerList::GetByInfoID | ( | int | iInfoID | ) | const |
Definition at line 169 of file C4PlayerList.cpp.
References First, and C4Player::Next.
Referenced by C4Team::AddPlayer().
Definition at line 420 of file C4PlayerList.cpp.
References First, C4Player::Next, and SEqual().
Referenced by C4MessageBoard::GetMessagePlayer(), and C4MessageInput::ProcessInput().
int C4PlayerList::GetCount | ( | ) | const |
Definition at line 176 of file C4PlayerList.cpp.
References First, and C4Player::Next.
Referenced by C4MainMenu::ActivateMain(), C4MainMenu::ActivateNewPlayer(), AverageScoreGain(), C4Game::InitGameFinal(), Join(), C4Game::LoadScenarioSection(), and C4Game::OnPlayerJoinFinished().
int C4PlayerList::GetCount | ( | C4PlayerType | eType | ) | const |
int C4PlayerList::GetCountNotEliminated | ( | ) | const |
Definition at line 601 of file C4PlayerList.cpp.
References First, and C4Player::Next.
Referenced by C4Game::GameOverCheck().
|
protected |
Definition at line 193 of file C4PlayerList.cpp.
References First, and C4Player::Next.
Referenced by Join().
int C4PlayerList::GetIndex | ( | C4Player * | pPlr | ) | const |
C4Player * C4PlayerList::GetLocalByIndex | ( | int | iIndex | ) | const |
Definition at line 450 of file C4PlayerList.cpp.
References First, and C4Player::Next.
Referenced by C4Game::Abort(), C4Game::ActivateMenu(), C4MainMenu::MenuCommand(), C4GameControl::PrepareInput(), C4MessageInput::ProcessCommand(), and C4MessageInput::ProcessInput().
bool C4PlayerList::HasPlayerInTeamSelection | ( | ) |
Definition at line 624 of file C4PlayerList.cpp.
References First, and C4Player::Next.
Referenced by C4Game::OnPlayerJoinFinished().
bool C4PlayerList::Hostile | ( | int | iPlayer1, |
int | iPlayer2 | ||
) | const |
Definition at line 84 of file C4PlayerList.cpp.
References Get(), C4Player::IsHostileTowards(), and C4Player::Number.
Referenced by C4Player::FindNewOwner(), and Hostile().
bool C4PlayerList::HostilityDeclared | ( | int | iPlayer1, |
int | iPlayer2 | ||
) | const |
Definition at line 96 of file C4PlayerList.cpp.
References Get(), C4Player::IsHostileTowards(), and C4Player::Number.
Referenced by C4MainMenu::MenuCommand().
C4Player * C4PlayerList::Join | ( | const char * | szFilename, |
bool | fScenarioInit, | ||
int | iAtClient, | ||
const char * | szAtClientName, | ||
class C4PlayerInfo * | pInfo, | ||
C4ValueNumbers * | numbers | ||
) |
Definition at line 275 of file C4PlayerList.cpp.
References C4Player, FileInUse(), First, Game, GetCount(), GetFreeNumber(), C4PlayerInfo::GetName(), C4Player::Init(), LoadResStr(), Log(), LogF(), C4GameParameters::MaxPlayers, C4Player::Next, C4Game::Parameters, and Remove().
Referenced by C4Game::JoinPlayer(), and C4PlayerInfoList::RecreatePlayers().
void C4PlayerList::JoinNew | ( | const char * | szFilename | ) |
Definition at line 315 of file C4PlayerList.cpp.
References C4PlayerInfoList::DoLocalNonNetworkPlayerJoin(), Game, C4Network2::isEnabled(), ItemExists(), C4Network2Players::JoinLocalPlayer(), Network, C4Game::PlayerInfos, and C4Network2::Players.
Referenced by C4MainMenu::MenuCommand(), and C4Console::PlayerJoin().
bool C4PlayerList::MouseControlTaken | ( | ) | const |
Definition at line 592 of file C4PlayerList.cpp.
References First, and C4Player::Next.
Referenced by C4Player::InitControl(), and C4Player::ToggleMouseControl().
bool C4PlayerList::PositionTaken | ( | int | iPosition | ) | const |
Definition at line 108 of file C4PlayerList.cpp.
References First, and C4Player::Next.
Referenced by C4Player::ScenarioInit().
|
protected |
Definition at line 632 of file C4PlayerList.cpp.
References First, C4Player::Next, and C4Player::Number.
Referenced by C4Player::Init().
bool C4PlayerList::Remove | ( | C4Player * | pPlr, |
bool | fDisonnected, | ||
bool | fNoCalls | ||
) |
Definition at line 223 of file C4PlayerList.cpp.
References C4ViewportList::CloseViewport(), Console, C4Player::CrewInfoList, C4ObjectInfoList::DetachFromObjects(), C4Player::Evaluated, C4RoundResults::EvaluatePlayer(), First, FullScreen, Game, C4PlayerInfoList::GetPlayerInfoByID(), C4Game::GRBroadcast(), C4Player::ID, C4Player::Next, C4Player::NotifyOwnedObjects(), C4Player::Number, Objects, C4Game::PlayerInfos, PSF_RemovePlayer, C4Player::RemoveCrewObjects(), C4Game::RoundResults, C4PlayerInfo::SetDisconnected(), C4PlayerInfo::SetRemoved(), C4Player::Team, C4Console::UpdateMenus(), C4GameObjects::ValidateOwners(), C4FullScreen::ViewportCheck(), and Viewports.
bool C4PlayerList::Remove | ( | int | iPlayer, |
bool | fDisonnected, | ||
bool | fNoCalls | ||
) |
Definition at line 208 of file C4PlayerList.cpp.
References Get().
Referenced by C4Game::InitGameFinal(), Join(), RemoveAtClient(), RemoveAtRemoteClient(), RemoveLocal(), and Retire().
bool C4PlayerList::RemoveAtClient | ( | const char * | szName, |
bool | fDisconnect | ||
) |
Definition at line 476 of file C4PlayerList.cpp.
References FormatString(), GetAtClient(), StdStrBuf::getData(), C4Player::GetName(), LoadResStr(), Log(), and Remove().
bool C4PlayerList::RemoveAtClient | ( | int | iClient, |
bool | fDisconnect | ||
) |
Definition at line 462 of file C4PlayerList.cpp.
References FormatString(), GetAtClient(), StdStrBuf::getData(), C4Player::GetName(), LoadResStr(), Log(), and Remove().
Referenced by C4Client::Remove().
bool C4PlayerList::RemoveAtRemoteClient | ( | bool | fDisonnected, |
bool | fNoCalls | ||
) |
Definition at line 541 of file C4PlayerList.cpp.
References FormatString(), GetAtRemoteClient(), StdStrBuf::getData(), C4Player::GetName(), LoadResStr(), Log(), and Remove().
Referenced by C4Game::Abort().
bool C4PlayerList::RemoveLocal | ( | bool | fDisonnected, |
bool | fNoCalls | ||
) |
Definition at line 567 of file C4PlayerList.cpp.
References First, FormatString(), StdStrBuf::getData(), C4Player::GetName(), LoadResStr(), C4Player::LocalControl, Log(), C4Player::Next, and Remove().
Referenced by C4Game::Abort().
bool C4PlayerList::RemoveUnjoined | ( | int32_t | iPlayer | ) |
Definition at line 213 of file C4PlayerList.cpp.
References Objects.
Referenced by C4PlayerInfoList::RemoveUnassociatedPlayers().
bool C4PlayerList::Retire | ( | C4Player * | pPlr | ) |
Definition at line 394 of file C4PlayerList.cpp.
References C4PT_Script, Control, C4Player::Evaluate(), C4Player::Evaluated, C4Player::GetType(), C4GameControl::isReplay(), Remove(), and C4Player::Save().
Referenced by Execute().
bool C4PlayerList::Save | ( | bool | fSaveLocalOnly | ) |
Definition at line 374 of file C4PlayerList.cpp.
References C4PT_Script, C4Game::C4S, First, Game, C4Scenario::Head, C4Player::Next, and C4SHead::Replay.
Referenced by C4Game::Evaluate().
bool C4PlayerList::Save | ( | C4Group & | hGroup, |
bool | fStoreTiny, | ||
const C4PlayerInfoList & | rStoreList | ||
) |
Definition at line 343 of file C4PlayerList.cpp.
References C4Config::AtTempPath(), C4Group_CopyItem(), C4PT_User, C4Group::Close(), Config, StdStrBuf::Copy(), First, StdStrBuf::getData(), C4PlayerInfo::GetFilename(), C4PlayerInfoList::GetPlayerInfoByID(), C4PlayerInfo::GetType(), C4Group::Move(), C4Player::Next, and C4Group::Open().
bool C4PlayerList::SynchronizeLocalFiles | ( | ) |
Definition at line 610 of file C4PlayerList.cpp.
References First, LoadResStr(), Log(), and C4Player::Next.
Referenced by C4GameSaveSavegame::OnSaving(), and C4Game::Synchronize().
bool C4PlayerList::Valid | ( | int | iPlayer | ) | const |
Definition at line 76 of file C4PlayerList.cpp.
References First, and C4Player::Next.
Referenced by ValidPlr().
|
friend |
Definition at line 82 of file C4PlayerList.h.
Referenced by Join().
C4Player* C4PlayerList::First |
Definition at line 31 of file C4PlayerList.h.
Referenced by AverageScoreGain(), C4Network2Stats::C4Network2Stats(), CheckColorDw(), Clear(), ClearPointers(), C4Game::CompileFunc(), CtrlRemoveAtClient(), Default(), DenumeratePointers(), C4Game::DoGameOver(), C4Game::DrawCrewOverheadText(), Evaluate(), Execute(), C4Network2Stats::ExecuteControlFrame(), FileInUse(), C4Player::FindNewOwner(), Get(), C4ControlSyncCheck::GetAllCrewPosX(), GetAtClient(), GetAtRemoteClient(), GetByIndex(), GetByInfoID(), GetByName(), GetCount(), GetCountNotEliminated(), GetFreeNumber(), GetIndex(), GetLocalByIndex(), HasPlayerInTeamSelection(), C4Game::InitGameFinal(), Join(), MouseControlTaken(), C4Viewport::NextPlayer(), C4GameOverDlg::OnShown(), PositionTaken(), RecheckPlayerSort(), Remove(), RemoveLocal(), Save(), C4Player::SetTeamHostility(), SynchronizeLocalFiles(), C4Console::UpdatePlayerMenu(), C4Console::UpdateViewportMenu(), Valid(), C4FullScreen::ViewportCheck(), and C4Network2Stats::~C4Network2Stats().