Pol  Revision:46daeab
Pol::Plib::Realm Class Reference

#include <realm.h>

+ Collaboration diagram for Pol::Plib::Realm:

List of all members.

Public Member Functions

 Realm (const std::string &realm_name, const std::string &realm_path="")
 Realm (const std::string &realm_name, Realm *realm)
 ~Realm ()
void add_mobile (const Mobile::Character &chr, WorldChangeReason reason)
void add_multi (const Multi::UMulti &multi)
void add_toplevel_item (const Items::Item &item)
bool dropheight (unsigned short dropx, unsigned short dropy, short dropz, short chrz, short *newz, Multi::UMulti **pmulti)
Multi::UMultifind_supporting_multi (unsigned short x, unsigned short y, short z) const
bool findstatic (unsigned short x, unsigned short y, unsigned short objtype) const
void getmapshapes (MapShapeList &shapes, unsigned short x, unsigned short y, unsigned int anyflags) const
MAPTILE_CELL getmaptile (unsigned short x, unsigned short y) const
unsigned getNumMapPatches () const
unsigned getNumStaticPatches () const
void getstatics (StaticEntryList &statics, unsigned short x, unsigned short y) const
unsigned getUOMapID () const
unsigned short grid_height () const
unsigned short grid_width () const
bool groundheight (unsigned short x, unsigned short y, short *z) const
bool has_los (const Core::LosObj &att, const Core::LosObj &tgt) const
bool has_los (const Core::UObject &iatt, const Core::UObject &itgt) const
bool has_los (const Mobile::Character &iatt, const Core::UObject &itgt) const
unsigned short height () const
bool lowest_standheight (unsigned short x, unsigned short y, short *z) const
bool lowest_walkheight (unsigned short x, unsigned short y, short oldz, short *newz, Multi::UMulti **pmulti, Items::Item **pwalkon, bool doors_block, Core::MOVEMODE movemode, short *gradual_boost=NULL)
unsigned int mobile_count () const
unsigned int multi_count () const
const std::string name () const
bool navigable (unsigned short x, unsigned short y, short z, short height) const
unsigned int offline_mobile_count () const
void readmultis (MapShapeList &vec, unsigned short x, unsigned short y, unsigned int flags) const
void readmultis (MapShapeList &vec, unsigned short x, unsigned short y, unsigned int flags, MultiList &mvec) const
void readmultis (Core::StaticList &vec, unsigned short x, unsigned short y) const
void remove_mobile (const Mobile::Character &chr, WorldChangeReason reason)
void remove_multi (const Multi::UMulti &multi)
void remove_toplevel_item (const Items::Item &item)
unsigned season () const
size_t sizeEstimate () const
unsigned int toplevel_item_count () const
bool valid (unsigned short x, unsigned short y, short z) const
bool walkheight (unsigned short x, unsigned short y, short oldz, short *newz, Multi::UMulti **pmulti, Items::Item **pwalkon, bool doors_block, Core::MOVEMODE movemode, short *gradual_boost=NULL)
bool walkheight (const Mobile::Character *chr, unsigned short x, unsigned short y, short oldz, short *newz, Multi::UMulti **pmulti, Items::Item **pwalkon, short *gradual_boost=NULL)
unsigned short width () const

Static Public Member Functions

static unsigned int encode_global_hull (unsigned short ax, unsigned short ay)

Public Attributes

Realmbaserealm
std::set< unsigned int > global_hulls
bool is_shadowrealm
unsigned int shadowid
const std::string shadowname
Core::Zone ** zone

Protected Member Functions

bool dynamic_item_blocks_los (const Core::LosObj &att, const Core::LosObj &target, unsigned short x, unsigned short y, short z) const
Multi::UMultifind_supporting_multi (MultiList &mvec, short z) const
bool los_blocked (const Core::LosObj &att, const Core::LosObj &target, unsigned short x, unsigned short y, short z) const
void readdynamics (MapShapeList &vec, unsigned short x, unsigned short y, Core::ItemsVector &walkon_items, bool doors_block)
bool static_item_blocks_los (unsigned short x, unsigned short y, short z) const

Static Protected Member Functions

static bool dropheight (MapShapeList &shapes, short dropz, short chrz, short *newz)
static void lowest_standheight (Core::MOVEMODE movemode, MapShapeList &shapes, short oldz, bool *result, short *newz, short *gradual_boost=NULL)
static void standheight (Core::MOVEMODE movemode, MapShapeList &shapes, short oldz, bool *result, short *newz, short *gradual_boost=NULL)

Private Member Functions

 Realm (const Realm &)
Realmoperator= (const Realm &)

Private Attributes

const RealmDescriptor _descriptor
std::unique_ptr< MapServer_mapserver
std::unique_ptr< MapTileServer_maptileserver
unsigned int _mobile_count
unsigned int _multi_count
unsigned int _offline_count
std::unique_ptr< StaticServer_staticserver
unsigned int _toplevel_item_count

Detailed Description

Definition at line 56 of file realm.h.


Constructor & Destructor Documentation

Pol::Plib::Realm::Realm ( const std::string &  realm_name,
const std::string &  realm_path = "" 
) [explicit]

Definition at line 29 of file realm.cpp.

References grid_height(), grid_width(), and zone.

+ Here is the call graph for this function:

Pol::Plib::Realm::Realm ( const std::string &  realm_name,
Realm realm 
) [explicit]

Definition at line 51 of file realm.cpp.

References grid_height(), grid_width(), and zone.

+ Here is the call graph for this function:

Definition at line 71 of file realm.cpp.

References grid_width(), and zone.

+ Here is the call graph for this function:

Pol::Plib::Realm::Realm ( const Realm ) [private]

Member Function Documentation

void Pol::Plib::Realm::add_multi ( const Multi::UMulti multi) [inline]

Definition at line 212 of file realm.h.

References _multi_count.

Referenced by Pol::Core::add_multi_to_world(), and Pol::Core::move_multi_in_world().

+ Here is the caller graph for this function:

void Pol::Plib::Realm::add_toplevel_item ( const Items::Item item) [inline]

Definition at line 205 of file realm.h.

References _toplevel_item_count.

Referenced by Pol::Core::add_item_to_world(), and Pol::Core::MoveItemWorldPosition().

+ Here is the caller graph for this function:

bool Pol::Plib::Realm::dropheight ( unsigned short  dropx,
unsigned short  dropy,
short  dropz,
short  chrz,
short *  newz,
Multi::UMulti **  pmulti 
)

Definition at line 516 of file realmfunc.cpp.

References Pol::Plib::FLAG::DROP_FLAGS, find_supporting_multi(), getmapshapes(), height(), readdynamics(), readmultis(), and width().

Referenced by Pol::Core::drop_item_on_ground(), and Pol::Plib::test_drop().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool Pol::Plib::Realm::dropheight ( MapShapeList shapes,
short  dropz,
short  chrz,
short *  newz 
) [static, protected]
bool Pol::Plib::Realm::dynamic_item_blocks_los ( const Core::LosObj att,
const Core::LosObj target,
unsigned short  x,
unsigned short  y,
short  z 
) const [protected]

Definition at line 59 of file realmlos.cpp.

References Pol::Plib::FLAG::BLOCKSIGHT, INFO_PRINT, Pol::Core::Zone::items, Pol::Core::LosObj::serial, Pol::Core::tile_flags(), zone, and Pol::Core::zone_convert_clip().

Referenced by los_blocked().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

unsigned int Pol::Plib::Realm::encode_global_hull ( unsigned short  ax,
unsigned short  ay 
) [inline, static]

Definition at line 231 of file realm.h.

Referenced by Pol::Multi::UBoat::navigable(), Pol::Multi::UBoat::regself(), and Pol::Multi::UBoat::unregself().

+ Here is the caller graph for this function:

Multi::UMulti * Pol::Plib::Realm::find_supporting_multi ( MultiList mvec,
short  z 
) const [protected]

Definition at line 739 of file realmfunc.cpp.

References Pol::Core::UObject::z.

bool Pol::Plib::Realm::findstatic ( unsigned short  x,
unsigned short  y,
unsigned short  objtype 
) const

Definition at line 756 of file realmfunc.cpp.

References _staticserver, baserealm, and is_shadowrealm.

Referenced by Pol::Core::ResourceDef::findmarker().

+ Here is the caller graph for this function:

void Pol::Plib::Realm::getmapshapes ( MapShapeList shapes,
unsigned short  x,
unsigned short  y,
unsigned int  anyflags 
) const
MAPTILE_CELL Pol::Plib::Realm::getmaptile ( unsigned short  x,
unsigned short  y 
) const

Definition at line 784 of file realmfunc.cpp.

References _maptileserver, baserealm, and is_shadowrealm.

Referenced by Pol::Core::ResourceDef::findmarker(), Pol::Core::map_test(), and Pol::Module::UOExecutorModule::mf_GetMapInfo().

+ Here is the caller graph for this function:

unsigned Pol::Plib::Realm::getNumMapPatches ( ) const [inline]

Definition at line 227 of file realm.h.

References _descriptor, and Pol::Plib::RealmDescriptor::num_map_patches.

unsigned Pol::Plib::Realm::getNumStaticPatches ( ) const [inline]

Definition at line 223 of file realm.h.

References _descriptor, and Pol::Plib::RealmDescriptor::num_static_patches.

void Pol::Plib::Realm::getstatics ( StaticEntryList statics,
unsigned short  x,
unsigned short  y 
) const
unsigned Pol::Plib::Realm::getUOMapID ( ) const [inline]

Definition at line 219 of file realm.h.

References _descriptor, and Pol::Plib::RealmDescriptor::uomapid.

Referenced by Pol::Core::send_realm_change(), and Pol::Module::SetupRealmDetails().

+ Here is the caller graph for this function:

bool Pol::Plib::Realm::groundheight ( unsigned short  x,
unsigned short  y,
short *  z 
) const

Definition at line 772 of file realmfunc.cpp.

References _maptileserver, Pol::Plib::FLAG::BLOCKING, GRAPHIC_NODRAW, Pol::Plib::MAPTILE_CELL::landtile, Pol::Core::landtile_flags(), Pol::Plib::MAPTILE_CELL::z, and Pol::Core::ZCOORD_MIN.

Referenced by Pol::Multi::move_to_ground().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool Pol::Plib::Realm::has_los ( const Core::UObject iatt,
const Core::UObject itgt 
) const
bool Pol::Plib::Realm::los_blocked ( const Core::LosObj att,
const Core::LosObj target,
unsigned short  x,
unsigned short  y,
short  z 
) const [protected]

Definition at line 131 of file realmlos.cpp.

References dynamic_item_blocks_los(), Pol::Core::LosObj::obj_height, static_item_blocks_los(), Pol::Core::LosObj::x, Pol::Core::LosObj::y, and Pol::Core::LosObj::z.

Referenced by has_los().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool Pol::Plib::Realm::lowest_standheight ( unsigned short  x,
unsigned short  y,
short *  z 
) const

Definition at line 60 of file realmfunc.cpp.

References Pol::Plib::FLAG::BLOCKING, getmapshapes(), Pol::Plib::FLAG::GRADUAL, Pol::Plib::FLAG::MOVELAND, Pol::Core::MOVEMODE_LAND, and Pol::Plib::FLAG::MOVESEA.

Referenced by lowest_walkheight(), and Pol::Module::UOExecutorModule::mf_GetWorldHeight().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool Pol::Plib::Realm::lowest_walkheight ( unsigned short  x,
unsigned short  y,
short  oldz,
short *  newz,
Multi::UMulti **  pmulti,
Items::Item **  pwalkon,
bool  doors_block,
Core::MOVEMODE  movemode,
short *  gradual_boost = NULL 
)
unsigned int Pol::Plib::Realm::mobile_count ( ) const [inline]

Definition at line 192 of file realm.h.

References _mobile_count.

Referenced by Pol::Module::PolSystemExecutorModule::mf_DeleteRealm(), and Pol::Module::SetupRealmDetails().

+ Here is the caller graph for this function:

unsigned int Pol::Plib::Realm::multi_count ( ) const [inline]

Definition at line 201 of file realm.h.

References _multi_count.

Referenced by Pol::Module::PolSystemExecutorModule::mf_DeleteRealm(), and Pol::Module::SetupRealmDetails().

+ Here is the caller graph for this function:

bool Pol::Plib::Realm::navigable ( unsigned short  x,
unsigned short  y,
short  z,
short  height = 0 
) const

Definition at line 686 of file realmfunc.cpp.

References Pol::Plib::FLAG::ALL, getmapshapes(), height(), HULL_HEIGHT_BUFFER, Pol::Plib::FLAG::MOVESEA, and valid().

Referenced by Pol::Multi::UBoat::navigable().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

unsigned int Pol::Plib::Realm::offline_mobile_count ( ) const [inline]

Definition at line 195 of file realm.h.

References _offline_count.

Referenced by Pol::Module::PolSystemExecutorModule::mf_DeleteRealm(), and Pol::Module::SetupRealmDetails().

+ Here is the caller graph for this function:

Realm& Pol::Plib::Realm::operator= ( const Realm ) [private]
void Pol::Plib::Realm::readdynamics ( MapShapeList vec,
unsigned short  x,
unsigned short  y,
Core::ItemsVector walkon_items,
bool  doors_block 
) [protected]
void Pol::Plib::Realm::readmultis ( MapShapeList vec,
unsigned short  x,
unsigned short  y,
unsigned int  flags,
MultiList mvec 
) const
void Pol::Plib::Realm::remove_multi ( const Multi::UMulti multi) [inline]

Definition at line 215 of file realm.h.

References _multi_count.

Referenced by Pol::Core::move_multi_in_world(), and Pol::Core::remove_multi_from_world().

+ Here is the caller graph for this function:

void Pol::Plib::Realm::remove_toplevel_item ( const Items::Item item) [inline]

Definition at line 208 of file realm.h.

References _toplevel_item_count.

Referenced by Pol::Core::MoveItemWorldPosition(), and Pol::Core::remove_item_from_world().

+ Here is the caller graph for this function:

unsigned Pol::Plib::Realm::season ( ) const

Definition at line 116 of file realm.cpp.

References _descriptor, and Pol::Plib::RealmDescriptor::season.

Referenced by Pol::Core::send_season_info(), and Pol::Module::SetupRealmDetails().

+ Here is the caller graph for this function:

void Pol::Plib::Realm::standheight ( Core::MOVEMODE  movemode,
MapShapeList shapes,
short  oldz,
bool *  result,
short *  newz,
short *  gradual_boost = NULL 
) [static, protected]
bool Pol::Plib::Realm::static_item_blocks_los ( unsigned short  x,
unsigned short  y,
short  z 
) const [protected]

Definition at line 92 of file realmlos.cpp.

References Pol::Plib::FLAG::BLOCKSIGHT, getmapshapes(), Pol::Plib::MapShape::height, INFO_PRINT, readmultis(), Pol::Core::tile_flags(), and Pol::Plib::MapShape::z.

Referenced by los_blocked().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

unsigned int Pol::Plib::Realm::toplevel_item_count ( ) const [inline]

Definition at line 198 of file realm.h.

References _toplevel_item_count.

Referenced by Pol::Module::PolSystemExecutorModule::mf_DeleteRealm(), and Pol::Module::SetupRealmDetails().

+ Here is the caller graph for this function:

bool Pol::Plib::Realm::valid ( unsigned short  x,
unsigned short  y,
short  z 
) const

Definition at line 121 of file realm.cpp.

References height(), width(), Pol::Core::ZCOORD_MAX, and Pol::Core::ZCOORD_MIN.

Referenced by Pol::Core::BPacket::call_method_id(), find_supporting_multi(), Pol::Module::UOExecutorModule::internal_MoveItem(), lowest_standheight(), Pol::Module::UOExecutorModule::mf_AssignRectToWeatherRegion(), Pol::Module::UOExecutorModule::mf_CheckLosAt(), Pol::Module::UOExecutorModule::mf_CheckLosBetween(), Pol::Module::UOExecutorModule::mf_CreateItemAtLocation(), Pol::Module::UOExecutorModule::mf_CreateItemCopyAtLocation(), Pol::Module::UOExecutorModule::mf_CreateMultiAtLocation(), Pol::Module::UOExecutorModule::mf_CreateNpcFromTemplate(), Pol::Module::UOExecutorModule::mf_FindPath(), Pol::Module::UOExecutorModule::mf_GetHarvestDifficulty(), Pol::Module::UOExecutorModule::mf_GetMapInfo(), Pol::Module::UOExecutorModule::mf_GetRegionLightLevelAtLocation(), Pol::Module::UOExecutorModule::mf_GetRegionNameAtLocation(), Pol::Module::UOExecutorModule::mf_GetRegionString(), Pol::Module::UOExecutorModule::mf_GetStandingHeight(), Pol::Module::UOExecutorModule::mf_GetStandingLayers(), Pol::Module::UOExecutorModule::mf_GetWorldHeight(), Pol::Module::UOExecutorModule::mf_HarvestResource(), Pol::Module::UOExecutorModule::mf_ListItemsAtLocation(), Pol::Module::UOExecutorModule::mf_ListItemsNearLocation(), Pol::Module::UOExecutorModule::mf_ListItemsNearLocationOfType(), Pol::Module::UOExecutorModule::mf_ListItemsNearLocationWithFlag(), Pol::Module::UOExecutorModule::mf_ListMobilesNearLocation(), Pol::Module::UOExecutorModule::mf_ListMobilesNearLocationEx(), Pol::Module::UOExecutorModule::mf_ListStaticsAtLocation(), Pol::Module::UOExecutorModule::mf_ListStaticsNearLocation(), Pol::Module::UOExecutorModule::mf_MoveObjectToLocation(), Pol::Module::UOExecutorModule::mf_PlayMovingEffectXyz(), Pol::Module::UOExecutorModule::mf_PlayMovingEffectXyz_Ex(), Pol::Module::UOExecutorModule::mf_PlaySoundEffectXYZ(), Pol::Module::UOExecutorModule::mf_PlayStationaryEffect(), Pol::Module::UOExecutorModule::mf_PlayStationaryEffect_Ex(), Pol::Module::NPCExecutorModule::mf_RunAwayFromLocation(), Pol::Module::NPCExecutorModule::mf_RunTowardLocation(), Pol::Module::UOExecutorModule::mf_SendQuestArrow(), Pol::Module::NPCExecutorModule::mf_SetAnchor(), Pol::Module::NPCExecutorModule::mf_TurnAwayFromLocation(), Pol::Module::NPCExecutorModule::mf_TurnTowardLocation(), Pol::Module::NPCExecutorModule::mf_WalkAwayFromLocation(), Pol::Module::NPCExecutorModule::mf_WalkTowardLocation(), navigable(), Pol::Core::UObject::readProperties(), Pol::Core::Map::script_method_id(), Pol::Multi::UBoat::script_method_id(), Pol::Items::Item::script_method_id(), and Pol::Multi::UHouse::scripted_create().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:


Member Data Documentation

std::unique_ptr<MapServer> Pol::Plib::Realm::_mapserver [private]

Definition at line 179 of file realm.h.

Referenced by getmapshapes(), and sizeEstimate().

std::unique_ptr<MapTileServer> Pol::Plib::Realm::_maptileserver [private]

Definition at line 181 of file realm.h.

Referenced by getmaptile(), groundheight(), and sizeEstimate().

unsigned int Pol::Plib::Realm::_mobile_count [private]

Definition at line 175 of file realm.h.

Referenced by add_mobile(), mobile_count(), and remove_mobile().

unsigned int Pol::Plib::Realm::_multi_count [private]

Definition at line 178 of file realm.h.

Referenced by add_multi(), multi_count(), and remove_multi().

unsigned int Pol::Plib::Realm::_offline_count [private]

Definition at line 176 of file realm.h.

Referenced by add_mobile(), offline_mobile_count(), and remove_mobile().

std::unique_ptr<StaticServer> Pol::Plib::Realm::_staticserver [private]

Definition at line 180 of file realm.h.

Referenced by findstatic(), getstatics(), and sizeEstimate().

Definition at line 177 of file realm.h.

Referenced by add_toplevel_item(), remove_toplevel_item(), and toplevel_item_count().

Definition at line 63 of file realm.h.

Referenced by Pol::Core::add_realm().

const std::string Pol::Plib::Realm::shadowname

Definition at line 65 of file realm.h.

Referenced by name(), and sizeEstimate().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines