1
This commit is contained in:
parent
3a5cd46128
commit
a058ce092d
@ -141,3 +141,12 @@ void CustomBattle::TraverseMemberList(std::function<bool (CustomMember*)> func)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CustomBattle::TraverseTeamList(std::function<bool (std::shared_ptr<CustomTeam>)> cb)
|
||||||
|
{
|
||||||
|
for (auto& pair : uuid_hash_) {
|
||||||
|
if (!cb(pair.second)) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -29,6 +29,7 @@ class CustomBattle
|
|||||||
int GetMemberNum();
|
int GetMemberNum();
|
||||||
int GetTeamNum();
|
int GetTeamNum();
|
||||||
void TraverseMemberList(std::function<bool (CustomMember*)> func);
|
void TraverseMemberList(std::function<bool (CustomMember*)> func);
|
||||||
|
void TraverseTeamList(std::function<bool (std::shared_ptr<CustomTeam>)> cb);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool parse_ok_ = false;
|
bool parse_ok_ = false;
|
||||||
|
@ -50,6 +50,9 @@
|
|||||||
#include "roommgr.h"
|
#include "roommgr.h"
|
||||||
#include "bornpoint.h"
|
#include "bornpoint.h"
|
||||||
#include "roomob.h"
|
#include "roomob.h"
|
||||||
|
#include "custom_battle.h"
|
||||||
|
#include "custom_team.h"
|
||||||
|
#include "custom_member.h"
|
||||||
|
|
||||||
#include "mt/Param.h"
|
#include "mt/Param.h"
|
||||||
#include "mt/Buff.h"
|
#include "mt/Buff.h"
|
||||||
@ -2704,7 +2707,13 @@ int Room::InitWithMobaBattle(long ip_saddr, int socket_handle, std::shared_ptr<c
|
|||||||
int Room::InitWithCustomBattle(long ip_saddr, int socket_handle, std::shared_ptr<cs::CMJoin> msg,
|
int Room::InitWithCustomBattle(long ip_saddr, int socket_handle, std::shared_ptr<cs::CMJoin> msg,
|
||||||
std::shared_ptr<CustomBattle> p)
|
std::shared_ptr<CustomBattle> p)
|
||||||
{
|
{
|
||||||
|
std::vector<std::shared_ptr<CustomTeam>> teams;
|
||||||
|
p->TraverseTeamList
|
||||||
|
(
|
||||||
|
[&teams] (std::shared_ptr<CustomTeam> team) -> bool
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void SyncObject::FillSMSyncPosition(cs::SMSyncPosition& sync_msg)
|
void SyncObject::FillSMSyncPosition(cs::SMSyncPosition& sync_msg)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user