]> git.localhorst.tv Git - l2e.git/blobdiff - src/map/Entity.h
added entity orientation awareness
[l2e.git] / src / map / Entity.h
index fd91f3eeb5ce2114a578ba6b9ffdfb61da02a774..2bc6aac6a863913eaece225598bf8ed85e5cd969 100644 (file)
@@ -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<float> &Position() { return position; }
        const geometry::Vector<float> &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<int> &offset) const;
 
+private:
+       void UpdateVelocity();
+
 private:
        const graphics::Sprite *sprite;
        graphics::AnimationRunner animation;
        geometry::Vector<float> position;
        geometry::Vector<float> velocity;
+       Orientation orientation;
+       float speed;
 
 };