PGE Engine
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros Pages
pointf.h
1 /*
2  * Platformer Game Engine by Wohlstand, a free platform for game making
3  * Copyright (c) 2015 Vitaly Novichkov <admin@wohlnet.ru>
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef PGE_POINTF_H
20 #define PGE_POINTF_H
21 
22 class PGE_Point;
24 {
25  friend class PGE_Point;
26 public:
27  inline PGE_PointF() { setPoint(0, 0); }
28  inline PGE_PointF(const PGE_PointF &p) { _x=p._x; _y=p._y; }
29  PGE_PointF(const PGE_Point &p);
30  inline PGE_PointF(double x, double y) { _x=x; _y=y; }
31  inline ~PGE_PointF() {}
32  inline void setPoint(double x, double y) { _x=x; _y=y; }
33  inline void setX(double x) { _x=x; }
34  inline void setY(double y) { _y=y; }
35  inline bool isNull() { return ((_x==0)&&(_y==0)); }
36  inline double x() { return _x; }
37  inline double y() { return _y; }
38  friend bool operator==(const PGE_PointF& lhs, const PGE_PointF& rhs);
39  friend bool operator!=(const PGE_PointF& lhs, const PGE_PointF& rhs);
40 private:
41  double _x;
42  double _y;
43 };
44 
45 bool operator==(const PGE_PointF& lhs, const PGE_PointF& rhs);
46 bool operator!=(const PGE_PointF& lhs, const PGE_PointF& rhs);
47 
48 #endif // PGE_POINTF_H
Definition: pointf.h:23
Definition: point.h:23