Fix the removal of implicit conversions in libfmt 10 by using explicit casts.
[0ad.git] / source / maths / Size2D.h
blob109991fb3c5edb652bfa91c320cb26cee9382771
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.
24 class CSize2D
26 public:
27 CSize2D();
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);
45 public:
46 float Width = 0.0f, Height = 0.0f;
49 #endif // INCLUDED_SIZE2D