22 #ifndef ULTIMA4_MAP_MAP_H 23 #define ULTIMA4_MAP_MAP_H 25 #include "ultima/ultima4/core/coords.h" 26 #include "ultima/ultima4/map/direction.h" 27 #include "ultima/ultima4/sound/music.h" 28 #include "ultima/ultima4/game/object.h" 29 #include "ultima/ultima4/filesys/savegame.h" 30 #include "ultima/ultima4/core/types.h" 35 #define MAP_IS_OOB(mapptr, c) (((c).x) < 0 || ((c).x) >= (static_cast<int>((mapptr)->_width)) || ((c).y) < 0 || ((c).y) >= (static_cast<int>((mapptr)->_height)) || ((c).z) < 0 || ((c).z) >= (static_cast<int>((mapptr)->_levels))) 47 typedef Std::vector<Portal *> PortalList;
49 typedef Std::vector<MapTile> MapData;
52 #define SHOW_AVATAR (1 << 0) 53 #define NO_LINE_OF_SIGHT (1 << 1) 54 #define FIRST_PERSON (1 << 2) 57 #define WITHOUT_OBJECTS 0 58 #define WITH_GROUND_OBJECTS 1 59 #define WITH_OBJECTS 2 66 MapCoords(
int initx = 0,
int inity = 0,
int initz = 0) :
Coords(initx, inity, initz) {}
75 bool operator==(
const MapCoords &a)
const;
76 bool operator!=(
const MapCoords &a)
const;
81 MapCoords &move(Direction d,
const class Map *map =
nullptr);
82 MapCoords &move(
int dx,
int dy,
const class Map *map =
nullptr);
102 Direction
pathTo(
const MapCoords &c,
int valid_dirs = MASK_DIR_ALL,
bool towards =
true,
const class Map *map =
nullptr)
const;
145 enum BorderBehavior {
154 Source() : _type(WORLD) {}
178 const Portal *portalAt(
const Coords &coords,
int actionFlags);
191 const Tile *tileTypeAt(
const Coords &coords,
int withObjects);
201 bool isEnclosed(
const Coords &party);
221 void removeObject(
const class Object *rem,
bool deleteObject =
true);
240 void resetObjectAnimations();
245 int getNumberOfCreatures();
251 bool move(
Object *obj, Direction d);
260 bool fillMonsterTable();
261 MapTile translateFromRawTileIndex(
int c)
const;
262 uint translateToRawTileIndex(
MapTile &tile)
const;
268 uint _width, _height, _levels;
269 uint _chunkWidth, _chunkHeight;
275 CompressedChunkList _compressedChunks;
276 BorderBehavior _borderBehavior;
297 Map &operator=(
const Map &map);
299 void findWalkability(
Coords coords,
int *path_data);
Definition: containers.h:186
int getRelativeDirection(const MapCoords &c, const class Map *map=nullptr) const
Definition: detection.h:27
Direction pathTo(const MapCoords &c, int valid_dirs=MASK_DIR_ALL, bool towards=true, const class Map *map=nullptr) const
Definition: map_tile.h:34
Definition: creature.h:159
Definition: savegame.h:214
int distance(const MapCoords &c, const class Map *map=nullptr) const
static MapCoords nowhere()
Definition: map.h:126
int movementDistance(const MapCoords &c, const class Map *map=nullptr) const
Definition: list_intern.h:51
Definition: annotation.h:135
Direction pathAway(const MapCoords &c, int valid_dirs=MASK_DIR_ALL) const