summaryrefslogtreecommitdiffstats
path: root/src/model/Entity.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/model/Entity.hpp')
-rw-r--r--src/model/Entity.hpp26
1 files changed, 6 insertions, 20 deletions
diff --git a/src/model/Entity.hpp b/src/model/Entity.hpp
index 1ff444a..170f23a 100644
--- a/src/model/Entity.hpp
+++ b/src/model/Entity.hpp
@@ -39,6 +39,8 @@ namespace RPGEdit {
namespace Model {
+class Map;
+
class Entity {
private:
const std::string name;
@@ -97,29 +99,13 @@ public:
return direction;
}
- void moveTo(Position newPos) {
- pos = newPos;
- transitionStart = transitionEnd = 0;
- }
-
- void move(Direction dir, uint64_t start, uint64_t end) {
- if (hasTransition())
- return;
-
- direction = dir;
-
- transitionStart = start;
- transitionEnd = end;
- }
-
- void finishTransition() {
- if (hasTransition())
- moveTo(translate(direction, 1));
- }
-
bool hasTransition() const {
return transitionEnd;
}
+
+ void moveTo(Map *map, Position newPos);
+ bool move(Map *map, Direction dir, uint64_t start, uint64_t end);
+ void finishTransition(Map *map);
};
}