ScummVM API documentation
Ultima::Ultima8::CurrentMap Class Reference

Classes

struct  SweepItem
 

Public Member Functions

void clear ()
 
void writeback ()
 
void loadMap (Map *map)
 
void setMap (Map *map)
 
uint32 getNum () const
 Get the map number of the CurrentMap.
 
unsigned int getChunkSize () const
 
void addItem (Item *item)
 Add an item to the beginning of the item list.
 
void addItemToEnd (Item *item)
 Add an item to the end of the item list.
 
void removeItemFromList (Item *item, int32 oldx, int32 oldy)
 
void removeItem (Item *item)
 
void addTargetItem (const Item *item)
 Add an item to the list of possible targets (in Crusader)
 
void removeTargetItem (const Item *item)
 Remove an item from the list of possible targets (in Crusader)
 
ItemfindBestTargetItem (int32 x, int32 y, int32 z, Direction dir, DirectionMode dirmode)
 Find the best target item in the given direction from the given start point.
 
void updateFastArea (const Point3 &from, const Point3 &to)
 Update the fast area for the cameras position.
 
void areaSearch (UCList *itemlist, const uint8 *loopscript, uint32 scriptsize, const Item *item, uint16 range, bool recurse, int32 x=0, int32 y=0) const
 
void surfaceSearch (UCList *itemlist, const uint8 *loopscript, uint32 scriptsize, const Item *item, bool above, bool below, bool recurse=false) const
 
PositionInfo getPositionInfo (const Box &target, const Box &start, uint32 shapeflags, ObjId id) const
 
PositionInfo getPositionInfo (int32 x, int32 y, int32 z, uint32 shape, ObjId id) const
 
bool scanForValidPosition (int32 x, int32 y, int32 z, const Item *item, Direction movedir, bool wantsupport, int32 &tx, int32 &ty, int32 &tz)
 Scan for a valid position for item in directions orthogonal to movedir.
 
bool sweepTest (const Point3 &start, const Point3 &end, const int32 dims[3], uint32 shapeflags, ObjId item, bool solid_only, Std::list< SweepItem > *hit) const
 
TeleportEggfindDestination (uint16 id)
 
const Std::list< Item * > * getItemList (int32 gx, int32 gy) const
 
bool isChunkFast (int32 cx, int32 cy) const
 
void setFastAtPoint (const Point3 &pt)
 
void setWholeMapFast ()
 
void save (Common::WriteStream *ws)
 
bool load (Common::ReadStream *rs, uint32 version)
 
 INTRINSIC (I_canExistAt)
 
 INTRINSIC (I_canExistAtPoint)
 

Member Function Documentation

◆ setMap()

void Ultima::Ultima8::CurrentMap::setMap ( Map map)
inline

sets the currently loaded map, without any processing. (Should only be used for loading.)

◆ areaSearch()

void Ultima::Ultima8::CurrentMap::areaSearch ( UCList itemlist,
const uint8 *  loopscript,
uint32  scriptsize,
const Item item,
uint16  range,
bool  recurse,
int32  x = 0,
int32  y = 0 
) const

search an area for items matching a loopscript

Parameters
itemlistthe list to return objids in
loopscriptthe script to check items against
scriptsizethe size (in bytes) of the loopscript
itemthe item around which you want to search, or 0. if item is 0, search around (x,y)
rangethe (square) range to search
recurseif true, search in containers too
xx coordinate of search center if item is 0.
yy coordinate of search center if item is 0.

◆ sweepTest()

bool Ultima::Ultima8::CurrentMap::sweepTest ( const Point3 start,
const Point3 end,
const int32  dims[3],
uint32  shapeflags,
ObjId  item,
bool  solid_only,
Std::list< SweepItem > *  hit 
) const

Perform a sweepTest for an item move

Parameters
startStart point to sweep from.
endEnd point to sweep to.
dimsBounding size of item to check.
shapeflagsshapeflags of item to check.
itemObjId of the item being checked. This will allow item to be skipped from being tested against. Use 0 for no item.
solid_onlyIf true, only test solid items.
hitPointer to a list to fill with items hit. Items are sorted by SweepItem::hit_time
Returns
false if no items were hit. true if any items were hit.

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