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.22 by root, Fri Sep 8 17:14:07 2006 UTC vs.
Revision 1.25 by root, Sun Sep 10 14:54:02 2006 UTC

105 struct object *ACC (RW, head); /* Points to the main object of a large body */ 105 struct object *ACC (RW, head); /* Points to the main object of a large body */
106 struct mapstruct *ACC (RW, map); /* Pointer to the map in which this object is present */ 106 struct mapstruct *ACC (RW, map); /* Pointer to the map in which this object is present */
107}; 107};
108 108
109// these are being copied 109// these are being copied
110struct object_copy:attachable<object> 110struct object_copy : attachable<object>
111{ 111{
112 /* These get an extra add_refcount(), after having been copied by memcpy(). 112 /* These get an extra add_refcount(), after having been copied by memcpy().
113 * All fields beow this point are automatically copied by memcpy. If 113 * All fields beow this point are automatically copied by memcpy. If
114 * adding something that needs a refcount updated, make sure you modify 114 * adding something that needs a refcount updated, make sure you modify
115 * copy_object to do so. Everything below here also gets cleared 115 * copy_object to do so. Everything below here also gets cleared
233 MoveType ACC (RW, move_slow); /* Movement types this slows down */ 233 MoveType ACC (RW, move_slow); /* Movement types this slows down */
234 float ACC (RW, move_slow_penalty); /* How much this slows down the object */ 234 float ACC (RW, move_slow_penalty); /* How much this slows down the object */
235 key_value *key_values; /* Fields not explictly known by the loader. */ 235 key_value *key_values; /* Fields not explictly known by the loader. */
236}; 236};
237 237
238#define get_object() object::create ()
239#define free_object(op) (op)->free (0)
240#define free_object2(op, free_inv) (op)->free (free_inv)
241
238struct object : zero_initialised, object_keep, object_copy, object_pod 242struct object : zero_initialised, object_keep, object_copy, object_pod
239{ 243{
244 static object *create ();
245 void free (bool free_inventory = false);
246
247 static void free_mortals ();
248 static bool can_merge (object *op1, object *op2);
249
250 void clear ();
251 void clone (object *destination);
252
253protected:
254 friend struct archetype;
255
256 void link ();
257 void unlink ();
258
240 object (); 259 object ();
241 ~object (); 260 ~object ();
242
243 static bool can_merge (object * op1, object * op2);
244
245 void clear ();
246 void clone (object * destination);
247}; 261};
248
249#define get_object() (new object) // compatibility, but please keep for a while
250 262
251#define CAN_MERGE(op1,op2) ((op1)->value == (op2)->value && (op1)->name == (op2)->name && object::can_merge ((op1), (op2))) 263#define CAN_MERGE(op1,op2) ((op1)->value == (op2)->value && (op1)->name == (op2)->name && object::can_merge ((op1), (op2)))
252 264
253typedef struct oblnk 265typedef struct oblnk
254{ /* Used to link together several objects */ 266{ /* Used to link together several objects */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines