|
|
|
@ -194,7 +194,7 @@ |
|
|
|
|
|
|
|
|
|
Author |
|
|
|
|
~~~~~~ |
|
|
|
|
David Barr, aka javidx9, ©OneLoneCoder 2018, 2019, 2020, 2021 |
|
|
|
|
David Barr, aka javidx9, ©OneLoneCoder 2018, 2019, 2020, 2021 |
|
|
|
|
*/ |
|
|
|
|
#pragma endregion |
|
|
|
|
|
|
|
|
@ -637,6 +637,10 @@ namespace olc |
|
|
|
|
v2d_generic operator - () const { return { -x, -y }; } |
|
|
|
|
bool operator == (const v2d_generic& rhs) const { return (this->x == rhs.x && this->y == rhs.y); } |
|
|
|
|
bool operator != (const v2d_generic& rhs) const { return (this->x != rhs.x || this->y != rhs.y); } |
|
|
|
|
bool operator < (const v2d_generic& rhs) const { return (this->x < rhs.x && this->y < rhs.y); } |
|
|
|
|
bool operator > (const v2d_generic& rhs) const { return (this->x > rhs.x && this->y > rhs.y); } |
|
|
|
|
bool operator <= (const v2d_generic& rhs) const { return (this->x <= rhs.x && this->y <= rhs.y); } |
|
|
|
|
bool operator >= (const v2d_generic& rhs) const { return (this->x >= rhs.x && this->y >= rhs.y); } |
|
|
|
|
const std::string str() const { return std::string("(") + std::to_string(this->x) + "," + std::to_string(this->y) + ")"; } |
|
|
|
|
friend std::ostream& operator << (std::ostream& os, const v2d_generic& rhs) { os << rhs.str(); return os; } |
|
|
|
|
operator v2d_generic<int32_t>() const { return { static_cast<int32_t>(this->x), static_cast<int32_t>(this->y) }; } |
|
|
|
|