Pol  Revision:cb584c9
Pol::Realms::Realm Class Reference

#include <realm.h>

Classes

struct  LosCache
 

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 (Plib::MapShapeList &shapes, unsigned short x, unsigned short y, unsigned int anyflags) const
 
Plib::MAPTILE_CELL getmaptile (unsigned short x, unsigned short y) const
 
unsigned getNumMapPatches () const
 
unsigned getNumStaticPatches () const
 
void getstatics (Plib::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::ULWObject &att, const Core::ULWObject &tgt) 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=nullptr)
 
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
 
void notify_entered (Mobile::Character &whoentered)
 
void notify_left (Mobile::Character &wholeft)
 
void notify_moved (Mobile::Character &whomoved)
 
void notify_resurrected (Mobile::Character &whoressed)
 
void notify_unhid (Mobile::Character &whounhid)
 
unsigned int offline_mobile_count () const
 
void readmultis (Plib::MapShapeList &vec, unsigned short x, unsigned short y, unsigned int flags) const
 
void readmultis (Plib::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=nullptr)
 
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=nullptr)
 
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

Multi::UMultifind_supporting_multi (MultiList &mvec, short z) const
 
bool los_blocked (const Core::ULWObject &att, const Core::ULWObject &target, unsigned short x, unsigned short y, short z, LosCache &cache) const
 
void readdynamics (Plib::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, LosCache &cache) const
 

Static Protected Member Functions

static bool dropheight (Plib::MapShapeList &shapes, short dropz, short chrz, short *newz)
 
static bool dynamic_item_blocks_los (unsigned short x, unsigned short y, short z, LosCache &cache)
 
static void lowest_standheight (Core::MOVEMODE movemode, Plib::MapShapeList &shapes, short oldz, bool *result, short *newz, short *gradual_boost=nullptr)
 
static void standheight (Core::MOVEMODE movemode, Plib::MapShapeList &shapes, short oldz, bool *result, short *newz, short *gradual_boost=nullptr)
 

Private Member Functions

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

Private Attributes

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

Detailed Description

Definition at line 58 of file realm.h.

Constructor & Destructor Documentation

Pol::Realms::Realm::Realm ( const std::string &  realm_name,
const std::string &  realm_path = "" 
)
explicit

Definition at line 27 of file realm.cpp.

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

Pol::Realms::Realm::Realm ( const std::string &  realm_name,
Realm realm 
)
explicit

Definition at line 49 of file realm.cpp.

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

Pol::Realms::Realm::~Realm ( )

Definition at line 69 of file realm.cpp.

References grid_width(), and zone.

Pol::Realms::Realm::Realm ( const Realm )
private

Member Function Documentation

void Pol::Realms::Realm::add_multi ( const Multi::UMulti multi)
inline

Definition at line 215 of file realm.h.

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

void Pol::Realms::Realm::add_toplevel_item ( const Items::Item item)
inline

Definition at line 206 of file realm.h.

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

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

Definition at line 515 of file realmfunc.cpp.

References Pol::Plib::FLAG::DROP_FLAGS.

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

bool Pol::Realms::Realm::dropheight ( Plib::MapShapeList shapes,
short  dropz,
short  chrz,
short *  newz 
)
staticprotected
unsigned int Pol::Realms::Realm::encode_global_hull ( unsigned short  ax,
unsigned short  ay 
)
inlinestatic
Multi::UMulti * Pol::Realms::Realm::find_supporting_multi ( MultiList mvec,
short  z 
) const
protected

Definition at line 728 of file realmfunc.cpp.

References Pol::Core::ULWObject::z.

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

Definition at line 744 of file realmfunc.cpp.

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

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

Definition at line 232 of file realm.h.

unsigned Pol::Realms::Realm::getNumStaticPatches ( ) const
inline

Definition at line 228 of file realm.h.

unsigned Pol::Realms::Realm::getUOMapID ( ) const
inline

Definition at line 224 of file realm.h.

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

bool Pol::Realms::Realm::groundheight ( unsigned short  x,
unsigned short  y,
short *  z 
) const
bool Pol::Realms::Realm::lowest_standheight ( unsigned short  x,
unsigned short  y,
short *  z 
) const
bool Pol::Realms::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 = nullptr 
)
unsigned int Pol::Realms::Realm::mobile_count ( ) const
inline
unsigned int Pol::Realms::Realm::multi_count ( ) const
inline
bool Pol::Realms::Realm::navigable ( unsigned short  x,
unsigned short  y,
short  z,
short  height = 0 
) const
void Pol::Realms::Realm::notify_entered ( Mobile::Character whoentered)
void Pol::Realms::Realm::notify_resurrected ( Mobile::Character whoressed)

Definition at line 157 of file realm.cpp.

References notify_unhid().

Referenced by Pol::Mobile::Character::resurrect().

void Pol::Realms::Realm::notify_unhid ( Mobile::Character whounhid)
unsigned int Pol::Realms::Realm::offline_mobile_count ( ) const
inline
Realm& Pol::Realms::Realm::operator= ( const Realm )
private
void Pol::Realms::Realm::remove_multi ( const Multi::UMulti multi)
inline

Definition at line 219 of file realm.h.

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

void Pol::Realms::Realm::remove_toplevel_item ( const Items::Item item)
inline

Definition at line 210 of file realm.h.

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

unsigned Pol::Realms::Realm::season ( ) const
size_t Pol::Realms::Realm::sizeEstimate ( ) const
unsigned int Pol::Realms::Realm::toplevel_item_count ( ) const
inline
bool Pol::Realms::Realm::valid ( unsigned short  x,
unsigned short  y,
short  z 
) const

Definition at line 119 of file realm.cpp.

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

Referenced by Pol::Core::BPacket::call_method_id(), Pol::Module::UOExecutorModule::internal_MoveItem(), 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_ListStaticsNearLocationOfType(), Pol::Module::UOExecutorModule::mf_ListStaticsNearLocationWithFlag(), 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(), 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().

Member Data Documentation

const Plib::RealmDescriptor Pol::Realms::Realm::_descriptor
private

Definition at line 170 of file realm.h.

Referenced by grid_height(), grid_width(), name(), season(), and sizeEstimate().

std::unique_ptr<Plib::MapServer> Pol::Realms::Realm::_mapserver
private

Definition at line 175 of file realm.h.

Referenced by sizeEstimate().

std::unique_ptr<Plib::MapTileServer> Pol::Realms::Realm::_maptileserver
private

Definition at line 177 of file realm.h.

Referenced by sizeEstimate().

unsigned int Pol::Realms::Realm::_mobile_count
private

Definition at line 171 of file realm.h.

Referenced by add_mobile(), and remove_mobile().

unsigned int Pol::Realms::Realm::_multi_count
private

Definition at line 174 of file realm.h.

unsigned int Pol::Realms::Realm::_offline_count
private

Definition at line 172 of file realm.h.

Referenced by add_mobile(), and remove_mobile().

std::unique_ptr<Plib::StaticServer> Pol::Realms::Realm::_staticserver
private

Definition at line 176 of file realm.h.

Referenced by sizeEstimate().

unsigned int Pol::Realms::Realm::_toplevel_item_count
private

Definition at line 173 of file realm.h.

Realm* Pol::Realms::Realm::baserealm

Definition at line 66 of file realm.h.

Referenced by Pol::Core::RegionGroupBase::getregionid(), and Pol::Core::setrealmif().

std::set<unsigned int> Pol::Realms::Realm::global_hulls
unsigned int Pol::Realms::Realm::shadowid

Definition at line 65 of file realm.h.

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

const std::string Pol::Realms::Realm::shadowname

Definition at line 67 of file realm.h.

Referenced by name(), and sizeEstimate().


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