#pragma once #include struct Vector2Opts { unsigned int x; unsigned int y; }; /** * A 2D Vector. */ class Vector2 { public: /** * Creates a 2D vector. */ explicit Vector2(Vector2Opts opts); /** * Returns the X coordinate. */ [[nodiscard]] unsigned int x() const; /** * Sets the X coordinate. * * @param x A new X coordinate */ void x(unsigned int x); /** * Returns the Y coordinate. */ [[nodiscard]] unsigned int y() const; /** * Sets the Y coordinate. * * @param Y A new Y coordinate */ void y(unsigned int y); Vector2 operator*(const Vector2 &vector2) const; Vector2 operator+(const Vector2 &vector2) const; Vector2 operator-(const Vector2 &vector2) const; Vector2 &operator+=(const Vector2 &vector2); Vector2 &operator-=(const Vector2 &vector2); private: unsigned int _x; unsigned int _y; };