2021-06-24 14:04:09 -04:00
|
|
|
#pragma once
|
2021-08-11 15:00:28 -04:00
|
|
|
|
2021-06-24 14:04:09 -04:00
|
|
|
#include <SFML/System/Clock.hpp>
|
|
|
|
|
|
|
|
using microsec = sf::Int64;
|
2021-09-13 14:50:39 -04:00
|
|
|
using minute = int;
|
2021-06-24 14:04:09 -04:00
|
|
|
|
|
|
|
struct Coordinates
|
|
|
|
{
|
2021-08-09 14:59:40 -04:00
|
|
|
float x = 0.;
|
|
|
|
float y = 0.;
|
2021-06-24 14:04:09 -04:00
|
|
|
|
|
|
|
constexpr inline Coordinates operator+(const Coordinates& right) const noexcept
|
|
|
|
{
|
|
|
|
return {right.x + x, right.y + y};
|
|
|
|
}
|
|
|
|
|
|
|
|
constexpr inline Coordinates operator-(const Coordinates& right) const noexcept
|
|
|
|
{
|
|
|
|
return {right.x - x, right.y - y};
|
|
|
|
}
|
|
|
|
|
|
|
|
inline void moveBy(float x, float y) noexcept
|
|
|
|
{
|
|
|
|
this->x += x;
|
|
|
|
this->y += y;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline void moveBy(const Coordinates& right) noexcept
|
|
|
|
{
|
|
|
|
this->x += right.x;
|
|
|
|
this->y += right.y;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline void scale(float factor) noexcept
|
|
|
|
{
|
|
|
|
x *= factor;
|
|
|
|
y *= factor;
|
|
|
|
}
|
|
|
|
};
|