ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/include/object.h
(Generate patch)

Comparing deliantra/server/include/object.h (file contents):
Revision 1.145 by root, Sat Aug 25 22:19:26 2007 UTC vs.
Revision 1.148 by root, Tue Sep 4 05:43:21 2007 UTC

270 object *head; /* Points to the main object of a large body */ // NO ACC, perl semantics are different 270 object *head; /* Points to the main object of a large body */ // NO ACC, perl semantics are different
271 client_container *seen_by; // seen by which player/container currently? 271 client_container *seen_by; // seen by which player/container currently?
272 key_value *key_values; /* Fields not explictly known by the loader. */ 272 key_value *key_values; /* Fields not explictly known by the loader. */
273 273
274 bool parse_kv (object_thawer &f); // parse kv pairs, (ab-)used by archetypes, which should not exist at all 274 bool parse_kv (object_thawer &f); // parse kv pairs, (ab-)used by archetypes, which should not exist at all
275 void post_load_check (); // do some adjustments after parsing 275 MTH void post_load_check (); // do some adjustments after parsing
276 static object *read (object_thawer &f, maptile *map = 0); // map argument due to toal design bogosity, must go. 276 static object *read (object_thawer &f, maptile *map = 0); // map argument due to toal design bogosity, must go.
277 bool write (object_freezer &f); 277 bool write (object_freezer &f);
278 278
279 MTH int slottype () const; 279 MTH int slottype () const;
280 MTH static object *create (); 280 MTH static object *create ();
281 const mapxy &operator =(const mapxy &pos);
281 object &operator =(const object &src); 282 object &operator =(const object &src);
282 MTH void copy_to (object *dst); 283 MTH void copy_to (object *dst);
283 MTH object *clone (); // create + copy_to 284 MTH object *clone (); // create + copy_to
284 void do_destroy (); 285 void do_destroy ();
285 void gather_callbacks (AV *&callbacks, event_type event) const; 286 void gather_callbacks (AV *&callbacks, event_type event) const;
293 void do_remove (); 294 void do_remove ();
294 MTH void remove () 295 MTH void remove ()
295 { 296 {
296 if (!flag [FLAG_REMOVED]) 297 if (!flag [FLAG_REMOVED])
297 do_remove (); 298 do_remove ();
299 }
300
301 void move_to (const mapxy &pos)
302 {
303 remove ();
304 *this = pos;
305 insert_at (this, this);
298 } 306 }
299 307
300 static bool can_merge_slow (object *op1, object *op2); 308 static bool can_merge_slow (object *op1, object *op2);
301 309
302 // this is often used in time-critical code, so optimise 310 // this is often used in time-critical code, so optimise
496 MTH struct region *region () const; 504 MTH struct region *region () const;
497 505
498 void statusmsg (const char *msg, int color = NDI_BLACK); 506 void statusmsg (const char *msg, int color = NDI_BLACK);
499 void failmsg (const char *msg, int color = NDI_RED); 507 void failmsg (const char *msg, int color = NDI_RED);
500 508
509 MTH const_octet_string ref () const; // creates and returns a consistent persistent object reference
510 static object *deref (const_octet_string ref); // returns the object from the generated refreence, if possible
511
501protected: 512protected:
502 void link (); 513 void link ();
503 void unlink (); 514 void unlink ();
504 515
505 object (); 516 object ();
557 archetype (const char *name); 568 archetype (const char *name);
558 ~archetype (); 569 ~archetype ();
559 void gather_callbacks (AV *&callbacks, event_type event) const; 570 void gather_callbacks (AV *&callbacks, event_type event) const;
560 571
561 static archetype *read (object_thawer &f); 572 static archetype *read (object_thawer &f);
573
562 static archetype *get (const char *name); // find or create 574 MTH static archetype *get (const_utf8_string name); // find or create
563 static archetype *find (const char *name); 575 MTH static archetype *find (const_utf8_string name);
564 576
565 void link (); 577 MTH void link ();
566 void unlink (); 578 MTH void unlink ();
567 579
568 object_vector_index ACC (RW, archid); // index in archvector 580 object_vector_index ACC (RW, archid); // index in archvector
569 shstr ACC (RW, archname); /* More definite name, like "generate_kobold" */ 581 shstr ACC (RW, archname); /* More definite name, like "generate_kobold" */
570 bool ACC (RW, stub); // if true, this is an invalid archetype 582 bool ACC (RW, stub); // if true, this is an invalid archetype
571 uint32 ACC (RW, editable); /* editable flags (mainly for editor) */
572 583
573 sint8 ACC (RW, min_x), ACC (RW, min_y); /* extents, compared to the head (min_x, min_y should be zero, but aren't...) */ 584 sint8 ACC (RW, min_x), ACC (RW, min_y); /* extents, compared to the head (min_x, min_y should be zero, but aren't...) */
574 sint8 ACC (RW, max_x), ACC (RW, max_y); 585 sint8 ACC (RW, max_x), ACC (RW, max_y);
575}; 586};
576 587

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines