23#define KTECH_DEFINITION
24#include "../ktech.hpp"
25#undef KTECH_DEFINITION
39 constexpr Point(int32_t
x = 0, int32_t
y = 0)
47 :
x(uPoint.
x),
y(uPoint.
y) {}
56 return (
x == point.x) && (
y == point.y);
66 return {
x + point.x,
y + point.y};
76 return {
x - point.x,
y - point.y};
2D vector, mostly used to store positions and directions.
Definition point.hpp:30
int32_t y
Y axis (+ down, - up).
Definition point.hpp:32
constexpr auto operator+=(const Point &point) -> Point &
Add a Point to this Point.
Definition point.hpp:84
constexpr auto operator==(const Point &point) const -> bool
Compare 2 Points.
Definition point.hpp:54
constexpr auto operator-=(const Point &point) -> Point &
Subtract a Point from this Point.
Definition point.hpp:96
int32_t x
X axis (+ right, - left).
Definition point.hpp:31
constexpr Point(int32_t x=0, int32_t y=0)
Construct a Point.
Definition point.hpp:39
constexpr auto operator-(const Point &point) const -> Point
Subtract Point from another.
Definition point.hpp:74
constexpr Point(const UPoint &uPoint)
Construct a Point from a UPoint.
Definition point.hpp:46
constexpr auto operator+(const Point &point) const -> Point
Add 2 Points together.
Definition point.hpp:64
Unsigned 2D vector, mostly used to store sizes and 2D indexes.
Definition upoint.hpp:29