62 lines
1.9 KiB
C++
62 lines
1.9 KiB
C++
#pragma once
|
|
#include "EngineCore/Game.h"
|
|
#include "Global/Script/CharacterConfig.h"
|
|
#include "Global/Script/EquipmentConfig.h"
|
|
#include "Global/Script/MonsterConfig.h"
|
|
#include "Global/Script/TownConfig.h"
|
|
#include "Global/Save/SavaManager.h"
|
|
#include "Global/GameCamera.h"
|
|
class Global_Game
|
|
{
|
|
|
|
public:
|
|
Global_Game(const Global_Game &) = delete;
|
|
Global_Game &operator=(const Global_Game &) = delete;
|
|
Global_Game(Global_Game &&) = delete;
|
|
Global_Game &operator=(Global_Game &&) = delete;
|
|
// 全局访问点
|
|
static Global_Game &GetInstance()
|
|
{
|
|
static Global_Game instance; // 局部静态变量,保证只初始化一次
|
|
return instance;
|
|
}
|
|
|
|
Global_Game();
|
|
|
|
// 游戏资源加载之前的初始化
|
|
void Init();
|
|
// 游戏资源加载之后的初始化
|
|
void InitGame();
|
|
|
|
private:
|
|
void InitFont();
|
|
|
|
public:
|
|
// 字体资源
|
|
std::vector<TTF_Font *> Fonts;
|
|
// 角色配置文件
|
|
std::vector<GlobalCharacterScript::CharacterConfig> CharacterConfigs;
|
|
// 装备路径Map
|
|
std::map<int, std::string> EquipmentPathMap;
|
|
|
|
// 怪物相关
|
|
std::map<int, std::string> MonsterPathMap; // 路径
|
|
std::map<int, GlobalMonsterScript::MonsterConfig> MonsterInfoMap; // 信息
|
|
GlobalMonsterScript::MonsterConfig GetMonsterInfo(int id); // 获取怪物信息
|
|
|
|
// 城镇相关
|
|
std::map<int, std::string> TownPathMap; // 路径
|
|
std::map<int, GlobalTownScript::TownConfig *> TownInfoMap; // 信息
|
|
const std::map<int, std::string>& GetTownMap() const; // 获取城镇路径
|
|
GlobalTownScript::TownConfig *GetTownInfo(int id); // 获取城镇信息
|
|
|
|
// 游戏摄像机
|
|
RefPtr<GameCamera> _GameCamera = nullptr;
|
|
|
|
// 游戏资源初始化标志
|
|
bool InitFlag = false;
|
|
|
|
public:
|
|
RefPtr<GameCamera> GetCamera();
|
|
};
|