Added type alias for std::pair<uint8_t,uint8_t> for grid coordinates as sf::Vector2 cannot be used in std::map or std::set

This commit is contained in:
Teo-CD 2019-06-08 16:11:29 +02:00
parent 1a79679c21
commit f7481f2bc9
5 changed files with 24 additions and 12 deletions

View file

@ -49,13 +49,13 @@ public:
const sf::RectangleShape& getShape() const;
const State getState() const;
const sf::Vector2i getPosition() const;
const pro_maat::GridPos getPosition() const;
// Don't like it : iterates over every square every tick
const std::vector<std::pair<uint8_t, uint8_t>> getOccupiedSquares() const;
const std::vector<pro_maat::GridPos> getOccupiedSquares() const;
/// Position of the target of the current action on the map
sf::Vector2i target;
pro_maat::GridPos target;
private:
static const std::map<std::string,EntityType> entityTypeLookup;
@ -69,7 +69,7 @@ private:
State nextState;
/// Used with rules : last to update has priority
sf::Vector2i nextTarget;
pro_maat::GridPos nextTarget;
};