fix(ViewPlayer): Make "never wanted" feature independent for each player (#316)

Co-authored-by: Yimura <andreas.maerten@scarlet.be>
This commit is contained in:
mentolixite
2022-07-05 22:35:32 +02:00
committed by GitHub
parent a286d84e1b
commit 6a4ee2b282
7 changed files with 19 additions and 7 deletions

View File

@ -36,6 +36,8 @@ namespace big
[[nodiscard]] bool is_host() const;
[[nodiscard]] bool is_valid() const;
bool never_wanted = false;
protected:
bool equals(const CNetGamePlayer* net_game_player) const;

View File

@ -6,6 +6,7 @@ namespace big
class player;
using player_ptr = std::shared_ptr<player>;
using player_entry = std::pair<std::string, player_ptr>;
using players = std::map<std::string, player_ptr>;
class player_service final
@ -43,6 +44,9 @@ namespace big
players& players()
{ return m_players; }
void iterate(const std::function< void(const player_entry &entry) > func)
{ for (const auto &iter : m_players) func(iter); }
void set_selected(player_ptr plyr);
};