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,
34 FLAG_NONBLOCKING = 0x01,
38 geometry::Vector<float> &Position() { return position; }
39 const geometry::Vector<float> &Position() const { return position; }
41 geometry::Vector<float> &Velocity() { return velocity; }
42 const geometry::Vector<float> &Velocity() const { return velocity; }
44 geometry::Vector<float> &SpriteOffset() { return spriteOffset; }
45 const geometry::Vector<float> &SpriteOffset() const { return spriteOffset; }
47 void SetAnimation(const graphics::Animation *a);
48 void StartAnimation(app::Application &ctrl);
49 void StartAnimation(app::State &ctrl);
51 bool AnimationRunning() const { return runner.Running(); }
53 void SetOrientation(Orientation);
54 Orientation GetOrientation() const { return orientation; }
57 void SetFlags(int f) { flags = f; }
58 bool Blocking() const { return !(flags & FLAG_NONBLOCKING); }
60 Entity *Follower() { return follower; }
61 const Entity *Follower() const { return follower; }
62 void AddFollower(Entity *);
63 void RemoveFollower(Entity *);
65 bool TileLock(const geometry::Vector<int> &tileSize) const;
67 void Update(float deltaT);
69 void Render(SDL_Surface *, const geometry::Vector<int> &offset) const;
72 void UpdateVelocity();
76 const graphics::Animation *animation;
77 graphics::AnimationRunner runner;
78 geometry::Vector<float> spriteOffset;
79 geometry::Vector<float> position;
80 geometry::Vector<float> velocity;
81 Orientation orientation;
89 #endif /* MAP_ENTITY_H_ */