]> git.localhorst.tv Git - l2e.git/blobdiff - src/map/Entity.h
new language, new compiler
[l2e.git] / src / map / Entity.h
index d68861c7a60c5a7006aefe234abd39d26d3af294..44ba00f682c8eff04e574be39141dfe89902393b 100644 (file)
@@ -1,11 +1,17 @@
 #ifndef MAP_ENTITY_H_
 #define MAP_ENTITY_H_
 
-#include "../battle/fwd.h"
-#include "../battle/Monster.h"
+namespace app {
+       class Application;
+       class State;
+}
+namespace battle {
+       class Monster;
+       class PartyLayout;
+}
+
 #include "../math/Fixed.h"
 #include "../math/Vector.h"
-#include "../graphics/fwd.h"
 #include "../graphics/Animation.h"
 
 #include <functional>
@@ -74,12 +80,17 @@ public:
        /// west sprites at offsets (0,0), (1,0), (2,0), and (3,0) respectively.
        void SetSprite(const graphics::Sprite *s) { sprite = s; }
 
-       /// Change the entity's orientation to given one.
-       /// If the entity is moving, velocity is changed accordingly.
+       /// Change the entity's facing direction.
+       /// If the entity is moving, velocity is untouched.
        void SetOrientation(Orientation);
        Orientation GetOrientation() const { return orientation; }
+       /// Change the entity's orientation to given one.
+       /// If the entity is moving, velocity is changed accordingly.
+       /// Also changes the orientation to given direction.
+       void SetDirection(Orientation);
+       Orientation GetDirection() const { return direction; }
        /// Set the entity's speed in pixels per second.
-       /// This speed is then combined with the orientation to form a velocity.
+       /// This speed is then combined with the direction to form a velocity.
        void SetSpeed(math::Fixed<8>);
 
        /// Change to a natural, relaxed animation state (row offset 0).
@@ -151,6 +162,7 @@ private:
        math::Vector<int> tilePosition;
        math::Vector<math::Fixed<8> > position;
        math::Vector<math::Fixed<8> > velocity;
+       Orientation direction;
        Orientation orientation;
        math::Fixed<8> speed;
        int flags;
@@ -159,4 +171,4 @@ private:
 
 }
 
-#endif /* MAP_ENTITY_H_ */
+#endif