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.72 by root, Wed Dec 27 13:13:47 2006 UTC vs.
Revision 1.78 by root, Sun Dec 31 17:17:23 2006 UTC

240 */ 240 */
241 object *ACC (RW, more); /* Pointer to the rest of a large body of objects */ 241 object *ACC (RW, more); /* Pointer to the rest of a large body of objects */
242 object *head; /* Points to the main object of a large body */ // NO ACC, perl semantics are different 242 object *head; /* Points to the main object of a large body */ // NO ACC, perl semantics are different
243 client_container *seen_by; // seen by which player/container currently? 243 client_container *seen_by; // seen by which player/container currently?
244 244
245 static vector active; // active objects, not yet used 245 //static vector active_list; // active objects, not yet used
246 static vector objects; // not used yet, use first->next->... 246 //static vector object_list; // not used yet, use first->next->...
247 static object *first; // will be replaced by "objects" 247 static object *first; // will be replaced by "objects"
248 248
249 MTH static object *create (); 249 MTH static object *create ();
250 MTH void copy_to (object *dst); 250 MTH void copy_to (object *dst);
251 MTH object *clone (); // create + copy_to 251 MTH object *clone (); // create + copy_to
288 MTH void drain_stat (); 288 MTH void drain_stat ();
289 MTH void drain_specific_stat (int deplete_stats); 289 MTH void drain_specific_stat (int deplete_stats);
290 MTH void change_luck (int value); 290 MTH void change_luck (int value);
291 291
292 // info must hold 256 * 3 bytes currently 292 // info must hold 256 * 3 bytes currently
293 MTH const char *debug_desc (char *info) const; 293 const char *debug_desc (char *info) const;
294 MTH const char *debug_desc () const; 294 MTH const char *debug_desc () const;
295 const char *flag_desc (char *desc, int len) const;
295 296
296 MTH bool is_weapon () const { return type == ARROW || type == BOW || type == WEAPON; } 297 MTH bool is_weapon () const { return type == ARROW || type == BOW || type == WEAPON; }
297 MTH bool is_armor () const { return type == ARMOUR || type == SHIELD || type == HELMET 298 MTH bool is_armor () const { return type == ARMOUR || type == SHIELD || type == HELMET
298 || type == CLOAK || type == BOOTS || type == GLOVES 299 || type == CLOAK || type == BOOTS || type == GLOVES
299 || type == BRACERS || type == GIRDLE; } 300 || type == BRACERS || type == GIRDLE; }
303 && !flag [FLAG_IS_A_TEMPLATE]; } 304 && !flag [FLAG_IS_A_TEMPLATE]; }
304 MTH bool is_arrow () const { return type == ARROW 305 MTH bool is_arrow () const { return type == ARROW
305 || (type == SPELL_EFFECT 306 || (type == SPELL_EFFECT
306 && (subtype == SP_BULLET || subtype == SP_MAGIC_MISSILE)); } 307 && (subtype == SP_BULLET || subtype == SP_MAGIC_MISSILE)); }
307 308
309 MTH bool has_active_speed () const { return FABS(speed) >= MIN_ACTIVE_SPEED; }
310
308 // temporary: wether the objetc can be saved in a map file 311 // temporary: wether the object can be saved in a map file
309 // contr => is a player 312 // contr => is a player
310 // head => only save head of a multitile object 313 // head => only save head of a multitile object
311 // owner => can not reference owner yet 314 // owner => can not reference owner yet
312 MTH bool can_map_save () const { return !contr && !head && !owner; } 315 MTH bool can_map_save () const { return !contr && !head && !owner; }
313 316
334 337
335 // insert object at same map position as 'where' 338 // insert object at same map position as 'where'
336 // handles both inventory and map "positions" 339 // handles both inventory and map "positions"
337 MTH object *insert_at (object *where, object *originator = 0, int flags = 0); 340 MTH object *insert_at (object *where, object *originator = 0, int flags = 0);
338 341
342 MTH bool active () const;
343 MTH void activate ();
344 MTH void deactivate ();
345 MTH void activate_recursive ();
346 MTH void deactivate_recursive ();
347
348 void enter_exit (object *exit);//PERL
349 MTH void enter_map (maptile *newmap, int x, int y);
350
339 // returns the mapspace this object is in 351 // returns the mapspace this object is in
340 mapspace &ms () const; 352 mapspace &ms () const;
341 353
342 // fully recursive iterator 354 // fully recursive iterator
343 struct iterator_base 355 struct iterator_base
352 operator object *() const { return item; } 364 operator object *() const { return item; }
353 365
354 object *operator ->() const { return item; } 366 object *operator ->() const { return item; }
355 object &operator * () const { return *item; } 367 object &operator * () const { return *item; }
356 }; 368 };
369
370 MTH unsigned int random_seed () const
371 {
372 return (unsigned int)uuid.seq;
373 }
357 374
358 // depth-first recursive iterator 375 // depth-first recursive iterator
359 struct depth_iterator : iterator_base 376 struct depth_iterator : iterator_base
360 { 377 {
361 depth_iterator (object *container); 378 depth_iterator (object *container);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines