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); }
59 bool Hostile() const {
60 // NOTE: this is a stub for testing!
64 Entity *Follower() { return follower; }
65 const Entity *Follower() const { return follower; }
66 void AddFollower(Entity *);
67 void RemoveFollower(Entity *);
69 bool TileLock(const geometry::Vector<int> &tileSize) const;
71 void Update(float deltaT);
73 void Render(SDL_Surface *, const geometry::Vector<int> &offset) const;
76 void UpdateVelocity();
80 const graphics::Animation *animation;
81 graphics::AnimationRunner runner;
82 geometry::Vector<float> spriteOffset;
83 geometry::Vector<float> position;
84 geometry::Vector<float> velocity;
85 Orientation orientation;
93 #endif /* MAP_ENTITY_H_ */