… | |
… | |
318 | object *ACC (RW, above); /* Pointer to the object stacked above this one */ |
318 | object *ACC (RW, above); /* Pointer to the object stacked above this one */ |
319 | /* Note: stacked in the *same* environment */ |
319 | /* Note: stacked in the *same* environment */ |
320 | object *inv; /* Pointer to the first object in the inventory */ |
320 | object *inv; /* Pointer to the first object in the inventory */ |
321 | |
321 | |
322 | //TODO: container must move into client |
322 | //TODO: container must move into client |
323 | object_ptr ACC (RW, container); /* Current container being used. I think this |
323 | object_ptr ACC (RW, container);/* Currently opened container. I think this |
324 | * is only used by the player right now. |
324 | * is only used by the player right now. |
325 | */ |
325 | */ |
326 | object *ACC (RW, env); /* Pointer to the object which is the environment. |
326 | object *ACC (RW, env); /* Pointer to the object which is the environment. |
327 | * This is typically the container that the object is in. |
327 | * This is typically the container that the object is in. |
328 | */ |
328 | */ |
329 | object *ACC (RW, more); /* Pointer to the rest of a large body of objects */ |
329 | object *ACC (RW, more); /* Pointer to the rest of a large body of objects */ |
330 | object *head; /* Points to the main object of a large body */ // NO ACC, perl semantics are different |
330 | object *head; /* Points to the main object of a large body */ // NO ACC, perl semantics are different |
331 | client_container *seen_by; // seen by which player/container currently? |
|
|
332 | key_value *key_values; /* Fields not explictly known by the loader. */ |
331 | key_value *key_values; /* Fields not explictly known by the loader. */ |
333 | |
332 | |
334 | // privates / perl |
333 | // privates / perl |
335 | shstr_tmp kv_get (shstr_tmp key) const; |
334 | shstr_tmp kv_get (shstr_tmp key) const; |
336 | void kv_del (shstr_tmp key); |
335 | void kv_del (shstr_tmp key); |
… | |
… | |
434 | |
433 | |
435 | MTH void open_container (object *new_container); |
434 | MTH void open_container (object *new_container); |
436 | MTH void close_container () |
435 | MTH void close_container () |
437 | { |
436 | { |
438 | open_container (0); |
437 | open_container (0); |
|
|
438 | } |
|
|
439 | |
|
|
440 | // potential future accessor for "container" |
|
|
441 | MTH object *container_ () const |
|
|
442 | { |
|
|
443 | return container; |
|
|
444 | } |
|
|
445 | |
|
|
446 | MTH bool is_open_container () const |
|
|
447 | { |
|
|
448 | // strangely enough, using ?: here causes code to inflate |
|
|
449 | return type == CONTAINER |
|
|
450 | && ((env && env->container_ () == this) |
|
|
451 | || (!env && flag [FLAG_APPLIED])); |
439 | } |
452 | } |
440 | |
453 | |
441 | MTH object *force_find (shstr_tmp name); |
454 | MTH object *force_find (shstr_tmp name); |
442 | MTH void force_set_timer (int duration); |
455 | MTH void force_set_timer (int duration); |
443 | MTH object *force_add (shstr_tmp name, int duration = 0); |
456 | MTH object *force_add (shstr_tmp name, int duration = 0); |