]> git.localhorst.tv Git - l2e.git/blobdiff - src/map/Entity.h
added entity follower list
[l2e.git] / src / map / Entity.h
index 926c360fef144d740c4cc7f460372aadb3644b87..94090a1e547806790f3bf7331303749bfc1a7568 100644 (file)
@@ -39,15 +39,20 @@ public:
        const geometry::Vector<float> &Velocity() const { return velocity; }
 
        void SetAnimation(const graphics::Animation *a);
-       void StartAnimation(app::Application &ctrl) { runner.Start(ctrl); }
-       void StartAnimation(app::State &ctrl) { runner.Start(ctrl); }
-       void StopAnimation() { runner.Stop(); }
+       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;
 
        void Update(float deltaT);
@@ -55,9 +60,10 @@ public:
        void Render(SDL_Surface *, const geometry::Vector<int> &offset) const;
 
 private:
-       void UpdateVelocity();
+       void UpdateVelocity();;
 
 private:
+       Entity *follower;
        const graphics::Animation *animation;
        graphics::AnimationRunner runner;
        geometry::Vector<float> position;