This commit is contained in:
aozhiwei 2023-10-14 16:08:16 +08:00
parent dfee1fc337
commit 34d15e9408
4 changed files with 7 additions and 9 deletions

View File

@ -45,6 +45,7 @@
#include "custom_battle.h" #include "custom_battle.h"
#include "custom_team.h" #include "custom_team.h"
#include "custom_member.h" #include "custom_member.h"
#include "room_agent.h"
#include "mt/Param.h" #include "mt/Param.h"
#include "mt/Hero.h" #include "mt/Hero.h"
@ -124,6 +125,8 @@ void Room::Init()
air_drop_ = std::make_shared<AirDrop>(this); air_drop_ = std::make_shared<AirDrop>(this);
air_raid_ = std::make_shared<AirRaid>(this); air_raid_ = std::make_shared<AirRaid>(this);
batch_sync_ = std::make_shared<BatchSync>(this); batch_sync_ = std::make_shared<BatchSync>(this);
room_agent_ = behaviac::Agent::Create<RoomAgent>();
room_agent_->SetRoom(this);
CreateSpawnPoints(); CreateSpawnPoints();
CreateWorldObjects(); CreateWorldObjects();

View File

@ -281,7 +281,7 @@ public:
int GetMobaLeftTime(); int GetMobaLeftTime();
Team* GetMobaTeamA() { return moba_team_a_; } Team* GetMobaTeamA() { return moba_team_a_; }
Team* GetMobaTeamB() { return moba_team_b_; } Team* GetMobaTeamB() { return moba_team_b_; }
RoomAgent* GetRoomAgent() { return room_agent_.get(); } RoomAgent* GetRoomAgent() { return room_agent_; }
private: private:
void ShuaAndroid(); void ShuaAndroid();
@ -440,7 +440,7 @@ private:
Team* moba_team_a_ = nullptr; Team* moba_team_a_ = nullptr;
Team* moba_team_b_ = nullptr; Team* moba_team_b_ = nullptr;
std::shared_ptr<RoomAgent> room_agent_; RoomAgent* room_agent_;
friend class Incubator; friend class Incubator;
friend class Team; friend class Team;

View File

@ -7,7 +7,6 @@
RoomAgent::RoomAgent():BaseAgent() RoomAgent::RoomAgent():BaseAgent()
{ {
} }
RoomAgent::~RoomAgent() RoomAgent::~RoomAgent()
@ -59,8 +58,3 @@ bool RoomAgent::IsGameOver()
{ {
return room_->IsGameOver(); return room_->IsGameOver();
} }
void RoomAgent::SetRoom(Room* room)
{
room_ = room;
}

View File

@ -23,7 +23,8 @@ public:
HeroAgent* FindHero(int hero_uniid); HeroAgent* FindHero(int hero_uniid);
bool IsGameOver(); bool IsGameOver();
void SetRoom(Room* room); void SetRoom(Room* room) { room_ = room; }
virtual Room* GetRoom() { return room_; }
private: private:
Room* room_ = nullptr; Room* room_ = nullptr;