mirror of https://github.com/AxioDL/zeus.git
Some arithmetic operators for CVector2i
This commit is contained in:
parent
17a42c15e2
commit
caff50dfa5
|
@ -23,6 +23,23 @@ public:
|
|||
};
|
||||
CVector2i() = default;
|
||||
CVector2i(int xin, int yin) : x(xin), y(yin) {}
|
||||
|
||||
inline CVector2i operator+(const CVector2i& val) const
|
||||
{
|
||||
return CVector2i(x + val.x, y + val.y);
|
||||
}
|
||||
inline CVector2i operator-(const CVector2i& val) const
|
||||
{
|
||||
return CVector2i(x - val.x, y - val.y);
|
||||
}
|
||||
inline CVector2i operator*(const CVector2i& val) const
|
||||
{
|
||||
return CVector2i(x * val.x, y * val.y);
|
||||
}
|
||||
inline CVector2i operator/(const CVector2i& val) const
|
||||
{
|
||||
return CVector2i(x / val.x, y / val.y);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue