void CEventHandler::PlayerChanged(int playerID) { const int count = listPlayerChanged.size(); for (int i = 0; i < count; i++) { CEventClient* ec = listPlayerChanged[i]; ec->PlayerChanged(playerID); } }
void CEventHandler::ViewResize() { const int count = listViewResize.size(); for (int i = 0; i < count; i++) { CEventClient* ec = listViewResize[i]; ec->ViewResize(); } }
void CEventHandler::GamePreload() { const int count = listGamePreload.size(); for (int i = 0; i < count; i++) { CEventClient* ec = listGamePreload[i]; ec->GamePreload(); } }
void CEventHandler::GameProgress(int gameFrame) { const int count = listGameProgress.size(); for (int i = 0; i < count; i++) { CEventClient* ec = listGameProgress[i]; ec->GameProgress(gameFrame); } }
void CEventHandler::Update() { const int count = listUpdate.size(); for (int i = 0; i < count; i++) { CEventClient* ec = listUpdate[i]; ec->Update(); } }
void CEventHandler::GamePaused(int playerID, bool paused) { const int count = listGamePaused.size(); for (int i = 0; i < count; i++) { CEventClient* ec = listGamePaused[i]; ec->GamePaused(playerID, paused); } }
void CEventHandler::PlayerRemoved(int playerID, int reason) { const int count = listPlayerRemoved.size(); for (int i = 0; i < count; i++) { CEventClient* ec = listPlayerRemoved[i]; ec->PlayerRemoved(playerID, reason); } }
void CEventHandler::GameOver(const std::vector<unsigned char>& winningAllyTeams) { const int count = listGameOver.size(); for (int i = 0; i < count; i++) { CEventClient* ec = listGameOver[i]; ec->GameOver(winningAllyTeams); } }
void CEventHandler::Save(zipFile archive) { const int count = listSave.size(); for (int i = 0; i < count; i++) { CEventClient* ec = listSave[i]; ec->Save(archive); } }
void CEventHandler::TeamChanged(int teamID) { const int count = listTeamChanged.size(); for (int i = 0; i < count; i++) { CEventClient* ec = listTeamChanged[i]; ec->TeamChanged(teamID); } }
void CEventHandler::GameOver() { const int count = listGameOver.size(); for (int i = 0; i < count; i++) { CEventClient* ec = listGameOver[i]; ec->GameOver(); } }
bool CEventHandler::AddConsoleLine(const string& msg, CLogSubsystem& subsystem) { const int count = listAddConsoleLine.size(); for (int i = 0; i < count; i++) { CEventClient* ec = listAddConsoleLine[i]; ec->AddConsoleLine(msg, subsystem); } return true; }
void CEventHandler::ViewResize() { EVENTHANDLER_CHECK(ViewResize); for (int i = 0; i < count; i++) { CEventClient* ec = listViewResize[i]; ec->ViewResize(); } }
bool CEventHandler::GroupChanged(int groupID) { const int count = listGroupChanged.size(); for (int i = 0; i < count; i++) { CEventClient* ec = listGroupChanged[i]; ec->GroupChanged(groupID); } return false; }
void CEventHandler::LastMessagePosition(const float3& pos) { EVENTHANDLER_CHECK(LastMessagePosition); //GML_STDMUTEX_LOCK(log); // LastMessagePosition FIXME would this be required? for (int i = 0; i < count; i++) { CEventClient* ec = listLastMessagePosition[i]; ec->LastMessagePosition(pos); } }
bool CEventHandler::AddConsoleLine(const std::string& msg, const std::string& section, int level) { EVENTHANDLER_CHECK(AddConsoleLine, false); for (int i = 0; i < count; i++) { CEventClient* ec = listAddConsoleLine[i]; ec->AddConsoleLine(msg, section, level); } return true; }
bool CEventHandler::GroupChanged(int groupID) { EVENTHANDLER_CHECK(GroupChanged, false); for (int i = 0; i < count; i++) { CEventClient* ec = listGroupChanged[i]; ec->GroupChanged(groupID); } return false; }
void CEventHandler::Update() { GML_DRAW_CALLIN_SELECTOR(); EVENTHANDLER_CHECK(Update); for (int i = 0; i < count; i++) { CEventClient* ec = listUpdate[i]; ec->Update(); } }
void CEventHandler::UnitHarvestStorageFull(const CUnit* unit) { const int unitAllyTeam = unit->allyteam; const int count = listUnitHarvestStorageFull.size(); for (int i = 0; i < count; i++) { CEventClient* ec = listUnitHarvestStorageFull[i]; if (ec->CanReadAllyTeam(unitAllyTeam)) { ec->UnitHarvestStorageFull(unit); } } }
bool CEventHandler::SyncedActionFallback(const string& line, int playerID) { for (int i = 0; i < listSyncedActionFallback.size(); ) { CEventClient* ec = listSyncedActionFallback[i]; if (ec->SyncedActionFallback(line, playerID)) return true; if (i < listSyncedActionFallback.size() && ec == listSyncedActionFallback[i]) ++i; /* the call-in may remove itself from the list */ } return false; }
bool CEventHandler::IsAbove(int x, int y) { // reverse order, user has the override const int count = listIsAbove.size(); for (int i = (count - 1); i >= 0; i--) { CEventClient* ec = listIsAbove[i]; if (ec->IsAbove(x, y)) { return true; } } return false; }
bool CEventHandler::MouseWheel(bool up, float value) { // reverse order, user has the override const int count = listMouseWheel.size(); for (int i = (count - 1); i >= 0; i--) { CEventClient* ec = listMouseWheel[i]; if (ec->MouseWheel(up, value)) { return true; } } return false; }
bool CEventHandler::KeyRelease(unsigned short key) { // reverse order, user has the override const int count = listKeyRelease.size(); for (int i = (count - 1); i >= 0; i--) { CEventClient* ec = listKeyRelease[i]; if (ec->KeyRelease(key)) { return true; } } return false; }
bool CEventHandler::KeyPress(unsigned short key, bool isRepeat) { // reverse order, user has the override const int count = listKeyPress.size(); for (int i = (count - 1); i >= 0; i--) { CEventClient* ec = listKeyPress[i]; if (ec->KeyPress(key, isRepeat)) { return true; } } return false; }
bool CEventHandler::CommandNotify(const Command& cmd) { // reverse order, user has the override const int count = listCommandNotify.size(); for (int i = (count - 1); i >= 0; i--) { CEventClient* ec = listCommandNotify[i]; if (ec->CommandNotify(cmd)) { return true; } } return false; }
void CEventHandler::Load(IArchive* archive) { const int count = listLoad.size(); if (count <= 0) return; for (int i = 0; i < count; i++) { CEventClient* ec = listLoad[i]; ec->Load(archive); } }
int CEventHandler::AllowWeaponTargetCheck(unsigned int attackerID, unsigned int attackerWeaponNum, unsigned int attackerWeaponDefID) { int result = -1; for (int i = 0; i < listAllowWeaponTargetCheck.size(); ) { CEventClient* ec = listAllowWeaponTargetCheck[i]; int result2 = ec->AllowWeaponTargetCheck(attackerID, attackerWeaponNum, attackerWeaponDefID); if (result2 > result) result = result2; if (i < listAllowWeaponTargetCheck.size() && ec == listAllowWeaponTargetCheck[i]) ++i; /* the call-in may remove itself from the list */ } return result; }
bool CEventHandler::MousePress(int x, int y, int button) { // reverse order, user has the override const int count = listMousePress.size(); for (int i = (count - 1); i >= 0; i--) { CEventClient* ec = listMousePress[i]; if (ec->MousePress(x, y, button)) { mouseOwner = ec; return true; } } return false; }
bool CEventHandler::GameSetup(const string& state, bool& ready, const map<int, string>& playerStates) { // reverse order, user has the override const int count = listGameSetup.size(); for (int i = (count - 1); i >= 0; i--) { CEventClient* ec = listGameSetup[i]; if (ec->GameSetup(state, ready, playerStates)) { return true; } } return false; }
string CEventHandler::GetTooltip(int x, int y) { // reverse order, user has the override const int count = listGetTooltip.size(); for (int i = (count - 1); i >= 0; i--) { CEventClient* ec = listGetTooltip[i]; const string tt = ec->GetTooltip(x, y); if (!tt.empty()) { return tt; } } return ""; }