--- deliantra/server/include/object.h 2007/08/25 22:19:26 1.145 +++ deliantra/server/include/object.h 2007/09/04 05:43:21 1.148 @@ -272,12 +272,13 @@ key_value *key_values; /* Fields not explictly known by the loader. */ bool parse_kv (object_thawer &f); // parse kv pairs, (ab-)used by archetypes, which should not exist at all - void post_load_check (); // do some adjustments after parsing + MTH void post_load_check (); // do some adjustments after parsing static object *read (object_thawer &f, maptile *map = 0); // map argument due to toal design bogosity, must go. bool write (object_freezer &f); MTH int slottype () const; MTH static object *create (); + const mapxy &operator =(const mapxy &pos); object &operator =(const object &src); MTH void copy_to (object *dst); MTH object *clone (); // create + copy_to @@ -297,6 +298,13 @@ do_remove (); } + void move_to (const mapxy &pos) + { + remove (); + *this = pos; + insert_at (this, this); + } + static bool can_merge_slow (object *op1, object *op2); // this is often used in time-critical code, so optimise @@ -498,6 +506,9 @@ void statusmsg (const char *msg, int color = NDI_BLACK); void failmsg (const char *msg, int color = NDI_RED); + MTH const_octet_string ref () const; // creates and returns a consistent persistent object reference + static object *deref (const_octet_string ref); // returns the object from the generated refreence, if possible + protected: void link (); void unlink (); @@ -559,16 +570,16 @@ void gather_callbacks (AV *&callbacks, event_type event) const; static archetype *read (object_thawer &f); - static archetype *get (const char *name); // find or create - static archetype *find (const char *name); - void link (); - void unlink (); + MTH static archetype *get (const_utf8_string name); // find or create + MTH static archetype *find (const_utf8_string name); + + MTH void link (); + MTH void unlink (); object_vector_index ACC (RW, archid); // index in archvector shstr ACC (RW, archname); /* More definite name, like "generate_kobold" */ bool ACC (RW, stub); // if true, this is an invalid archetype - uint32 ACC (RW, editable); /* editable flags (mainly for editor) */ sint8 ACC (RW, min_x), ACC (RW, min_y); /* extents, compared to the head (min_x, min_y should be zero, but aren't...) */ sint8 ACC (RW, max_x), ACC (RW, max_y);