Rehti MMORPG  1.0.0
Rehti MMORPG is a free and open source MMORPG game.
Coordinates Struct Reference

Struct for coordinates. More...

#include <Coordinates.hpp>

Collaboration diagram for Coordinates:
Collaboration graph

Public Member Functions

 Coordinates (int x0=0, int y0=0)
 Construct a new Coordinates object. Z value is fetched based on the x and y values. More...
 
bool operator== (Coordinates &other)
 Check if coordinates match. More...
 
unsigned int distance (const Coordinates &other) const
 Calculate the euclidean distance between two Coordinates. More...
 

Public Attributes

int x
 
int y
 
int z
 

Friends

bool operator< (const Coordinates &l, const Coordinates &r)
 Compare coordinates. More...
 

Detailed Description

Struct for coordinates.

Constructor & Destructor Documentation

◆ Coordinates()

Coordinates::Coordinates ( int  x0 = 0,
int  y0 = 0 
)

Construct a new Coordinates object. Z value is fetched based on the x and y values.

Parameters
x0
y0
Here is the call graph for this function:

Member Function Documentation

◆ distance()

unsigned int Coordinates::distance ( const Coordinates other) const

Calculate the euclidean distance between two Coordinates.

Parameters
otherCoordinates
Returns
distance in integers
Here is the caller graph for this function:

◆ operator==()

bool Coordinates::operator== ( Coordinates other)

Check if coordinates match.

Parameters
otherCoordinates
Returns
bool

Friends And Related Function Documentation

◆ operator<

bool operator< ( const Coordinates l,
const Coordinates r 
)
friend

Compare coordinates.

Parameters
lCoordinates
rCoordinates
Returns
true if l < r. false if l >= r.

Member Data Documentation

◆ x

int Coordinates::x

◆ y

int Coordinates::y

◆ z

int Coordinates::z

The documentation for this struct was generated from the following files: