4 * Created on: Sep 29, 2012
11 #include "../geometry/Vector.h"
12 #include "../graphics/fwd.h"
13 #include "../graphics/Animation.h"
28 ORIENTATION_NORTH = 0,
30 ORIENTATION_SOUTH = 2,
35 geometry::Vector<float> &Position() { return position; }
36 const geometry::Vector<float> &Position() const { return position; }
38 geometry::Vector<float> &Velocity() { return velocity; }
39 const geometry::Vector<float> &Velocity() const { return velocity; }
41 geometry::Vector<float> &SpriteOffset() { return spriteOffset; }
42 const geometry::Vector<float> &SpriteOffset() const { return spriteOffset; }
44 void SetAnimation(const graphics::Animation *a);
45 void StartAnimation(app::Application &ctrl);
46 void StartAnimation(app::State &ctrl);
48 bool AnimationRunning() const { return runner.Running(); }
50 void SetOrientation(Orientation);
51 Orientation GetOrientation() const { return orientation; }
54 Entity *Follower() { return follower; }
55 const Entity *Follower() const { return follower; }
56 void AddFollower(Entity *);
57 void RemoveFollower(Entity *);
59 bool TileLock(const geometry::Vector<int> &tileSize) const;
61 void Update(float deltaT);
63 void Render(SDL_Surface *, const geometry::Vector<int> &offset) const;
66 void UpdateVelocity();
70 const graphics::Animation *animation;
71 graphics::AnimationRunner runner;
72 geometry::Vector<float> spriteOffset;
73 geometry::Vector<float> position;
74 geometry::Vector<float> velocity;
75 Orientation orientation;
82 #endif /* MAP_ENTITY_H_ */