#include <map.h>
Classes | |
class | Source |
Public Types | |
enum | Type { WORLD, CITY, SHRINE, COMBAT, DUNGEON, XML } |
enum | BorderBehavior { BORDER_WRAP, BORDER_EXIT2PARENT, BORDER_FIXED } |
Public Member Functions | |
virtual Common::String | getName () |
Object * | objectAt (const Coords &coords) |
const Portal * | portalAt (const Coords &coords, int actionFlags) |
MapTile * | getTileFromData (const Coords &coords) |
MapTile * | tileAt (const Coords &coords, int withObjects) |
const Tile * | tileTypeAt (const Coords &coords, int withObjects) |
bool | isWorldMap () |
bool | isEnclosed (const Coords &party) |
Creature * | addCreature (const class Creature *m, Coords coords) |
Object * | addObject (MapTile tile, MapTile prevTile, Coords coords) |
Object * | addObject (Object *obj, Coords coords) |
void | removeObject (const class Object *rem, bool deleteObject=true) |
ObjectDeque::iterator | removeObject (ObjectDeque::iterator rem, bool deleteObject=true) |
void | clearObjects () |
Creature * | moveObjects (MapCoords avatar) |
void | resetObjectAnimations () |
int | getNumberOfCreatures () |
int | getValidMoves (MapCoords from, MapTile transport) |
bool | move (Object *obj, Direction d) |
void | alertGuards () |
MapCoords | getLabel (const Common::String &name) const |
bool | fillMonsterTable () |
MapTile | translateFromRawTileIndex (int c) const |
uint | translateToRawTileIndex (MapTile &tile) const |
Public Attributes | |
MapId | _id |
Common::Path | _fname |
Type | _type |
uint | _width |
uint | _height |
uint | _levels |
uint | _chunkWidth |
uint | _chunkHeight |
uint | _offset |
Source | _baseSource |
Common::List< Source > | _extraSources |
CompressedChunkList | _compressedChunks |
BorderBehavior | _borderBehavior |
PortalList | _portals |
AnnotationMgr * | _annotations |
int | _flags |
Music::Type | _music |
MapData | _data |
ObjectDeque | _objects |
Common::HashMap< Common::String, MapCoords > | _labels |
Tileset * | _tileSet |
TileMap * | _tileMap |
MapTile | _blank |
SaveGameMonsterRecord | _monsterTable [MONSTERTABLE_SIZE] |
Map class
Returns the object at the given (x,y,z) coords, if one exists. Otherwise, returns nullptr.
Returns the portal for the correspoding action(s) given. If there is no portal that corresponds to the actions flagged by 'actionFlags' at the given (x,y,z) coords, it returns nullptr.
Returns the raw tile for the given (x,y,z) coords for the given map
Returns the current ground tile at the given point on a map. Visual-only annotations like moongates and attack icons are ignored. Any walkable tiles are taken into account (treasure chests, ships, balloon, etc.)
bool Ultima::Ultima4::Map::isWorldMap | ( | ) |
Returns true if the given map is the world map
bool Ultima::Ultima4::Map::isEnclosed | ( | const Coords & | party | ) |
Returns true if the map is enclosed (to see if gem layouts should cut themselves off)
Adds a creature object to the given map
Adds an object to the given map
void Ultima::Ultima4::Map::removeObject | ( | const class Object * | rem, |
bool | deleteObject = true |
||
) |
Removes an object from the map
This function should only be used when not iterating through an ObjectDeque, as the iterator will be invalidated and the results will be unpredictable. Instead, use the function below.
void Ultima::Ultima4::Map::clearObjects | ( | ) |
Removes all objects from the given map
Moves all of the objects on the given map. Returns an attacking object if there is a creature attacking. Also performs special creature actions and creature effects.
void Ultima::Ultima4::Map::resetObjectAnimations | ( | ) |
Resets object animations to a value that is acceptable for savegame compatibility with u4dos.
int Ultima::Ultima4::Map::getNumberOfCreatures | ( | ) |
Returns the number of creatures on the given map
Returns a mask of valid moves for the given transport on the given map
void Ultima::Ultima4::Map::alertGuards | ( | ) |
Alerts the guards that the avatar is doing something bad