1
This commit is contained in:
parent
e8f4e92eac
commit
2dd720af02
@ -67,6 +67,7 @@ void CustomBattle::ParseResult(a8::XObject& obj)
|
|||||||
auto team = GetTeamByTeamUuid(team_uuid);
|
auto team = GetTeamByTeamUuid(team_uuid);
|
||||||
if (!team) {
|
if (!team) {
|
||||||
team = std::make_shared<CustomTeam>();
|
team = std::make_shared<CustomTeam>();
|
||||||
|
team->custom_battle_ = this;
|
||||||
team->team_uuid_ = team_uuid;
|
team->team_uuid_ = team_uuid;
|
||||||
team->is_view_ = false;
|
team->is_view_ = false;
|
||||||
uuid_hash_[team->team_uuid_] = team;
|
uuid_hash_[team->team_uuid_] = team;
|
||||||
|
@ -22,5 +22,10 @@ bool CustomMember::IsView()
|
|||||||
|
|
||||||
void CustomMember::_CMBattlePreSetReady(f8::MsgHdr* hdr, const cs::CMBattlePreSetReady& msg)
|
void CustomMember::_CMBattlePreSetReady(f8::MsgHdr* hdr, const cs::CMBattlePreSetReady& msg)
|
||||||
{
|
{
|
||||||
|
is_ready_ = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CustomMember::IsAndroid()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -31,6 +31,7 @@ class CustomMember
|
|||||||
int GetSex() { return sex_; }
|
int GetSex() { return sex_; }
|
||||||
std::shared_ptr<BattleDataContext>& GetNetData() { return battle_context_; };
|
std::shared_ptr<BattleDataContext>& GetNetData() { return battle_context_; };
|
||||||
void _CMBattlePreSetReady(f8::MsgHdr* hdr, const cs::CMBattlePreSetReady& msg);
|
void _CMBattlePreSetReady(f8::MsgHdr* hdr, const cs::CMBattlePreSetReady& msg);
|
||||||
|
bool IsAndroid();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::shared_ptr<cs::CMJoin> join_msg_;
|
std::shared_ptr<cs::CMJoin> join_msg_;
|
||||||
@ -45,6 +46,7 @@ private:
|
|||||||
std::string avatar_url_;
|
std::string avatar_url_;
|
||||||
int head_frame_ = 0;
|
int head_frame_ = 0;
|
||||||
int sex_ = 0;
|
int sex_ = 0;
|
||||||
|
int is_ready_ = 0;
|
||||||
std::shared_ptr<BattleDataContext> battle_context_;
|
std::shared_ptr<BattleDataContext> battle_context_;
|
||||||
friend class CustomBattle;
|
friend class CustomBattle;
|
||||||
};
|
};
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
class CustomMember;
|
class CustomMember;
|
||||||
|
class CustomBattle;
|
||||||
class CustomTeam
|
class CustomTeam
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -11,8 +12,10 @@ class CustomTeam
|
|||||||
void TraverseMember(std::function<bool (std::shared_ptr<CustomMember>)> cb);
|
void TraverseMember(std::function<bool (std::shared_ptr<CustomMember>)> cb);
|
||||||
int GetMemberNum();
|
int GetMemberNum();
|
||||||
int GetAverageHeroLv();
|
int GetAverageHeroLv();
|
||||||
|
CustomBattle* GetCustomBattle() { return custom_battle_; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
CustomBattle* custom_battle_ = nullptr;
|
||||||
std::string team_uuid_;
|
std::string team_uuid_;
|
||||||
bool is_view_ = false;
|
bool is_view_ = false;
|
||||||
std::map<std::string, std::shared_ptr<CustomMember>> member_hash_;
|
std::map<std::string, std::shared_ptr<CustomMember>> member_hash_;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user