diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2014-09-25 23:33:50 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2014-09-25 23:33:50 +0200 |
commit | 8b4ca336ce68cc17573115dd07eb1bfc6521b298 (patch) | |
tree | b0a6a457986da0a744c1394cc3788443a50ecaa8 /src/model/Map.hpp | |
parent | d82f3b7665435abefe84c8dbc16483acd235b478 (diff) | |
download | rpgedit-8b4ca336ce68cc17573115dd07eb1bfc6521b298.tar rpgedit-8b4ca336ce68cc17573115dd07eb1bfc6521b298.zip |
Differentiate between int and float positions
Diffstat (limited to 'src/model/Map.hpp')
-rw-r--r-- | src/model/Map.hpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/model/Map.hpp b/src/model/Map.hpp index c7b9783..4e434b1 100644 --- a/src/model/Map.hpp +++ b/src/model/Map.hpp @@ -58,13 +58,13 @@ protected: class Map : private _Map { private: struct EntityState { - Position position; + Position<int> position; Direction direction; uint64_t transitionStart = 0; uint64_t transitionEnd = 0; - EntityState(const Position &position0) : position(position0) {} + EntityState(const Position<int> &position0) : position(position0) {} }; std::vector<std::unique_ptr<Entity>> entities; @@ -123,7 +123,7 @@ public: return entities; } - Entity * addEntity(const std::string &name, const Position &pos) { + Entity * addEntity(const std::string &name, const Position<int> &pos) { Entity *e = new Entity(name); pushEntity(e, EntityState(pos)); setCollisionAt(pos.x, pos.y, BLOCKED); @@ -171,9 +171,9 @@ public: return tiles[layer][y*width + x]; } - Position getEntityPosition(const Entity *entity, uint64_t time) const; + Position<float> getEntityPosition(const Entity *entity, uint64_t time) const; bool moveEntity(Entity *entity, Direction dir, uint64_t start, uint64_t end); - void moveEntityTo(Entity *entity, Position pos); + void moveEntityTo(Entity *entity, Position<int> pos); void finishEntityTransition(Entity *entity); static std::unique_ptr<Map> load(const std::string &name); |