pacman/lib/Position.hpp

30 lines
486 B
C++
Raw Normal View History

2021-06-10 12:42:51 +00:00
#pragma once
2020-11-27 13:10:09 +00:00
#include <SFML/Graphics.hpp>
2021-06-16 11:59:16 +00:00
2020-11-27 13:10:09 +00:00
struct Position {
2021-07-05 09:40:10 +00:00
double x;
double y;
2020-11-27 13:10:09 +00:00
};
2021-06-16 11:59:16 +00:00
struct PositionInt {
int x;
int y;
};
using Rect = sf::Rect<int>;
using Sprite = sf::Sprite;
inline bool operator==(const PositionInt & b, const Position & a) {
2021-06-16 11:59:16 +00:00
return a.x == b.x && a.y == b.y;
}
inline bool operator==(const Position & a, const Position & b) {
return a.x == b.x && a.y == b.y;
}
inline bool operator!=(const Position & a, const Position & b) {
return !(a == b);
}