refactor: 将数学工具函数移至GameMath类 feat(音频): 实现地图音频控制器 feat(调试): 添加游戏调试UI组件 feat(地图): 增加移动区域边界获取方法 fix(角色): 修复角色移动区域抑制逻辑 refactor(世界): 重构游戏世界场景初始化 docs(音频): 完善音频数据库注释
47 lines
1.1 KiB
C++
47 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include "camera/GameCameraController.h"
|
|
#include "map/GameDataLoader.h"
|
|
#include "map/GameMap.h"
|
|
#include <frostbite2D/2d/actor.h>
|
|
#include <vector>
|
|
|
|
namespace frostbite2D {
|
|
|
|
class GameTown : public Actor {
|
|
public:
|
|
struct MapInfo {
|
|
int areaId = -1;
|
|
RefPtr<GameMap> map;
|
|
std::string type;
|
|
Vec2 generatePos = Vec2(-1.0f, -1.0f);
|
|
};
|
|
|
|
GameTown();
|
|
~GameTown() override = default;
|
|
|
|
bool Init(int index, const std::string& townPath);
|
|
void AddCharacter(RefPtr<Actor> actor, int areaIndex = -2);
|
|
|
|
int GetCurAreaIndex() const { return curMapIndex_; }
|
|
RefPtr<GameMap> GetArea(int index) const;
|
|
RefPtr<GameMap> GetCurrentArea() const;
|
|
const std::vector<MapInfo>& GetAreas() const { return mapList_; }
|
|
|
|
void Update(float deltaTime) override;
|
|
|
|
private:
|
|
std::string name_;
|
|
std::string enteringTitle_;
|
|
std::string enteringCutscene_;
|
|
int needQuestId_ = -1;
|
|
int needLevel_ = -1;
|
|
int sariaRoomId_ = -1;
|
|
Vec2 sariaRoomPos_ = Vec2(-1.0f, -1.0f);
|
|
std::vector<MapInfo> mapList_;
|
|
int curMapIndex_ = -1;
|
|
GameCameraController cameraController_;
|
|
};
|
|
|
|
} // namespace frostbite2D
|