forked from GameHackingBook/GameHackingCode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLocation-BasicMem.h
More file actions
50 lines (45 loc) · 803 Bytes
/
Copy pathLocation-BasicMem.h
File metadata and controls
50 lines (45 loc) · 803 Bytes
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
46
47
48
49
50
struct Location
{
int x;
int y;
Location(){}
Location(int x, int y)
{
this->x = x;
this->y = y;
}
const bool operator == (const Location &o)
{
return (o.x == this->x && o.y == this->y);
}
const bool operator != (const Location &o)
{
return !(*this == o);
}
const Location operator + (const Location &o)
{
return Location(this->x + o.x, this->y + o.y);
}
const Location operator - (const Location &o)
{
return Location(this->x - o.x, this->y - o.y);
}
const Location operator = (const Location &o)
{
this->x = o.x;
this->y = o.y;
return *this;
}
const Location operator += (const Location &o)
{
this->x += o.x;
this->y += o.y;
return *this;
}
const Location operator -= (const Location &o)
{
this->x -= o.x;
this->y -= o.y;
return *this;
}
};