17 #ifndef HEADER_SUPERTUX_MATH_SIZE_HPP 18 #define HEADER_SUPERTUX_MATH_SIZE_HPP 32 Size(
int width_,
int height_) :
38 Size& operator=(
const Size& rhs) =
default;
42 Size& operator*=(
int factor)
49 Size& operator/=(
int divisor)
72 return width > 0 && height > 0;
80 inline Size operator*(
const Size& lhs,
int factor)
82 return Size(lhs.width * factor,
86 inline Size operator*(
int factor,
const Size& rhs)
88 return Size(rhs.width * factor,
92 inline Size operator/(
const Size& lhs,
int divisor)
94 return Size(lhs.width / divisor,
95 lhs.height / divisor);
100 return Size(lhs.width + rhs.width,
101 lhs.height + rhs.height);
106 return Size(lhs.width - rhs.width,
107 lhs.height - rhs.height);
110 inline bool operator==(
const Size& lhs,
const Size& rhs)
112 return (lhs.width == rhs.width) && (lhs.height == rhs.height);
115 inline bool operator!=(
const Size& lhs,
const Size& rhs)
117 return (lhs.width != rhs.width) || (lhs.height != rhs.height);
120 std::ostream& operator<<(std::ostream& s,
const Size& size);