76 lines
2.5 KiB
C++
76 lines
2.5 KiB
C++
/* *******************************************************************
|
|
* 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);
|
|
}
|