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.21 by root, Fri Sep 8 16:53:57 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 ();
240 static bool can_merge (object * op1, object * op2); 248 static bool can_merge (object *op1, object *op2);
241 249
242 void clear (); 250 void clear ();
243 void clone (object * destination); 251 void clone (object *destination);
252
253protected:
254 friend struct archetype;
255
256 void link ();
257 void unlink ();
258
259 object ();
260 ~object ();
244}; 261};
245 262
246#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)))
247 264
248typedef struct oblnk 265typedef struct oblnk
269 */ 286 */
270 287
271ACC_CLASS(archetype) 288ACC_CLASS(archetype)
272struct archetype : zero_initialised 289struct archetype : zero_initialised
273{ 290{
291 archetype ();
292 ~archetype ();
293
274 shstr ACC (RW, name); /* More definite name, like "generate_kobold" */ 294 shstr ACC (RW, name); /* More definite name, like "generate_kobold" */
275 struct archetype *ACC (RW, next); /* Next archetype in a linked list */ 295 struct archetype *ACC (RW, next); /* Next archetype in a linked list */
276 struct archetype *ACC (RW, head); /* The main part of a linked object */ 296 struct archetype *ACC (RW, head); /* The main part of a linked object */
277 struct archetype *ACC (RW, more); /* Next part of a linked object */ 297 struct archetype *ACC (RW, more); /* Next part of a linked object */
278 object ACC (RO, clone); /* An object from which to do copy_object() */ 298 object ACC (RO, clone); /* An object from which to do copy_object() */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines