blob: 95fd398786f0316e37d2b9e93e94659e9521608f (
plain) (
blame)
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
/* *******************************************************************
* Includes
* ******************************************************************/
#include "Coordinates.h"
/* *******************************************************************
* Defines
* ******************************************************************/
/* *******************************************************************
* Types definition
* ******************************************************************/
/* *******************************************************************
* Global variables definition
* ******************************************************************/
/* *******************************************************************
* Local variables definition
* ******************************************************************/
/* *******************************************************************
* Local prototypes declaration
* ******************************************************************/
/* *******************************************************************
* Functions definition
* ******************************************************************/
/*****************************************************************//**
*
* \brief Constructor for Coordinates class.
*
*********************************************************************/
Coordinates::Coordinates(const Coordinates::tPos x, const Coordinates::tPos y) :
_x(x),
_y(y)
{
}
/*****************************************************************//**
*
* \brief Reportedly, returns X coordinate position.
*
*********************************************************************/
Coordinates::tPos Coordinates::getX(void) const
{
return _x;
}
/*****************************************************************//**
*
* \brief Reportedly, returns Y coordinate position.
*
*********************************************************************/
Coordinates::tPos Coordinates::getY(void) const
{
return _y;
}
/*****************************************************************//**
*
* \brief This function adds X/Y coordinates to a Coordinates
* object. Overloaded function for \ref Coordinates objects.
*
* \param
*
*********************************************************************/
Coordinates Coordinates::operator+(const Coordinates& c) const
{
const Coordinates::tPos x = c.getX() + _x;
const Coordinates::tPos y = c.getY() + _y;
return Coordinates(x, y);
}
|