#pragma once #include "camera/GameCameraController.h" #include "map/GameDataLoader.h" #include "map/GameMap.h" #include #include namespace frostbite2D { class GameTown : public Actor { public: struct MapInfo { int areaId = -1; RefPtr 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, int areaIndex = -2); int GetCurAreaIndex() const { return curMapIndex_; } RefPtr GetArea(int index) const; const std::vector& 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 mapList_; int curMapIndex_ = -1; GameCameraController cameraController_; }; } // namespace frostbite2D