#include <map.h>
|
| MapCoords (int initx=0, int inity=0, int initz=0) |
|
| MapCoords (const Coords &a) |
|
MapCoords & | operator= (const Coords &a) |
|
bool | operator== (const MapCoords &a) const |
|
bool | operator!= (const MapCoords &a) const |
|
bool | operator< (const MapCoords &a) const |
|
MapCoords & | wrap (const class Map *map) |
|
MapCoords & | putInBounds (const class Map *map) |
|
MapCoords & | move (Direction d, const class Map *map=nullptr) |
|
MapCoords & | move (int dx, int dy, const class Map *map=nullptr) |
|
int | getRelativeDirection (const MapCoords &c, const class Map *map=nullptr) const |
|
Direction | pathTo (const MapCoords &c, int valid_dirs=MASK_DIR_ALL, bool towards=true, const class Map *map=nullptr) const |
|
Direction | pathAway (const MapCoords &c, int valid_dirs=MASK_DIR_ALL) const |
|
int | movementDistance (const MapCoords &c, const class Map *map=nullptr) const |
|
int | distance (const MapCoords &c, const class Map *map=nullptr) const |
|
| Coords (int initx=0, int inity=0, int initz=0) |
|
bool | operator== (const Coords &a) const |
|
bool | operator!= (const Coords &a) const |
|
◆ getRelativeDirection()
int Ultima::Ultima4::MapCoords::getRelativeDirection |
( |
const MapCoords & |
c, |
|
|
const class Map * |
map = nullptr |
|
) |
| const |
Returns a mask of directions that indicate where one point is relative to another. For instance, if the object at (x, y) is northeast of (c.x, c.y), then this function returns (MASK_DIR(DIR_NORTH) | MASK_DIR(DIR_EAST)) This function also takes into account map boundaries and adjusts itself accordingly. If the two coordinates are not on the same z-plane, then this function return DIR_NONE.
◆ pathTo()
Direction Ultima::Ultima4::MapCoords::pathTo |
( |
const MapCoords & |
c, |
|
|
int |
valid_dirs = MASK_DIR_ALL , |
|
|
bool |
towards = true , |
|
|
const class Map * |
map = nullptr |
|
) |
| const |
Finds the appropriate direction to travel to get from one point to another. This algorithm will avoid getting trapped behind simple obstacles, but still fails with anything mildly complicated. This function also takes into account map boundaries and adjusts itself accordingly, provided the 'map' parameter is passed
◆ pathAway()
Direction Ultima::Ultima4::MapCoords::pathAway |
( |
const MapCoords & |
c, |
|
|
int |
valid_dirs = MASK_DIR_ALL |
|
) |
| const |
Finds the appropriate direction to travel to move away from one point
◆ movementDistance()
int Ultima::Ultima4::MapCoords::movementDistance |
( |
const MapCoords & |
c, |
|
|
const class Map * |
map = nullptr |
|
) |
| const |
Finds the movement distance (not using diagonals) from point a to point b on a map, taking into account map boundaries and such. If the two coords are not on the same z-plane, then this function returns -1;
◆ distance()
int Ultima::Ultima4::MapCoords::distance |
( |
const MapCoords & |
c, |
|
|
const class Map * |
map = nullptr |
|
) |
| const |
Finds the distance (using diagonals) from point a to point b on a map If the two coordinates are not on the same z-plane, then this function returns -1. This function also takes into account map boundaries.
◆ nowhere()
static MapCoords Ultima::Ultima4::MapCoords::nowhere |
( |
| ) |
|
|
inlinestatic |
Returns true if the co-ordinates point to nowhere
The documentation for this class was generated from the following file:
- engines/ultima/ultima4/map/map.h