… | |
… | |
230 | float ACC (RW, move_slow_penalty); /* How much this slows down the object */ |
230 | float ACC (RW, move_slow_penalty); /* How much this slows down the object */ |
231 | }; |
231 | }; |
232 | |
232 | |
233 | struct object : zero_initialised, object_keep, object_copy, object_pod |
233 | struct object : zero_initialised, object_keep, object_copy, object_pod |
234 | { |
234 | { |
|
|
235 | typedef unordered_vector<object *> vector; |
|
|
236 | |
|
|
237 | static vector mortals; |
|
|
238 | static vector active; // active objects, not yet used |
|
|
239 | static vector objects; // not used yet, use first->next->... |
|
|
240 | static object *first; // will be replaced by "objects" |
|
|
241 | |
235 | static object *create (); |
242 | static object *create (); |
236 | void free (bool free_inventory = false); |
243 | void free (bool free_inventory = false); |
237 | |
244 | |
238 | static void free_mortals (); |
245 | static void free_mortals (); |
239 | static bool can_merge (object *op1, object *op2); |
246 | static bool can_merge (object *op1, object *op2); |
240 | |
247 | |
241 | void clear (); |
248 | void clear (); |
242 | void clone (object *destination); |
249 | void clone (object *destination); |
|
|
250 | |
|
|
251 | bool destroyed () { return QUERY_FLAG (this, FLAG_FREED); } |
243 | |
252 | |
244 | void instantiate () |
253 | void instantiate () |
245 | { |
254 | { |
246 | if (!uuid.seq) // HACK |
255 | if (!uuid.seq) // HACK |
247 | uuid = gen_uuid (); |
256 | uuid = gen_uuid (); |
… | |
… | |
343 | struct archetype : zero_initialised |
352 | struct archetype : zero_initialised |
344 | { |
353 | { |
345 | archetype (); |
354 | archetype (); |
346 | ~archetype (); |
355 | ~archetype (); |
347 | |
356 | |
|
|
357 | static archetype *find (const char *arch); |
|
|
358 | |
348 | shstr ACC (RW, name); /* More definite name, like "generate_kobold" */ |
359 | shstr ACC (RW, name); /* More definite name, like "generate_kobold" */ |
349 | struct archetype *ACC (RW, next); /* Next archetype in a linked list */ |
360 | struct archetype *ACC (RW, next); /* Next archetype in a linked list */ |
350 | struct archetype *ACC (RW, head); /* The main part of a linked object */ |
361 | struct archetype *ACC (RW, head); /* The main part of a linked object */ |
351 | struct archetype *ACC (RW, more); /* Next part of a linked object */ |
362 | struct archetype *ACC (RW, more); /* Next part of a linked object */ |
352 | object ACC (RO, clone); /* An object from which to do copy_object() */ |
363 | object ACC (RO, clone); /* An object from which to do copy_object() */ |
353 | uint32 ACC (RW, editable); /* editable flags (mainly for editor) */ |
364 | uint32 ACC (RW, editable); /* editable flags (mainly for editor) */ |
354 | sint8 ACC (RW, tail_x), ACC (RW, tail_y); /* Where the lower right most portion of the object is |
365 | sint8 ACC (RW, tail_x), ACC (RW, tail_y); /* Where the lower right most portion of the object is |
355 | * in comparison to the head. |
366 | * in comparison to the head. |
356 | */ |
367 | */ |
357 | }; |
368 | }; |
358 | |
369 | |
359 | extern object *objects; |
370 | extern object *objects; |
360 | extern object *active_objects; |
371 | extern object *active_objects; |
361 | |
372 | |