Files
Frostbite2D/Game/include/Actor/GameWorld.h
Lenheart d55808d80f feat: 实现游戏地图和城镇系统基础架构
新增GameMap和GameTown类实现游戏地图和城镇的核心功能
添加GameWorld作为游戏世界管理器处理场景切换
完善音频系统支持从路径加载音乐和音效
重构PVF资源系统增加路径规范化功能
添加.gitignore排除游戏资源目录
2026-04-01 09:53:06 +08:00

33 lines
639 B
C++

#pragma once
#include "GameTown.h"
#include <frostbite2D/scene/scene.h>
#include <map>
namespace frostbite2D {
class GameWorld : public Scene {
public:
GameWorld();
~GameWorld() override = default;
void onEnter() override;
void onExit() override;
void AddCharacter(RefPtr<Actor> actor, int townId);
void MoveCharacter(RefPtr<Actor> actor, int townId, int area);
static GameWorld* GetWorld();
private:
bool InitWorld();
std::map<int, std::string> townPathMap_;
std::map<int, RefPtr<GameTown>> townMap_;
RefPtr<Actor> mainActor_;
int curTown_ = -1;
bool initialized_ = false;
};
} // namespace frostbite2D