17 #include "../clib/cfgelem.h" 18 #include "../clib/logfacility.h" 19 #include "../clib/passert.h" 20 #include "../clib/rawtypes.h" 21 #include "../clib/refptr.h" 22 #include "../clib/streamsaver.h" 23 #include "../plib/systemstate.h" 43 std::ofstream
orphans_txt(
"orphans.txt", std::ios::out | std::ios::trunc );
61 for (
auto& obj : unreaped_orphan_instances )
162 if ( propname[0] !=
'#' )
169 if ( propname[0] !=
'#' )
249 if ( !
name_.get().empty() )
261 sw() <<
"\tZ\t" << (int)
z << pf_endl;
264 sw() <<
"\tFacing\t" <<
static_cast<int>(
facing ) << pf_endl;
267 if (
realm ==
nullptr )
268 sw() <<
"\tRealm\tbritannia" <<
pf_endl;
300 std::string realmstr = elem.
remove_string(
"Realm",
"britannia" );
304 ERROR_PRINT.Format(
"{} '{}' (0x{:X}): has an invalid realm property '{}'.\n" )
306 throw std::runtime_error(
"Data integrity error" );
319 setfacing( static_cast<unsigned char>( tmp ) );
362 "UOBject::SetGraphic used, object class does not have a graphic member! Object Serial: " 372 if (
color != newcolor )
void printProperties(Clib::StreamWriter &sw) const
void display_unreaped_orphan_instances()
static std::atomic< unsigned int > dirty_writes
std::string remove_string(const char *propname)
void setprop(const std::string &propname, const std::string &propvalue)
size_t estimateSizeDynProps() const
virtual bool setgraphic(u16 newobjtype)
UObject(u32 objtype, UOBJ_CLASS uobj_class)
unsigned int remove_ulong(const char *propname)
bool get(ENUM flag) const
int remove_int(const char *propname)
virtual UObject * owner()
size_t estimatedSize() const
virtual void fixInvalidGraphic()
Fixes invalid graphic, moving here to allow it to be overridden in subclass (see Multi) ...
void getpropnames(std::vector< std::string > &propnames) const
virtual void setfacing(u8 newfacing)=0
unsigned ref_counted_count() const
void eraseprop(const std::string &propname)
virtual size_t estimatedSize() const
const std::string name() const
virtual void on_color_changed()
unsigned short getgraphic(u32 objtype)
virtual const char * target_tag() const
bool getprop(const std::string &propname, std::string &propvalue) const
static std::atomic< unsigned int > clean_writes
std::ofstream orphans_txt("orphans.txt", std::ios::out|std::ios::trunc)
AttributeFlags< OBJ_FLAGS > flags_
virtual UObject * self_as_owner()
void eraseprop(const std::string &propname)
unsigned short height() const
void setprop(const std::string &propname, const std::string &propvalue)
std::set< UObject * > unreaped_orphan_instances
virtual void printSelfOn(Clib::StreamWriter &sw) const
virtual const char * classname() const =0
char tileheight(unsigned short tilenum)
void copyprops(const PropertyList &proplist)
const PropertyList & getprops() const
void readProperties(Clib::ConfigElem &elem)
virtual UObject * toplevel_owner()
void setname(const std::string &)
void getpropnames(std::vector< std::string > &propnames) const
unsigned int count() const
StateManager stateManager
Clib::StreamWriter & operator<<(Clib::StreamWriter &writer, const UObject &obj)
virtual void printOnDebug(Clib::StreamWriter &sw) const
virtual void on_facing_changed()
virtual void printDebugProperties(Clib::StreamWriter &sw) const
const UOBJ_CLASS uobj_class_
virtual void readProperties(Clib::ConfigElem &elem)
virtual void printOn(Clib::StreamWriter &) const
unsigned short width() const
unsigned short remove_ushort(const char *propname)
bool getprop(const std::string &propname, std::string &propvalue) const
Realms::Realm * find_realm(const std::string &name)
void change(ENUM flag, bool value)
virtual void printProperties(Clib::StreamWriter &sw) const
bool valid(unsigned short x, unsigned short y, short z) const
virtual bool setcolor(u16 newcolor)
void send_object_cache_to_inrange(const UObject *obj)
virtual std::string description() const
virtual std::string name() const
boost_utils::object_name_flystring name_
void copyprops(const UObject &obj)
int display_orphan(UObject *o)