mirror of
https://github.com/PrimeDecomp/prime.git
synced 2025-12-12 23:26:07 +00:00
Match and link CVector2i
This commit is contained in:
23
src/Kyoto/Math/CVector2i.cpp
Normal file
23
src/Kyoto/Math/CVector2i.cpp
Normal file
@@ -0,0 +1,23 @@
|
||||
#include "Kyoto/Math/CVector2i.hpp"
|
||||
|
||||
CVector2i::CVector2i(int x, int y) : mX(x), mY(y) {}
|
||||
|
||||
CVector2i operator+(const CVector2i& lhs, const CVector2i& rhs) {
|
||||
return CVector2i(lhs.GetX() + rhs.GetX(), lhs.GetY() + rhs.GetY());
|
||||
}
|
||||
|
||||
CVector2i operator-(const CVector2i& lhs, const CVector2i& rhs) {
|
||||
return CVector2i(lhs.GetX() - rhs.GetX(), lhs.GetY() - rhs.GetY());
|
||||
}
|
||||
|
||||
bool operator==(const CVector2i& lhs, const CVector2i& rhs) {
|
||||
return lhs.GetX() == rhs.GetX() && lhs.GetY() == rhs.GetY();
|
||||
}
|
||||
|
||||
CVector2i operator*(const CVector2i& lhs, int rhs) {
|
||||
return CVector2i(lhs.GetX() * rhs, lhs.GetY() * rhs);
|
||||
}
|
||||
|
||||
CVector2i operator/(const CVector2i& lhs, int rhs) {
|
||||
return CVector2i(lhs.GetX() / rhs, lhs.GetY() / rhs);
|
||||
}
|
||||
Reference in New Issue
Block a user