mirror of
https://github.com/libSDL2pp/libSDL2pp.git
synced 2025-08-03 19:05:59 -04:00
Add memberwise remainter operators for Point
This commit is contained in:
parent
0215d2526e
commit
1001bf8fa2
@ -78,6 +78,10 @@ Point Point::operator/(int value) const {
|
|||||||
return Point(x / value, y / value);
|
return Point(x / value, y / value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Point Point::operator%(int value) const {
|
||||||
|
return Point(x % value, y % value);
|
||||||
|
}
|
||||||
|
|
||||||
Point Point::operator*(int value) const {
|
Point Point::operator*(int value) const {
|
||||||
return Point(x * value, y * value);
|
return Point(x * value, y * value);
|
||||||
}
|
}
|
||||||
@ -103,6 +107,13 @@ Point& Point::operator/=(int value) {
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Point& Point::operator%=(int value) {
|
||||||
|
x %= value;
|
||||||
|
y %= value;
|
||||||
|
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
Point& Point::operator*=(int value) {
|
Point& Point::operator*=(int value) {
|
||||||
x *= value;
|
x *= value;
|
||||||
y *= value;
|
y *= value;
|
||||||
|
@ -186,6 +186,16 @@ public:
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
Point operator/(int value) const;
|
Point operator/(int value) const;
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// \brief Get point's memberwise remainder from integer division
|
||||||
|
///
|
||||||
|
/// \param[in] value Divisor
|
||||||
|
///
|
||||||
|
/// \returns New Point representing memberwise remainder from point divided by an integer
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
Point operator%(int value) const;
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Get point's memberwise multiplication by an integer
|
/// \brief Get point's memberwise multiplication by an integer
|
||||||
///
|
///
|
||||||
@ -226,6 +236,16 @@ public:
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
Point& operator/=(int value);
|
Point& operator/=(int value);
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// \brief Memberwise remainder from integer division
|
||||||
|
///
|
||||||
|
/// \param[in] value Divisor
|
||||||
|
///
|
||||||
|
/// \returns Reference to self
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
Point& operator%=(int value);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Memberwise multiply by an integer
|
/// \brief Memberwise multiply by an integer
|
||||||
///
|
///
|
||||||
|
Loading…
x
Reference in New Issue
Block a user