ScummVM API documentation
Ultima::Ultima4::Map Class Reference

#include <map.h>

Inheritance diagram for Ultima::Ultima4::Map:
Ultima::Ultima4::City Ultima::Ultima4::CombatMap Ultima::Ultima4::Dungeon Ultima::Ultima4::Shrine Ultima::Ultima4::XMLMap

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 ()
 
ObjectobjectAt (const Coords &coords)
 
const PortalportalAt (const Coords &coords, int actionFlags)
 
MapTilegetTileFromData (const Coords &coords)
 
MapTiletileAt (const Coords &coords, int withObjects)
 
const TiletileTypeAt (const Coords &coords, int withObjects)
 
bool isWorldMap ()
 
bool isEnclosed (const Coords &party)
 
CreatureaddCreature (const class Creature *m, Coords coords)
 
ObjectaddObject (MapTile tile, MapTile prevTile, Coords coords)
 
ObjectaddObject (Object *obj, Coords coords)
 
void removeObject (const class Object *rem, bool deleteObject=true)
 
ObjectDeque::iterator removeObject (ObjectDeque::iterator rem, bool deleteObject=true)
 
void clearObjects ()
 
CreaturemoveObjects (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]
 

Detailed Description

Map class

Member Function Documentation

◆ objectAt()

Object* Ultima::Ultima4::Map::objectAt ( const Coords coords)

Returns the object at the given (x,y,z) coords, if one exists. Otherwise, returns nullptr.

◆ portalAt()

const Portal* Ultima::Ultima4::Map::portalAt ( const Coords coords,
int  actionFlags 
)

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.

◆ getTileFromData()

MapTile* Ultima::Ultima4::Map::getTileFromData ( const Coords coords)

Returns the raw tile for the given (x,y,z) coords for the given map

◆ tileAt()

MapTile* Ultima::Ultima4::Map::tileAt ( const Coords coords,
int  withObjects 
)

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.)

◆ isWorldMap()

bool Ultima::Ultima4::Map::isWorldMap ( )

Returns true if the given map is the world map

◆ isEnclosed()

bool Ultima::Ultima4::Map::isEnclosed ( const Coords party)

Returns true if the map is enclosed (to see if gem layouts should cut themselves off)

◆ addCreature()

Creature* Ultima::Ultima4::Map::addCreature ( const class Creature m,
Coords  coords 
)

Adds a creature object to the given map

◆ addObject()

Object* Ultima::Ultima4::Map::addObject ( Object obj,
Coords  coords 
)

Adds an object to the given map

◆ removeObject()

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.

◆ clearObjects()

void Ultima::Ultima4::Map::clearObjects ( )

Removes all objects from the given map

◆ moveObjects()

Creature* Ultima::Ultima4::Map::moveObjects ( MapCoords  avatar)

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.

◆ resetObjectAnimations()

void Ultima::Ultima4::Map::resetObjectAnimations ( )

Resets object animations to a value that is acceptable for savegame compatibility with u4dos.

◆ getNumberOfCreatures()

int Ultima::Ultima4::Map::getNumberOfCreatures ( )

Returns the number of creatures on the given map

◆ getValidMoves()

int Ultima::Ultima4::Map::getValidMoves ( MapCoords  from,
MapTile  transport 
)

Returns a mask of valid moves for the given transport on the given map

◆ alertGuards()

void Ultima::Ultima4::Map::alertGuards ( )

Alerts the guards that the avatar is doing something bad


The documentation for this class was generated from the following file: