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.141 by root, Wed Aug 1 19:15:50 2007 UTC vs.
Revision 1.147 by root, Thu Aug 30 05:37:58 2007 UTC

250 UUID ACC (RW, uuid); // Unique Identifier, survives saves etc. 250 UUID ACC (RW, uuid); // Unique Identifier, survives saves etc.
251 int ACC (RO, count); 251 int ACC (RO, count);
252 object_vector_index ACC (RO, index); // index into objects 252 object_vector_index ACC (RO, index); // index into objects
253 object_vector_index ACC (RO, active); // index into actives 253 object_vector_index ACC (RO, active); // index into actives
254 254
255 player_ptr ACC (RW, contr); /* Pointer to the player which control this object */ 255 player_ptr ACC (RW, contr); /* Pointer to the player which control this object, ALWAYS set *iff* type == PLAYER */
256 256
257 object *ACC (RW, below); /* Pointer to the object stacked below this one */ 257 object *ACC (RW, below); /* Pointer to the object stacked below this one */
258 object *ACC (RW, above); /* Pointer to the object stacked above this one */ 258 object *ACC (RW, above); /* Pointer to the object stacked above this one */
259 /* Note: stacked in the *same* environment */ 259 /* Note: stacked in the *same* environment */
260 object *inv; /* Pointer to the first object in the inventory */ 260 object *inv; /* Pointer to the first object in the inventory */
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
383 391
384 // temporary: wether the object can be saved in a map file 392 // temporary: wether the object can be saved in a map file
385 // contr => is a player 393 // contr => is a player
386 // head => only save head of a multitile object 394 // head => only save head of a multitile object
387 // owner => can not reference owner yet 395 // owner => can not reference owner yet
388 MTH bool can_map_save () const { return !contr && !head && !owner && !flag [FLAG_NO_MAP_SAVE]; } 396 MTH bool can_map_save () const { return !head && (!owner || owner->contr) && !contr && !flag [FLAG_NO_MAP_SAVE]; }
389 397
390 /* This return true if object has still randomitems which 398 /* This return true if object has still randomitems which
391 * could be expanded. 399 * could be expanded.
392 */ 400 */
393 MTH bool has_random_items () const { return randomitems && !flag [FLAG_IS_A_TEMPLATE]; } 401 MTH bool has_random_items () const { return randomitems && !flag [FLAG_IS_A_TEMPLATE]; }
492 { 500 {
493 return !invisible && type != PLAYER; 501 return !invisible && type != PLAYER;
494 } 502 }
495 503
496 MTH struct region *region () const; 504 MTH struct region *region () const;
505
506 void statusmsg (const char *msg, int color = NDI_BLACK);
507 void failmsg (const char *msg, int color = NDI_RED);
497 508
498protected: 509protected:
499 void link (); 510 void link ();
500 void unlink (); 511 void unlink ();
501 512
563 void unlink (); 574 void unlink ();
564 575
565 object_vector_index ACC (RW, archid); // index in archvector 576 object_vector_index ACC (RW, archid); // index in archvector
566 shstr ACC (RW, archname); /* More definite name, like "generate_kobold" */ 577 shstr ACC (RW, archname); /* More definite name, like "generate_kobold" */
567 bool ACC (RW, stub); // if true, this is an invalid archetype 578 bool ACC (RW, stub); // if true, this is an invalid archetype
568 uint32 ACC (RW, editable); /* editable flags (mainly for editor) */
569 579
570 sint8 ACC (RW, min_x), ACC (RW, min_y); /* extents, compared to the head (min_x, min_y should be zero, but aren't...) */ 580 sint8 ACC (RW, min_x), ACC (RW, min_y); /* extents, compared to the head (min_x, min_y should be zero, but aren't...) */
571 sint8 ACC (RW, max_x), ACC (RW, max_y); 581 sint8 ACC (RW, max_x), ACC (RW, max_y);
572}; 582};
573 583

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines