… | |
… | |
537 | // set the given flag on all objects in the inventory recursively |
537 | // set the given flag on all objects in the inventory recursively |
538 | MTH void set_flag_inv (int flag, int value = 1); |
538 | MTH void set_flag_inv (int flag, int value = 1); |
539 | |
539 | |
540 | void enter_exit (object *exit);//Perl |
540 | void enter_exit (object *exit);//Perl |
541 | MTH void enter_map (maptile *newmap, int x, int y); |
541 | MTH void enter_map (maptile *newmap, int x, int y); |
|
|
542 | void player_goto (const char *path, int x, int y); // only for players |
542 | |
543 | |
543 | // returns the mapspace this object is in |
544 | // returns the mapspace this object is in |
544 | mapspace &ms () const; |
545 | mapspace &ms () const; |
545 | |
546 | |
546 | // fully recursive iterator |
547 | // fully recursive iterator |
… | |
… | |
677 | MTH static archetype *find (const_utf8_string name); |
678 | MTH static archetype *find (const_utf8_string name); |
678 | |
679 | |
679 | MTH void link (); |
680 | MTH void link (); |
680 | MTH void unlink (); |
681 | MTH void unlink (); |
681 | |
682 | |
682 | MTH static object *get (const char *name); // find()->instance() |
683 | MTH static object *get (const char *name); // (find() || singularity)->instance() |
683 | MTH object *instance (); |
684 | MTH object *instance (); |
684 | |
685 | |
685 | object_vector_index ACC (RW, archid); // index in archvector |
686 | object_vector_index ACC (RW, archid); // index in archvector |
686 | shstr ACC (RW, archname); /* More definite name, like "generate_kobold" */ |
687 | shstr ACC (RW, archname); /* More definite name, like "generate_kobold" */ |
687 | |
688 | |
… | |
… | |
706 | |
707 | |
707 | extern objectvec objects; |
708 | extern objectvec objects; |
708 | extern activevec actives; |
709 | extern activevec actives; |
709 | extern archvec archetypes; |
710 | extern archvec archetypes; |
710 | |
711 | |
|
|
712 | // "safely" iterate over inv in a way such that the current item is removable |
|
|
713 | // quite horrible, thats why its hidden in some macro |
|
|
714 | #define for_inv_removable(op,var) \ |
|
|
715 | for (object *var, *next_ = (op)->inv; (var = next_), var && (next_ = var->below), var; ) |
|
|
716 | |
711 | #define for_all_objects(var) \ |
717 | #define for_all_objects(var) \ |
712 | for (unsigned _i = 0; _i < objects.size (); ++_i) \ |
718 | for (unsigned _i = 0; _i < objects.size (); ++_i) \ |
713 | statementvar (object *, var, objects [_i]) |
719 | statementvar (object *, var, objects [_i]) |
714 | |
720 | |
715 | #define for_all_actives(var) \ |
721 | #define for_all_actives(var) \ |
716 | for (unsigned _i = 0; _i < actives.size (); ++_i) \ |
722 | for (unsigned _i = 0; _i < actives.size (); ++_i) \ |
717 | statementvar (object *, var, actives [_i]) |
723 | statementvar (object *, var, actives [_i]) |
718 | |
724 | |
719 | #define for_all_archetypes(var) \ |
725 | #define for_all_archetypes(var) \ |
720 | for (unsigned _i = 0; _i < archetypes.size (); ++_i) \ |
726 | for (unsigned _i = 0; _i < archetypes.size (); ++_i) \ |
721 | statementvar (archetype *, var, archetypes [_i]) |
727 | statementvar (archetype *, var, archetypes [_i]) |
722 | |
728 | |
723 | /* Used by update_object to know if the object being passed is |
729 | /* Used by update_object to know if the object being passed is |
724 | * being added or removed. |
730 | * being added or removed. |