Rehti MMORPG  1.0.0
Rehti MMORPG is a free and open source MMORPG game.
Coordinates.hpp
Go to the documentation of this file.
1 #pragma once
2 
6 struct Coordinates
7 {
14  Coordinates(int x0 = 0, int y0 = 0);
15 
16  int x;
17  int y;
18  int z;
19 
26  bool operator==(Coordinates& other);
27 
35  friend bool operator<(const Coordinates& l, const Coordinates& r);
36 
43  unsigned int distance(const Coordinates& other) const;
44 };
Struct for coordinates.
Definition: Coordinates.hpp:7
int x
Definition: Coordinates.hpp:16
Coordinates(int x0=0, int y0=0)
Construct a new Coordinates object. Z value is fetched based on the x and y values.
Definition: Coordinates.cpp:8
friend bool operator<(const Coordinates &l, const Coordinates &r)
Compare coordinates.
Definition: Coordinates.cpp:23
bool operator==(Coordinates &other)
Check if coordinates match.
Definition: Coordinates.cpp:18
unsigned int distance(const Coordinates &other) const
Calculate the euclidean distance between two Coordinates.
Definition: Coordinates.cpp:28
int y
Definition: Coordinates.hpp:17
int z
Definition: Coordinates.hpp:18