mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-28 08:48:48 +02:00
Apply suggestions from code review
Co-authored-by: Nordsoft91 <nordsoft@yahoo.com>
This commit is contained in:
parent
f6843c0574
commit
0a1578b797
@ -67,7 +67,7 @@ public:
|
||||
virtual void setCampaignBonus(int bonusId) const = 0;
|
||||
virtual void setMapInfo(std::shared_ptr<CMapInfo> to, std::shared_ptr<CMapGenOptions> mapGenOpts = {}) const = 0;
|
||||
virtual void setPlayer(PlayerColor color) const = 0;
|
||||
virtual void setPlayerName(PlayerColor color, std::string name) const = 0;
|
||||
virtual void setPlayerName(PlayerColor color, const std::string & name) const = 0;
|
||||
virtual void setPlayerOption(ui8 what, int32_t value, PlayerColor player) const = 0;
|
||||
virtual void setDifficulty(int to) const = 0;
|
||||
virtual void setTurnTimerInfo(const TurnTimerInfo &) const = 0;
|
||||
@ -153,7 +153,7 @@ public:
|
||||
void setCampaignBonus(int bonusId) const override;
|
||||
void setMapInfo(std::shared_ptr<CMapInfo> to, std::shared_ptr<CMapGenOptions> mapGenOpts = {}) const override;
|
||||
void setPlayer(PlayerColor color) const override;
|
||||
void setPlayerName(PlayerColor color, std::string name) const override;
|
||||
void setPlayerName(PlayerColor color, const std::string & name) const override;
|
||||
void setPlayerOption(ui8 what, int32_t value, PlayerColor player) const override;
|
||||
void setDifficulty(int to) const override;
|
||||
void setTurnTimerInfo(const TurnTimerInfo &) const override;
|
||||
|
@ -1145,7 +1145,7 @@ void OptionsTab::PlayerOptionsEntry::clickReleased(const Point & cursorPosition)
|
||||
changeName();
|
||||
}
|
||||
|
||||
void OptionsTab::PlayerOptionsEntry::changeName() {
|
||||
void OptionsTab::PlayerOptionsEntry::updateName() {
|
||||
if(labelPlayerNameEdit->getText() != name)
|
||||
{
|
||||
CSH->setPlayerName(s->color, labelPlayerNameEdit->getText());
|
||||
|
@ -196,6 +196,6 @@ private:
|
||||
private:
|
||||
const OptionsTab & parentTab;
|
||||
|
||||
void changeName();
|
||||
void updateName();
|
||||
};
|
||||
};
|
||||
|
@ -845,7 +845,7 @@ void CVCMIServer::setPlayerName(PlayerColor color, std::string name)
|
||||
if(!player.isControlledByHuman())
|
||||
return;
|
||||
|
||||
if(!player.connectedPlayerIDs.size())
|
||||
if(player.connectedPlayerIDs.empty())
|
||||
return;
|
||||
|
||||
int nameID = *(player.connectedPlayerIDs.begin()); //if not AI - set appropiate ID
|
||||
|
Loading…
Reference in New Issue
Block a user