19 #include "../../plib/mapshape.h" 20 #include "../../plib/realmdescriptor.h" 21 #include "../uconst.h" 22 #include "../udatfile.h" 50 class StaticEntryList;
61 explicit Realm(
const std::string& realm_name,
const std::string& realm_path =
"" );
62 explicit Realm(
const std::string& realm_name,
Realm* realm );
69 unsigned short width()
const;
70 unsigned short height()
const;
71 unsigned short grid_width()
const;
72 unsigned short grid_height()
const;
74 unsigned season()
const;
76 bool valid(
unsigned short x,
unsigned short y,
short z )
const;
77 const std::string
name()
const;
90 void remove_toplevel_item(
const Items::Item& item );
95 unsigned int mobile_count()
const;
96 unsigned int offline_mobile_count()
const;
97 unsigned int toplevel_item_count()
const;
98 unsigned int multi_count()
const;
100 bool walkheight(
unsigned short x,
unsigned short y,
short oldz,
short* newz,
103 bool walkheight(
const Mobile::Character* chr,
unsigned short x,
unsigned short y,
short oldz,
105 short* gradual_boost =
nullptr );
107 bool lowest_walkheight(
unsigned short x,
unsigned short y,
short oldz,
short* newz,
111 bool dropheight(
unsigned short dropx,
unsigned short dropy,
short dropz,
short chrz,
short* newz,
116 bool navigable(
unsigned short x,
unsigned short y,
short z,
short height )
const;
118 Multi::UMulti* find_supporting_multi(
unsigned short x,
unsigned short y,
short z )
const;
120 bool lowest_standheight(
unsigned short x,
unsigned short y,
short* z )
const;
121 bool findstatic(
unsigned short x,
unsigned short y,
unsigned short objtype )
const;
123 bool groundheight(
unsigned short x,
unsigned short y,
short* z )
const;
126 unsigned int anyflags )
const;
128 unsigned int flags )
const;
129 void readmultis(
Plib::MapShapeList& vec,
unsigned short x,
unsigned short y,
unsigned int flags,
130 MultiList& mvec )
const;
131 void readmultis(
Core::StaticList& vec,
unsigned short x,
unsigned short y )
const;
135 unsigned getUOMapID()
const;
136 unsigned getNumStaticPatches()
const;
137 unsigned getNumMapPatches()
const;
138 static unsigned int encode_global_hull(
unsigned short ax,
unsigned short ay );
143 LosCache() : last_x( 0 ), last_y( 0 ), shapes(), dyn_items(){};
144 unsigned short last_x;
151 bool* result,
short* newz,
short* gradual_boost =
nullptr );
154 bool* result,
short* newz,
short* gradual_boost =
nullptr );
156 static bool dropheight(
Plib::MapShapeList& shapes,
short dropz,
short chrz,
short* newz );
161 static bool dynamic_item_blocks_los(
unsigned short x,
unsigned short y,
short z,
163 bool static_item_blocks_los(
unsigned short x,
unsigned short y,
short z,
LosCache& cache )
const;
165 unsigned short y,
short z,
LosCache& cache )
const;
167 Multi::UMulti* find_supporting_multi( MultiList& mvec,
short z )
const;
185 size_t sizeEstimate()
const;
189 inline unsigned int Realm::mobile_count()
const 191 return _mobile_count;
193 inline unsigned int Realm::offline_mobile_count()
const 195 return _offline_count;
197 inline unsigned int Realm::toplevel_item_count()
const 199 return _toplevel_item_count;
201 inline unsigned int Realm::multi_count()
const 208 ++_toplevel_item_count;
212 --_toplevel_item_count;
224 inline unsigned Realm::getUOMapID()
const 226 return _descriptor.uomapid;
228 inline unsigned Realm::getNumStaticPatches()
const 230 return _descriptor.num_static_patches;
232 inline unsigned Realm::getNumMapPatches()
const 234 return _descriptor.num_map_patches;
236 inline unsigned int Realm::encode_global_hull(
unsigned short ax,
unsigned short ay )
238 return ( static_cast<unsigned int>( ax ) << 16 ) | ay;
241 inline unsigned short Realm::width()
const 243 return _descriptor.width;
245 inline unsigned short Realm::height()
const 247 return _descriptor.height;
void add_multi(unsigned int objtype, unsigned short x, unsigned short y, short z)
std::vector< StaticRec > StaticList
unsigned int _toplevel_item_count
unsigned int _multi_count
std::unique_ptr< Plib::MapServer > _mapserver
const std::string shadowname
void standheight(MOVEMODE movemode, StaticList &statics, unsigned short x, unsigned short y, short oldz, bool *result_out, short *newz_out)
std::unique_ptr< Plib::StaticServer > _staticserver
std::vector< Items::Item * > dyn_items
bool groundheight(unsigned short x, unsigned short y, short *z)
unsigned int _mobile_count
std::vector< Multi::UMulti * > MultiList
bool findstatic(unsigned short x, unsigned short y, unsigned short graphic)
std::set< unsigned int > global_hulls
std::unique_ptr< Plib::MapTileServer > _maptileserver
unsigned int _offline_count
Plib::MapShapeList shapes
const Plib::RealmDescriptor _descriptor