#pragma once #include "world/GameTown.h" #include #include #include namespace frostbite2D { class GameWorld : public Scene { public: GameWorld(); ~GameWorld() override = default; void onEnter() override; void onExit() override; void Update(float deltaTime) override; void AddCharacter(RefPtr actor, int townId); void MoveCharacter(RefPtr actor, int townId, int area); void RequestMoveCharacter(RefPtr actor, int townId, int area); static GameWorld* GetWorld(); private: struct PendingCharacterMove { RefPtr actor; int townId = -1; int area = -1; }; bool InitWorld(); void ProcessPendingCharacterMove(); std::map townPathMap_; std::map> townMap_; RefPtr mainActor_; std::optional pendingCharacterMove_; int curTown_ = -1; bool initialized_ = false; }; } // namespace frostbite2D