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<int> &SpriteOffset() { return spriteOffset; }
45 const geometry::Vector<int> &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;
75 static void CreateTypeDescription();
76 static void Construct(void *);
77 static void Load(void *);
80 void UpdateVelocity();
84 const graphics::Animation *animation;
85 graphics::AnimationRunner runner;
86 geometry::Vector<int> spriteOffset;
87 geometry::Vector<float> position;
88 geometry::Vector<float> velocity;
89 Orientation orientation;
97 #endif /* MAP_ENTITY_H_ */