31 lines
757 B
C++
31 lines
757 B
C++
#pragma once
|
|
|
|
#include <a8/singleton.h>
|
|
|
|
class MapInstance;
|
|
class Room;
|
|
struct RoomInitInfo;
|
|
class MapMgr : public a8::Singleton<MapMgr>
|
|
{
|
|
private:
|
|
MapMgr() {};
|
|
friend class a8::Singleton<MapMgr>;
|
|
|
|
public:
|
|
void Init();
|
|
void UnInit();
|
|
|
|
void AttachRoom(Room* room, RoomInitInfo& init_info);
|
|
std::shared_ptr<MapInstance> GetMapInstance(int map_id);
|
|
int IncCurrRaycastIndex() { return ++curr_raycast_index_; };
|
|
|
|
private:
|
|
std::shared_ptr<MapInstance> RandMapInstance(int map_mode);
|
|
|
|
private:
|
|
int curr_raycast_index_ = 1000;
|
|
std::vector<std::shared_ptr<MapInstance>> instance_list_;
|
|
std::map<int, std::shared_ptr<MapInstance>> instance_hash_;
|
|
std::map<int, std::vector<std::shared_ptr<MapInstance>>> mode_hash_;
|
|
};
|