X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmap%2FEntity.h;h=2bc6aac6a863913eaece225598bf8ed85e5cd969;hb=1d6a9f01b8db0f5212b6a02603dd0670c6da38c7;hp=fd91f3eeb5ce2114a578ba6b9ffdfb61da02a774;hpb=c03b01f2a152927227a674d462794604aa08e5dd;p=l2e.git diff --git a/src/map/Entity.h b/src/map/Entity.h index fd91f3e..2bc6aac 100644 --- a/src/map/Entity.h +++ b/src/map/Entity.h @@ -23,6 +23,14 @@ public: Entity(); ~Entity() { } +public: + enum Orientation { + ORIENTATION_NORTH = 0, + ORIENTATION_EAST = 1, + ORIENTATION_SOUTH = 2, + ORIENTATION_WEST = 3, + }; + public: geometry::Vector &Position() { return position; } const geometry::Vector &Position() const { return position; } @@ -34,15 +42,25 @@ public: graphics::AnimationRunner &Animation() { return animation; } const graphics::AnimationRunner &Animation() const { return animation; } + void SetOrientation(Orientation); + void SetSpeed(float); + + bool TileLock(int width, int height) const; + void Update(float deltaT); void Render(SDL_Surface *, const geometry::Vector &offset) const; +private: + void UpdateVelocity(); + private: const graphics::Sprite *sprite; graphics::AnimationRunner animation; geometry::Vector position; geometry::Vector velocity; + Orientation orientation; + float speed; };