18 #include <SDL2/SDL_rect.h> 27 constexpr
point() : SDL_Point{0, 0} {}
29 constexpr
point(
int x,
int y) : SDL_Point{x, y} {}
31 constexpr
point(
const SDL_Point&
p) : SDL_Point{p} {}
35 return x == point.x && y == point.y;
45 return std::tie(x, y) < std::tie(point.x, point.y);
50 return x < point.x || (x == point.x && y <= point.y);
55 return {x + point.x, y + point.y};
67 return {x - point.x, y - point.y};
79 return {x *
s, y * s};
91 return {x /
s, y / s};
105 return {x * p.x, y * p.y};
117 return {x / p.x, y / p.y};
constexpr point & operator/=(int s)
constexpr point operator*(const point &p) const
constexpr point(int x, int y)
constexpr point & operator*=(const point &p)
constexpr point operator*(int s) const
constexpr point operator/(const point &p) const
constexpr point & operator/=(const point &p)
constexpr point operator-(const point &point) const
constexpr point & operator+=(const point &point)
constexpr point()
Initialize to 0 by default.
constexpr point & operator-=(const point &point)
constexpr point & operator*=(int s)
constexpr bool operator<(const point &point) const
constexpr point(const SDL_Point &p)
constexpr point operator+(const point &point) const
static map_location::DIRECTION s
std::ostream & operator<<(std::ostream &stream, const point &point)
constexpr bool operator!=(const point &point) const
constexpr bool operator<=(const point &point) const
constexpr point operator/(int s) const
constexpr bool operator==(const point &point) const