1 /* Copyright (C) 2021 Wildfire Games.
2 * This file is part of 0 A.D.
4 * 0 A.D. is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 2 of the License, or
7 * (at your option) any later version.
9 * 0 A.D. is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
18 #ifndef INCLUDED_SIZE2D
19 #define INCLUDED_SIZE2D
22 * Provides an interface for a size - geometric property in R2.
28 CSize2D(const CSize2D
& size
);
29 CSize2D(const float width
, const float height
);
31 CSize2D
& operator=(const CSize2D
& size
);
32 bool operator==(const CSize2D
& size
) const;
33 bool operator!=(const CSize2D
& size
) const;
35 CSize2D
operator+(const CSize2D
& size
) const;
36 CSize2D
operator-(const CSize2D
& size
) const;
37 CSize2D
operator/(const float a
) const;
38 CSize2D
operator*(const float a
) const;
40 void operator+=(const CSize2D
& a
);
41 void operator-=(const CSize2D
& a
);
42 void operator/=(const float a
);
43 void operator*=(const float a
);
46 float Width
= 0.0f
, Height
= 0.0f
;
49 #endif // INCLUDED_SIZE2D