 |
Cytopia
0.3
A city building simulation game
|
Go to the documentation of this file.
59 return ((
x == coordinate.
x) && (std::abs(
y - coordinate.
y) <= 1)) ||
60 ((
y == coordinate.
y) && (std::abs(
x - coordinate.
x) <= 1));
87 const size_t operator()(
const Point &p)
const {
return std::hash<int>()(p.
x) ^ std::hash<int>()(p.
y); }
bool isNeighborOf(Point coordinate) const
Checks if a given point is a neighbor of this point.
int manhattanDistanceTo(Point target) const
Calculate the manhattan distance between this point and a given point.
int toIndex() const
calculates the index (stride) that can be used to access in Map to access mapNodes vector.
constexpr Point(int x, int y)
const size_t operator()(const Point &p) const
bool operator==(const Point &p) const
constexpr Point(int x, int y, int z)
bool operator!=(const Point &p) const
int mapSize
the size of the map
bool isWithinMapBoundaries() const
static constexpr Point INVALID()
constexpr Point(int x, int y, int z, int height)
int height
The height level.
static Settings & instance(void)
Get an instance of the singleton.
int distanceTo(Point target) const
Calculate the direct distance between this point and a given point.
bool isDirectNeighborOf(Point coordinate) const
Check if a given point is a direct neighbor (cardinal direction) of this point.
double rawHeight
The raw height.