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.28 by root, Mon Sep 11 20:28:37 2006 UTC vs.
Revision 1.33 by root, Tue Sep 12 19:20:07 2006 UTC

99 */ 99 */
100 struct object *ACC (RW, env); /* Pointer to the object which is the environment. 100 struct object *ACC (RW, env); /* Pointer to the object which is the environment.
101 * This is typically the container that the object is in. 101 * This is typically the container that the object is in.
102 */ 102 */
103 struct object *ACC (RW, more); /* Pointer to the rest of a large body of objects */ 103 struct object *ACC (RW, more); /* Pointer to the rest of a large body of objects */
104 struct object *ACC (RW, head); /* Points to the main object of a large body */ 104 struct object *head; /* Points to the main object of a large body */ // NO ACC, perl semantics are different
105 struct mapstruct *ACC (RW, map); /* Pointer to the map in which this object is present */ 105 struct mapstruct *ACC (RW, map); /* Pointer to the map in which this object is present */
106}; 106};
107 107
108// these are being copied 108// these are being copied
109struct object_copy : attachable<object> 109struct object_copy : attachable<object>
168 struct object *ACC (RW, current_weapon); /* Pointer to the weapon currently used */ 168 struct object *ACC (RW, current_weapon); /* Pointer to the weapon currently used */
169 uint32 ACC (RW, weapontype); /* type of weapon */ 169 uint32 ACC (RW, weapontype); /* type of weapon */
170 uint32 ACC (RW, tooltype); /* type of tool or build facility */ 170 uint32 ACC (RW, tooltype); /* type of tool or build facility */
171 sint8 body_info[NUM_BODY_LOCATIONS]; /* body info as loaded from the file */ 171 sint8 body_info[NUM_BODY_LOCATIONS]; /* body info as loaded from the file */
172 sint8 body_used[NUM_BODY_LOCATIONS]; /* Calculated value based on items equipped */ 172 sint8 body_used[NUM_BODY_LOCATIONS]; /* Calculated value based on items equipped */
173 uint8 ACC (RW, will_apply); /* See crossfire.doc */
174 /* See the doc/Developers/objects for more info about body locations */ 173 /* See the doc/Developers/objects for more info about body locations */
175 174
176 /* Following mostly refers to fields only used for monsters */ 175 /* Following mostly refers to fields only used for monsters */
177 tag_t ACC (RW, ownercount); /* What count the owner had (in case owner has been freed) *///TODO: remove/fix 176 tag_t ACC (RW, ownercount); /* What count the owner had (in case owner has been freed) *///TODO: remove/fix
178 struct object *ACC (RW, enemy); /* Monster/player to follow even if not closest */ 177 struct object *ACC (RW, enemy); /* Monster/player to follow even if not closest */
212 uint16 ACC (RW, animation_id); /* An index into the animation array */ 211 uint16 ACC (RW, animation_id); /* An index into the animation array */
213 uint8 ACC (RW, anim_speed); /* ticks between animation-frames */ 212 uint8 ACC (RW, anim_speed); /* ticks between animation-frames */
214 uint8 ACC (RW, last_anim); /* last sequence used to draw face */ 213 uint8 ACC (RW, last_anim); /* last sequence used to draw face */
215 sint32 ACC (RW, elevation); /* elevation of this terrain - not currently used */ 214 sint32 ACC (RW, elevation); /* elevation of this terrain - not currently used */
216 uint8 ACC (RW, smoothlevel); /* how to smooth this square around */ 215 uint8 ACC (RW, smoothlevel); /* how to smooth this square around */
216 uint8 ACC (RW, will_apply); /* See crossfire.doc */
217 217
218 MoveType ACC (RW, move_type); /* Type of movement this object uses */ 218 MoveType ACC (RW, move_type); /* Type of movement this object uses */
219 MoveType ACC (RW, move_block); /* What movement types this blocks */ 219 MoveType ACC (RW, move_block); /* What movement types this blocks */
220 MoveType ACC (RW, move_allow); /* What movement types explicitly allowd */ 220 MoveType ACC (RW, move_allow); /* What movement types explicitly allowd */
221 MoveType ACC (RW, move_on); /* Move types affected moving on to this space */ 221 MoveType ACC (RW, move_on); /* Move types affected moving on to this space */
236 void clear (); 236 void clear ();
237 void clone (object *destination); 237 void clone (object *destination);
238 238
239 void set_owner (object *owner); 239 void set_owner (object *owner);
240 object *get_owner (); 240 object *get_owner ();
241
242 // info must hold 256 * 3 bytes currently
243 const char *debug_desc (char *info) const;
244 const char *debug_desc () const;
245
246 // fully recursive iterator
247 struct iterator_base
248 {
249 object *item;
250
251 iterator_base (object *container)
252 : item (container)
253 {
254 }
255
256 operator object *() const { return item; }
257
258 object *operator ->() const { return item; }
259 object &operator * () const { return *item; }
260 };
261
262 // depth-first recursive iterator
263 struct depth_iterator : iterator_base
264 {
265 depth_iterator (object *container);
266 void next ();
267 object *operator ++( ) { next (); return item; }
268 object *operator ++(int) { object *i = item; next (); return i; }
269 };
270
271 object *begin ()
272 {
273 return this;
274 }
275
276 object *end ()
277 {
278 return this;
279 }
241 280
242protected: 281protected:
243 friend struct archetype; 282 friend struct archetype;
244 283
245 void link (); 284 void link ();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines