-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathPoint.cpp
45 lines (36 loc) · 866 Bytes
/
Point.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include "Point.h"
namespace Engine
{
Point::Point(void)
: X(0), Y(0)
{ }
Point::Point(int x, int y)
: X(x), Y(y)
{ }
bool Point::operator<(const Point &other) const
{
return (this->X < other.X) && (this->Y < other.Y);
}
bool Point::operator<=(const Point &other) const
{
return (this->X <= other.X) && (this->Y <= other.Y);
}
bool Point::operator>(const Point &other) const
{
return (this->X > other.X) && (this->Y > other.Y);
}
bool Point::operator>=(const Point &other) const
{
return (this->X >= other.X) && (this->Y >= other.Y);
}
bool Point::operator==(const Point &other) const
{
return (this->X == other.X) && (this->Y == other.Y);
}
bool Point::operator!=(const Point &other) const
{
return (this->X != other.X) || (this->Y != other.Y);
}
Point::~Point(void)
{ }
}