18 Vector2(
float x,
float y) : x(x), y(y)
24 return Vector2(other.x + x, other.y + y);
28 return Vector2(other.x - x, other.y - y);
31 Vector2 operator*(
float scale)
const {
32 return Vector2(x * scale, y * scale);
36 return Vector2(x * other.x, y * other.y);
39 bool operator==(
const Vector2& other) {
40 return x == other.x && y == other.y;
43 bool operator<(
const Vector2& other)
const
45 return (x < other.x) && (y < other.y);