X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fmap%2FMapState.h;h=dc352f69522636e5f2248076f6cddb59bea2a804;hb=d2d8ff1fd5f55e8b43d48ae5e75c216492e2f032;hp=e180d4832b6b3c1aead07b2dd45cffd86896af65;hpb=a550d5e73bef77a8bb98a31034dcaad83a43677a;p=l2e.git diff --git a/src/map/MapState.h b/src/map/MapState.h index e180d48..dc352f6 100644 --- a/src/map/MapState.h +++ b/src/map/MapState.h @@ -22,7 +22,7 @@ class MapState : public app::State { public: - explicit MapState(const Map *); + explicit MapState(Map *); virtual ~MapState() { } public: @@ -40,15 +40,43 @@ public: void AddEntity(Entity *e) { entities.push_back(e); } void ControlEntity(Entity *e) { controlled = e; camera.SetTarget(&e->Position()); } + void SetWalkingSpeed(float s) { walkingSpeed = s; } + + void Transition(Map *, const geometry::Vector &coordinates); + private: static bool ZCompare(const Entity *lhs, const Entity *rhs); + void UnloadMap(); + void LoadMap(Map *); + + bool CheckBlocking() const; + + void OnTileLock(); + void OnGridLock(); + void OnMove(bool); + + void UpdateFollower(Entity &); + void StopFollowers(Entity &); + + void LockEntities(); + void CheckMonster(); + void CheckTrigger(); + private: - const Map *map; + app::Application *ctrl; + Map *map; Entity *controlled; + app::Timer moveTimer; geometry::Vector tempTarget; + geometry::Vector lastLock; graphics::Camera camera; std::vector entities; + float walkingSpeed; + int nextDirection; + bool afterLock; + bool skipLock; + bool debug; };