1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
#if defined(Hiro_Position)
struct Position {
using type = Position;
Position();
Position(f32 x, f32 y);
template<typename X, typename Y>
Position(X x, Y y) : Position((f32)x, (f32)y) {}
explicit operator bool() const;
auto operator==(const Position& source) const -> bool;
auto operator!=(const Position& source) const -> bool;
auto reset() -> type&;
auto setPosition(Position position = {}) -> type&;
auto setPosition(f32 x, f32 y) -> type&;
auto setX(f32 x) -> type&;
auto setY(f32 y) -> type&;
auto x() const -> f32;
auto y() const -> f32;
//private:
struct State {
f32 x;
f32 y;
} state;
};
#endif
|