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.81 by root, Sun Jan 7 02:39:14 2007 UTC vs.
Revision 1.84 by root, Tue Jan 9 21:32:42 2007 UTC

216{ 216{
217 // These variables are not changed by ->copy_to 217 // These variables are not changed by ->copy_to
218 maptile_ptr ACC (RW, map); /* Pointer to the map in which this object is present */ 218 maptile_ptr ACC (RW, map); /* Pointer to the map in which this object is present */
219 219
220 UUID ACC (RW, uuid); // Unique Identifier, survives saves etc. 220 UUID ACC (RW, uuid); // Unique Identifier, survives saves etc.
221 int ACC (RO, count); // index into objects 221 int ACC (RO, count);
222 int ACC (RO, index); // index into objects
222 int ACC (RO, active); // index into actives 223 int ACC (RO, active); // index into actives
223 224
224 player_ptr ACC (RW, contr); /* Pointer to the player which control this object */ 225 player_ptr ACC (RW, contr); /* Pointer to the player which control this object */
225 226
226 object *ACC (RW, below); /* Pointer to the object stacked below this one */ 227 object *ACC (RW, below); /* Pointer to the object stacked below this one */
227 object *ACC (RW, above); /* Pointer to the object stacked above this one */ 228 object *ACC (RW, above); /* Pointer to the object stacked above this one */
228 /* Note: stacked in the *same* environment */ 229 /* Note: stacked in the *same* environment */
229 object *inv; /* Pointer to the first object in the inventory */ 230 object *inv; /* Pointer to the first object in the inventory */
231
232 //TODO: container must move into client
230 object *ACC (RW, container); /* Current container being used. I think this 233 object *ACC (RW, container); /* Current container being used. I think this
231 * is only used by the player right now. 234 * is only used by the player right now.
232 */ 235 */
233 object *ACC (RW, env); /* Pointer to the object which is the environment. 236 object *ACC (RW, env); /* Pointer to the object which is the environment.
234 * This is typically the container that the object is in. 237 * This is typically the container that the object is in.
235 */ 238 */
236 object *ACC (RW, more); /* Pointer to the rest of a large body of objects */ 239 object *ACC (RW, more); /* Pointer to the rest of a large body of objects */
237 object *head; /* Points to the main object of a large body */ // NO ACC, perl semantics are different 240 object *head; /* Points to the main object of a large body */ // NO ACC, perl semantics are different
238 client_container *seen_by; // seen by which player/container currently? 241 client_container *seen_by; // seen by which player/container currently?
239
240 //static vector active_list; // active objects, not yet used
241 //static vector object_list; // not used yet, use first->next->...
242 static object *first; // will be replaced by "objects"
243 242
244 MTH static object *create (); 243 MTH static object *create ();
245 MTH void copy_to (object *dst); 244 MTH void copy_to (object *dst);
246 MTH object *clone (); // create + copy_to 245 MTH object *clone (); // create + copy_to
247 void do_destroy (); 246 void do_destroy ();
386 object *end () 385 object *end ()
387 { 386 {
388 return this; 387 return this;
389 } 388 }
390 389
390 /* This returns TRUE if the object is something that
391 * should be displayed in the floorbox/inventory window
392 */
393 MTH bool client_visible () const
394 {
395 return !invisible && type != PLAYER;
396 }
397
391protected: 398protected:
392 friend struct archetype; 399 friend struct archetype;
393 400
394 void link (); 401 void link ();
395 void unlink (); 402 void unlink ();
396 403
397 object (); 404 object ();
398 ~object (); 405 ~object ();
399}; 406};
400 407
401typedef object_vector<object, &object::count > objectvec; 408typedef object_vector<object, &object::index > objectvec;
402typedef object_vector<object, &object::active> activevec; 409typedef object_vector<object, &object::active> activevec;
403 410
404extern objectvec objects; 411extern objectvec objects;
405extern activevec actives; 412extern activevec actives;
406 413
454 uint32 ACC (RW, editable); /* editable flags (mainly for editor) */ 461 uint32 ACC (RW, editable); /* editable flags (mainly for editor) */
455 sint8 ACC (RW, tail_x), ACC (RW, tail_y); /* Where the lower right most portion of the object is 462 sint8 ACC (RW, tail_x), ACC (RW, tail_y); /* Where the lower right most portion of the object is
456 * in comparison to the head. 463 * in comparison to the head.
457 */ 464 */
458}; 465};
459
460/* This returns TRUE if the object is something that
461 * should be displayed in the floorbox window
462 */
463#define LOOK_OBJ(ob) (!ob->invisible && ob->type != PLAYER && ob->type != EVENT_CONNECTOR)
464 466
465/* Used by update_object to know if the object being passed is 467/* Used by update_object to know if the object being passed is
466 * being added or removed. 468 * being added or removed.
467 */ 469 */
468#define UP_OBJ_INSERT 1 470#define UP_OBJ_INSERT 1

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines