This commit is contained in:
aozhiwei 2023-09-23 17:29:46 +08:00
parent 3b46014e97
commit 6f7a270294
2 changed files with 10 additions and 0 deletions

View File

@ -124,3 +124,12 @@ int CustomBattle::GetMemberNum()
{ {
return member_id_hash_.size(); return member_id_hash_.size();
} }
void CustomBattle::TraverseMemberList(std::function<bool (CustomMember*)> func)
{
for (auto& pair : member_id_hash_) {
if (!func(pair.second.get())) {
break;
}
}
}

View File

@ -26,6 +26,7 @@ class CustomBattle
std::shared_ptr<CustomTeam> GetTeamByTeamUuid(const std::string& team_uuid); std::shared_ptr<CustomTeam> GetTeamByTeamUuid(const std::string& team_uuid);
bool AllIsJoined(); bool AllIsJoined();
int GetMemberNum(); int GetMemberNum();
void TraverseMemberList(std::function<bool (CustomMember*)> func);
private: private:
bool parse_ok_ = false; bool parse_ok_ = false;