X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fmap%2FEntity.h;h=12f22c947aae0c903a2468382c0261217ae76456;hb=0fc36d261ef8129debbd4aa15594bc46cb82eb27;hp=2bc6aac6a863913eaece225598bf8ed85e5cd969;hpb=1d6a9f01b8db0f5212b6a02603dd0670c6da38c7;p=l2e.git diff --git a/src/map/Entity.h b/src/map/Entity.h index 2bc6aac..12f22c9 100644 --- a/src/map/Entity.h +++ b/src/map/Entity.h @@ -38,14 +38,25 @@ 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; } + geometry::Vector &SpriteOffset() { return spriteOffset; } + const geometry::Vector &SpriteOffset() const { return spriteOffset; } + + 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); - bool TileLock(int width, int height) const; + Entity *Follower() { return follower; } + const Entity *Follower() const { return follower; } + void AddFollower(Entity *); + void RemoveFollower(Entity *); + + bool TileLock(const geometry::Vector &tileSize) const; void Update(float deltaT); @@ -55,8 +66,10 @@ private: void UpdateVelocity(); private: - const graphics::Sprite *sprite; - graphics::AnimationRunner animation; + Entity *follower; + const graphics::Animation *animation; + graphics::AnimationRunner runner; + geometry::Vector spriteOffset; geometry::Vector position; geometry::Vector velocity; Orientation orientation;