1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

Rename for clarity

This commit is contained in:
Ivan Savenko 2024-04-07 21:22:33 +03:00
parent 0a296add0c
commit e89e5d2127
2 changed files with 14 additions and 8 deletions

View File

@ -146,6 +146,11 @@ CServerHandler::CServerHandler()
registerTypesLobbyPacks(*applier);
}
void CServerHandler::setHighScoreCalc(const std::shared_ptr<HighScoreCalculation> &newHighScoreCalc)
{
campaignScoreCalculator = newHighScoreCalc;
}
void CServerHandler::threadRunNetwork()
{
logGlobal->info("Starting network thread");
@ -627,7 +632,7 @@ void CServerHandler::startGameplay(VCMI_LIB_WRAP_NAMESPACE(CGameState) * gameSta
if(CMM)
CMM->disable();
highScoreCalc = nullptr;
campaignScoreCalculator = nullptr;
switch(si->mode)
{
@ -735,14 +740,14 @@ void CServerHandler::startCampaignScenario(HighScoreParameter param, std::shared
if (!cs)
ourCampaign = si->campState;
if(highScoreCalc == nullptr)
if(campaignScoreCalculator == nullptr)
{
highScoreCalc = std::make_shared<HighScoreCalculation>();
highScoreCalc->isCampaign = true;
highScoreCalc->parameters.clear();
campaignScoreCalculator = std::make_shared<HighScoreCalculation>();
campaignScoreCalculator->isCampaign = true;
campaignScoreCalculator->parameters.clear();
}
param.campaignName = cs->getNameTranslated();
highScoreCalc->parameters.push_back(param);
campaignScoreCalculator->parameters.push_back(param);
endGameplay();
@ -763,7 +768,7 @@ void CServerHandler::startCampaignScenario(HighScoreParameter param, std::shared
else
{
CMM->openCampaignScreen(ourCampaign->campaignSet);
GH.windows().createAndPushWindow<CHighScoreInputScreen>(true, *highScoreCalc);
GH.windows().createAndPushWindow<CHighScoreInputScreen>(true, *campaignScoreCalculator);
}
};

View File

@ -106,7 +106,7 @@ class CServerHandler final : public IServerAPI, public LobbyInfo, public INetwor
std::unique_ptr<IServerRunner> serverRunner;
std::shared_ptr<CMapInfo> mapToStart;
std::vector<std::string> localPlayerNames;
std::shared_ptr<HighScoreCalculation> highScoreCalc;
std::shared_ptr<HighScoreCalculation> campaignScoreCalculator;
boost::thread threadNetwork;
@ -219,6 +219,7 @@ public:
void visitForLobby(CPackForLobby & lobbyPack);
void visitForClient(CPackForClient & clientPack);
void setHighScoreCalc(const std::shared_ptr<HighScoreCalculation> &newHighScoreCalc);
};
extern CServerHandler * CSH;