Line data Source code
1 : /* Copyright (C) 2021 Wildfire Games.
2 : * This file is part of 0 A.D.
3 : *
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.
8 : *
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.
13 : *
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/>.
16 : */
17 :
18 : #ifndef INCLUDED_SIZE2D
19 : #define INCLUDED_SIZE2D
20 :
21 : /*
22 : * Provides an interface for a size - geometric property in R2.
23 : */
24 8263 : class CSize2D
25 : {
26 : public:
27 : CSize2D();
28 : CSize2D(const CSize2D& size);
29 : CSize2D(const float width, const float height);
30 :
31 : CSize2D& operator=(const CSize2D& size);
32 : bool operator==(const CSize2D& size) const;
33 : bool operator!=(const CSize2D& size) const;
34 :
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;
39 :
40 : void operator+=(const CSize2D& a);
41 : void operator-=(const CSize2D& a);
42 : void operator/=(const float a);
43 : void operator*=(const float a);
44 :
45 : public:
46 : float Width = 0.0f, Height = 0.0f;
47 : };
48 :
49 : #endif // INCLUDED_SIZE2D
|