first commit

This commit is contained in:
2026-06-05 11:45:04 +03:00
commit b457544071
29 changed files with 1725 additions and 0 deletions
+78
View File
@@ -0,0 +1,78 @@
#pragma once
#include <ostream>
class Vector2
{
using PointType = long long;
friend bool operator==(
const Vector2& lhs,
const Vector2& rhs
);
friend Vector2 operator+(
Vector2 lhs,
const Vector2& rhs
);
friend Vector2 operator-(
Vector2 lhs,
const Vector2& rhs
);
public:
Vector2();
Vector2(
PointType x,
PointType y
);
PointType x() const;
PointType y() const;
PointType& x();
PointType& y();
Vector2 operator*(
const PointType& rhs
) const;
Vector2& operator+=(
const Vector2& rhs
);
Vector2& operator-=(
const Vector2& rhs
);
private:
PointType m_X;
PointType m_Y;
};
bool operator==(
const Vector2& lhs,
const Vector2& rhs
);
bool operator!=(
const Vector2& lhs,
const Vector2& rhs
);
Vector2 operator+(
Vector2 lhs,
const Vector2& rhs
);
Vector2 operator-(
Vector2 lhs,
const Vector2& rhs
);
std::ostream& operator<<(
std::ostream& os,
const Vector2& obj
);