X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fmap%2FEntity.h;h=94090a1e547806790f3bf7331303749bfc1a7568;hb=a1c89e41e38eca790e168b8acd3beee974685fcd;hp=2bc6aac6a863913eaece225598bf8ed85e5cd969;hpb=1d6a9f01b8db0f5212b6a02603dd0670c6da38c7;p=l2e.git diff --git a/src/map/Entity.h b/src/map/Entity.h index 2bc6aac..94090a1 100644 --- a/src/map/Entity.h +++ b/src/map/Entity.h @@ -38,13 +38,21 @@ public: geometry::Vector &Velocity() { return velocity; } const geometry::Vector &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; void Update(float deltaT); @@ -52,11 +60,12 @@ public: void Render(SDL_Surface *, const geometry::Vector &offset) const; private: - void UpdateVelocity(); + void UpdateVelocity();; private: - const graphics::Sprite *sprite; - graphics::AnimationRunner animation; + Entity *follower; + const graphics::Animation *animation; + graphics::AnimationRunner runner; geometry::Vector position; geometry::Vector velocity; Orientation orientation;