add refreshrule.*

This commit is contained in:
aozhiwei 2021-04-09 16:53:07 +08:00
parent 6d76bf63cd
commit e2c853b369
4 changed files with 35 additions and 0 deletions

View File

@ -0,0 +1,14 @@
#include "precompile.h"
#include "refreshrule.h"
void RefreshRule::Init()
{
}
void RefreshRule::UnInit()
{
}

View File

@ -0,0 +1,11 @@
#pragma once
class Room;
class RefreshRule
{
public:
Room* room = nullptr;
void Init();
void UnInit();
};

View File

@ -29,6 +29,7 @@
#include "perfmonitor.h"
#include "mapinstance.h"
#include "mapmgr.h"
#include "refreshrule.h"
#include "framework/cpp/utils.h"
@ -85,6 +86,9 @@ void Room::Init()
CreateDropObjs();
InitObstacleDatas();
ShuaAndroid();
refresh_rule_ = new RefreshRule();
refresh_rule_->room = this;
refresh_rule_->Init();
if (room_type_ == RT_NewBrid && creator_game_times_ <= 0) {
CreateLevel0RoomSpecThings();
}
@ -95,9 +99,12 @@ void Room::Init()
void Room::UnInit()
{
refresh_rule_->UnInit();
#ifdef DEBUG
UnInitDebugInfo();
#endif
refresh_rule_->UnInit();
A8_SAFE_DELETE(refresh_rule_);
timer_attacher.ClearTimerList();
xtimer_attacher_.ClearTimerList();
for (auto& pair : accountid_hash_) {

View File

@ -36,6 +36,7 @@ class AabbCollider;
class Android;
class Car;
class Hero;
class RefreshRule;
class Room
{
public:
@ -318,4 +319,6 @@ private:
std::vector<ObstacleData> obstacle_datas_;
xtimer_list* auto_jump_timer_ = nullptr;
RefreshRule* refresh_rule_ = nullptr;
};