]> git.localhorst.tv Git - l2e.git/blobdiff - src/map/Entity.h
added entity follower list
[l2e.git] / src / map / Entity.h
index d6ba5f3a3763dc2acd3aefd4697fde9d33bef8c5..94090a1e547806790f3bf7331303749bfc1a7568 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; }
@@ -30,9 +38,20 @@ public:
        geometry::Vector<float> &Velocity() { return velocity; }
        const geometry::Vector<float> &Velocity() const { return velocity; }
 
-       void SetSprite(const graphics::Sprite *s) { sprite = s; }
-       graphics::AnimationRunner &Animation() { return animation; }
-       const graphics::AnimationRunner &Animation() const { return animation; }
+       void SetAnimation(const graphics::Animation *a);
+       void StartAnimation(app::Application &ctrl);
+       void StartAnimation(app::State &ctrl);
+       void StopAnimation();
+       bool AnimationRunning() const { return runner.Running(); }
+
+       void SetOrientation(Orientation);
+       Orientation GetOrientation() const { return orientation; }
+       void SetSpeed(float);
+
+       Entity *Follower() { return follower; }
+       const Entity *Follower() const { return follower; }
+       void AddFollower(Entity *);
+       void RemoveFollower(Entity *);
 
        bool TileLock(int width, int height) const;
 
@@ -41,10 +60,16 @@ public:
        void Render(SDL_Surface *, const geometry::Vector<int> &offset) const;
 
 private:
-       const graphics::Sprite *sprite;
-       graphics::AnimationRunner animation;
+       void UpdateVelocity();;
+
+private:
+       Entity *follower;
+       const graphics::Animation *animation;
+       graphics::AnimationRunner runner;
        geometry::Vector<float> position;
        geometry::Vector<float> velocity;
+       Orientation orientation;
+       float speed;
 
 };