object utilities #45
Aliases: object utilities
57 verbs · 12 properties · 0 children
Verbs
Properties
| Property | Definer | Flags | Owner | Value |
|---|---|---|---|---|
ordinal_regexp_old | #45 | rc | #361 | "" |
help_msg | #72 | rc | #361 | list of 75{"*** NOTE: for more help on any verb, do 'help $ou:verbname'.", "", "These routines are useful for finding out information about objects and the object tree. They can be very slow with large trees; verbs with an asterisk have a suspending version of the verb named '(verbname)_suspended' to help.", "", " Inheritance & hierarchy:", "", ":descendants * (obj) => kids, kids of kids, ...", ":limited_children * (obj, n) => descendants down to level n", ":ordered_descendants (obj) => depth-first (the above is breadth)", ":leaves * (obj) => descendants with no children", ":branches * (obj) => descendants with children ", ":fertile_kids * (obj) => kids that are +f", ":fertile_branches (obj) => like branches, but +f only", "", ":descendants_with_property_suspended (obj, pname)", " => like descendants, but only objs with .pname defined.", ":objects_with_verb (vname, obj)", " => like descendants, but only objs with :vname defined.", "", ":ancestors (obj [,obj ,...]) ", " => parents, parents of parents, ...", ":property_conflicts (obj, newparent)", " => list of {prop, objs-with-prop} that would conflict", ":tree_properties (obj, propname) ", " => for every descendant of obj, {obj, propvalue}", ":has_a (obj-list, parent-obj) ", " => return first obj in list which is a parent-obj", "", " Boolean inheritance checking:", ":isa (obj, parent-obj) => true if obj is a parent-obj.", " - the above is deprecated: use the builtin is_a(obj, parent_obj).", ":isoneof (obj, parent-list) => true if object :isa class in list of parents", "", " What's in what (contents):", ":contains (obj1, obj2) => Does obj1 contain obj2 (nested)?", ":all_contents (object) => contents, contents of contents, ...", ":locations (object) => location, location.location, ...", "", " Verb & property info:", "", ":all_verbs (obj) => verbs on obj and all parents", ":all_properties * (obj) => props on obj and all parents", ":findable_properties(obj) => props that are readable by caller", ":owned_properties (obj [,owner]) => props owned by owner/caller", "", ":has_property (obj,pname) => does obj.pname exist?", ":has_readable_property(obj,pname)=> does obj.pname exist & is it +r?", ":defines_property (obj,pname) => is .pname defined on obj?", ":has_verb (obj,vname) => does obj:vname exist?", ":has_callable_verb (obj,vname) => does obj:vname exist & is it +x?", ":defines_verb (obj,vname) => is :vname defined on obj?", ":match_verb (obj,vname) ", " => finds the object :vname is defined on. {obj, vname} or {}.", ":accessible_verbs (obj) ", " => a list of verbs that you can access (or E_PERM)", ":has_verb_and_args (obj, vname, iobjarg, preparg, dobjarg)", " => does the given verb exist, with given args?", "", ":verb_name(\"verb*names like this\") => \"verb\"", "", "$lu:remove_* Utilities:", " The following are designed for use with the wonderful $lu:remove_* and return true or false values only.", "", ":bf_op (obj, ref, func, @args)", " => completes prop refs for obj and then returns truth of $bf:(func)(ref, @args)", ":is_true (obj, ref)", " => completes prop references for obj and then returns truth value", ":gt/lt/ge/le/eq/ne (obj, ref, val)", " => completes prop references for obj and then compares the result with val", ":bf_op_(gt/lt/etc) (obj, ref, func, val, @args)", " => same as the above except compares the result of $bf(func)(ref, @args) with val", "", " Misc info:", "", ":connected (obj) => is this a connected player?"} |
aliases | #1 | rc | #361 | {"object utilities"} |
description | #1 | rc | #361 | {"This is the object utilities utility package. See `help $object_utils' for more details."} |
object_size | #1 | r | #29 | {38145, 1298433815} |
hidden_verbs | #1 | rc | #361 | <clear> |
phelp_msg | #1 | rc | #361 | <clear> |
weight | #1 | rc | #361 | <clear> |
owner_verbs | #1 | rc | #361 | <clear> |
plural_name | #1 | rc | #361 | <clear> |
client_image | #1 | rc | #361 | <clear> |
listening | #1 | rc | #361 | <clear> |
Ancestry
Ancestors (nearest first): #72 Generic Utilities Package → #1 root
Children: none
Call graph
Source
has_property has_prop
Referenced by
- #1:_www line 8:
$ou:has_property - #2:@newmess*age line 21:
$object_utils:has_property - #2:@set*prop line 37:
$object_utils:has_property - #2:@measure line 16:
$object_utils:has_property - #2:@measure line 49:
$object_utils:has_property - #2:@features line 13:
$ou:has_property - #2:@addalias*# line 101:
$object_utils:has_property - #2:@addalias*# line 102:
$object_utils:has_property - #2:@prop*erties line 8:
$object_utils:has_property - #2:@d*isplay line 144:
$object_utils:has_property - #3:recalc_next_hops line 3:
$ou:has_property - #3:time_windows_msg line 3:
$ou:has_property - #4:co*nnect line 108:
$object_utils:has_property - #5:_eat line 5:
$ou:has_property - #6:set_aliases line 19:
$object_utils:has_property - #11:suspicious_address line 35:
$object_utils:has_property - #17:unset_player line 17:
$object_utils:has_property - #17:send_new_player_mail line 9:
$object_utils:has_property - #20:literal_object line 15:
$object_utils:has_property - #20:_cap_property line 23:
$object_utils:has_property - #21:object_audit_string line 47:
$object_utils:has_property - #21:object_audit_string line 47:
$object_utils:has_property - #21:object_audit_string line 75:
$object_utils:has_property - #21:do_audit line 24:
$object_utils:has_property - #21:do_audit line 36:
$object_utils:has_property - #24:find_topics line 5:
$object_utils:has_property - #24:find_topics line 6:
$object_utils:has_property - #24:find_topics line 9:
$object_utils:has_property - #24:get_topic line 3:
$object_utils:has_property - #24:objectdoc line 4:
$object_utils:has_property - #25:do_reset line 6:
$object_utils:has_property - #34:add line 9:
$object_utils:has_property - #40:note_match_failed line 10:
$object_utils:has_property - #43:set_stateprops line 11:
$object_utils:has_property - #43:set_stateprops line 23:
$object_utils:has_property - #45:defines_property line 5:
this:has_property - #45:defines_property line 7:
this:has_property - #45:defines_property line 7:
this:has_property - #46:eval_key_new line 19:
$object_utils:has_property - #46:eval_key_new line 23:
$object_utils:has_property - #49:@quota line 16:
$object_utils:has_property - #49:@make-guest line 11:
$object_utils:has_property - #50:@prop*erty line 54:
$object_utils:has_property - #50:@d*isplay line 144:
$object_utils:has_property - #50:@check-p*roperty line 8:
$object_utils:has_property - #50:@prop*erties line 12:
$object_utils:has_property - #50:find_property line 9:
$ou:has_property - #50:find_help line 10:
$object_utils:has_property - #50:find_help line 13:
$object_utils:has_property - #50:property_inherited_from line 3:
$object_utils:has_property - #50:property_inherited_from line 9:
$object_utils:has_property - #52:dump_topic line 1:
$object_utils:has_property - #62:set line 29:
$object_utils:has_property - #62:set line 35:
$object_utils:has_property - #62:parse line 53:
$object_utils:has_property - #62:show line 16:
$object_utils:has_property - #62:show line 21:
$object_utils:has_property - #65:replace line 49:
$object_utils:has_property - #73:adjust_quota_for_programmer line 6:
$object_utils:has_property - #73:object_bytes line 4:
$object_utils:has_property - #73:object_bytes line 8:
$object_utils:has_property - #73:object_bytes line 10:
$object_utils:has_property - #75:creation_permitted line 7:
$object_utils:has_property - #75:all_characters line 4:
$object_utils:has_property - #75:charge_quota line 6:
$object_utils:has_property - #75:reimburse_quota line 9:
$object_utils:has_property - #75:object_bytes line 4:
$object_utils:has_property - #75:object_bytes line 8:
$object_utils:has_property - #75:object_bytes line 10:
$object_utils:has_property - #75:summarize_one_user line 27:
$object_utils:has_property - #75:measurement_task_body line 31:
$object_utils:has_property - #75:measurement_task_body line 41:
$object_utils:has_property - #89:teleport line 28:
$object_utils:has_property - #89:gain_stress line 1:
$ou:has_prop - #95:at*tack line 2:
$ou:has_property - #104:_eat line 2:
$ou:has_property - #107:die line 27:
$ou:has_property - #107:hear_event_move line 11:
$ou:has_property - #107:stop_fighting line 6:
$ou:has_property - #107:threat_rating line 13:
$ou:has_property - #107:threat_rating line 30:
$ou:has_property - #114:room_added line 2:
$ou:has_property - #118:_announce_leave line 4:
$ou:has_property - #118:_announce_join line 4:
$ou:has_property - #119:_repair line 8:
$ou:has_prop - #119:_repair line 13:
$ou:has_prop - #121:select line 5:
$ou:has_prop - #127:add_to line 7:
$ou:has_property - #127:fits_on line 17:
$ou:has_property - #127:add_to_old line 7:
$ou:has_property - #128:light line 18:
$ou:has_property - #138:_eat line 4:
$ou:has_property - #148:_eat line 3:
$ou:has_property - #150:unregister line 6:
$ou:has_property - #150:@h-check line 5:
$ou:has_property - #167:biz_chatcolor line 25:
$ou:has_property - #167:biz_chatcolor line 38:
$ou:has_property - #167:biz_chatcolor line 55:
$ou:has_property - #251:_cannot_add_property line 2:
$ou:has_property - #257:smell line 17:
$ou:has_prop - #285:transmit line 3:
$ou:has_property - #317:@allitems line 51:
$ou:has_property - #317:@allitems line 54:
$ou:has_property - #338:on_spawn line 11:
$ou:has_property
Source
1return valid(args[1]) && has_property(@args);
all_properties all_verbs
Referenced by
- #6:@mess*ages line 15:
$object_utils:all_properties - #17:set_owner line 15:
$object_utils:all_properties - #17:set_owner_new line 12:
$object_utils:all_properties - #24:find_topics line 35:
$object_utils:all_properties - #49:make-core-database line 61:
$object_utils:all_properties - #49:make-core-database line 106:
$object_utils:all_properties - #49:coredat line 75:
$object_utils:all_properties - #50:@proped*it line 2:
$ou:all_properties - #50:@copy-msg line 6:
$ou:all_properties - #50:@messages_old line 16:
$object_utils:all_properties - #51:show_object line 41:
$object_utils:all_properties - #75:do_breakdown line 6:
$object_utils:all_properties - #113:@megasub*stitute line 22:
$ou:all_properties - #122:add_tag line 17:
$ou:all_properties - #122:add_tag line 21:
$ou:all_verbs - #204:validate line 3:
$ou:all_verbs - #204:validate line 18:
$ou:all_properties - #317:@compare line 43:
$ou:all_properties - #317:@compare line 45:
$ou:all_properties - #334:mess*ages line 11:
$object_utils:all_properties - #334:copy_props line 7:
$ou:all_properties
Source
1"Syntax: all_properties (OBJ what)"; 2" all_verbs (OBJ what)"; 3""; 4"Returns all properties or verbs defined on `what' and all of its ancestors. Uses wizperms to get properties or verbs if the caller of this verb owns what, otherwise, uses caller's perms."; 5what = args[1]; 6if (what.owner != caller_perms()) 7set_task_perms(caller_perms()); 8endif 9bif = (verb == "all_verbs") ? "verbs" | "properties"; 10res = `call_function(bif, what) ! E_PERM => {}'; 11while (valid(what = parent(what))) 12res = {@`call_function(bif, what) ! E_PERM => {}', @res}; 13endwhile 14return res;
has_verb
Referenced by
- #2:@s*tat line 1:
$object_utils:has_verb - #2:@set-note-text line 16:
$object_utils:has_verb - #2:@d*isplay line 109:
$object_utils:has_verb - #2:@d*isplay line 128:
$object_utils:has_verb - #3:do_creature_heartbeat line 2:
$ou:has_verb - #3:_render_map line 85:
$ou:has_verb - #3:list_description line 39:
$object_utils:has_verb - #3:list_description line 54:
$object_utils:has_verb - #3:look_self_NEW line 34:
$ou:has_verb - #3:look_self_NEW line 58:
$object_utils:has_verb - #3:look_self_NEW line 76:
$object_utils:has_verb - #3:look_self_backup line 82:
$object_utils:has_verb - #3:look_self_backup line 100:
$ou:has_verb - #3:look_self_backup2 line 88:
$object_utils:has_verb - #3:look_self_backup2 line 106:
$ou:has_verb - #6:add_feature line 21:
$ou:has_verb - #6:remove_feature line 11:
$ou:has_verb - #6:_wake line 4:
$ou:has_verb - #6:set_pref line 21:
$ou:has_verb - #13:get_topic line 7:
$object_utils:has_verb - #13:dump_topic line 6:
$object_utils:has_verb - #20:alt_pronoun_sub line 39:
$object_utils:has_verb - #20:a_or_an line 4:
$object_utils:has_verb - #20:ps_backup line 41:
$object_utils:has_verb - #24:verbdoc line 5:
$object_utils:has_verb - #24:objectdoc line 4:
$object_utils:has_verb - #33:pick line 10:
$ou:has_verb - #37:expire_old_messages line 5:
$object_utils:has_verb - #38:mail_forward line 2:
$object_utils:has_verb - #43:invoke line 39:
$object_utils:has_verb - #44:match_verb line 3:
$object_utils:has_verb - #46:eval_key_new line 30:
$object_utils:has_verb - #46:eval_key_new line 34:
$object_utils:has_verb - #48:explain_syntax line 5:
$object_utils:has_verb - #48:do_huh line 30:
$ou:has_verb - #48:do_huh line 31:
$ou:has_verb - #50:@verb line 27:
$object_utils:has_verb - #50:@copy line 51:
$object_utils:has_verb - #50:@d*isplay line 109:
$object_utils:has_verb - #50:@d*isplay line 128:
$object_utils:has_verb - #50:find_verb line 9:
$ou:has_verb - #50:find_help line 19:
$object_utils:has_verb - #51:show_verbdef line 3:
$object_utils:has_verb - #52:get_topic line 8:
$object_utils:has_verb - #65:replace line 48:
$object_utils:has_verb - #68:help_msg line 7:
$object_utils:has_verb - #75:measurement_task_body line 28:
$object_utils:has_verb - #92:doing_msg line 6:
$ou:has_verb - #95:hit_msg line 3:
$ou:has_verb - #95:hit_msg line 4:
$ou:has_verb - #96:check line 23:
$ou:has_verb - #96:check_bak line 35:
$ou:has_verb - #100:st*atus line 9:
$ou:has_verb - #103:_old_draw_map line 31:
$ou:has_verb - #103:draw_map_www line 59:
$ou:has_verb - #103:tell_contents_sub line 17:
$ou:has_verb - #103:fill_bottle line 34:
$ou:has_verb - #107:take_damage line 19:
$ou:has_verb - #107:take_damage line 58:
$ou:has_verb - #107:do_command line 34:
$ou:has_verb - #107:get_gift line 15:
$ou:has_verb - #107:drop line 16:
$ou:has_verb - #107:get line 18:
$ou:has_verb - #107:get line 18:
$ou:has_verb - #107:get line 19:
$ou:has_verb - #107:text_sub line 19:
$ou:has_verb - #114:do_reset line 4:
$ou:has_verb - #114:find_reset_listeners line 7:
$ou:has_verb - #119:hear_event_say line 3:
$ou:has_verb - #128:light line 14:
$ou:has_verb - #128:use_finish line 11:
$ou:has_verb - #134:_turn_on line 4:
$ou:has_verb - #146:hear_event_say line 3:
$ou:has_verb - #166:award_to line 45:
$ou:has_verb - #182:_finish line 3:
$object_utils:has_verb - #184:_finish line 68:
$ou:has_verb - #184:_finish line 68:
$ou:has_verb - #184:_finish line 74:
$ou:has_verb - #184:_finish line 74:
$ou:has_verb - #184:_finish line 87:
$ou:has_verb - #184:_finish line 87:
$ou:has_verb - #184:_finish line 93:
$ou:has_verb - #184:_finish line 93:
$ou:has_verb - #184:_finish line 99:
$ou:has_verb - #184:_finish line 99:
$ou:has_verb - #224:_finish line 3:
$object_utils:has_verb - #247:affect_thing line 3:
$ou:has_verb - #251:_cannot_add_verb line 3:
$ou:has_verb - #257:_render_map line 93:
$ou:has_verb - #257:smell line 13:
$ou:has_verb - #338:fill line 27:
$ou:has_verb - #338:fill line 36:
$ou:has_verb - #354:match_request line 4:
$object_utils:has_verb
Source
1":has_verb(OBJ object, STR verbname)"; 2"Find out if an object has a verb matching the given verbname."; 3"Returns {location} if so, 0 if not, where location is the object or the ancestor on which the verb is actually defined."; 4return valid(args[1]) && has_callable_verb(@args);
has_callable_verb
Referenced by
- #6:set_home line 8:
$object_utils:has_callable_verb - #32:available line 12:
$object_utils:has_callable_verb - #32:why_bad_name line 24:
$object_utils:has_callable_verb - #38:raw_send line 51:
$object_utils:has_callable_verb - #38:name line 7:
$object_utils:has_callable_verb - #38:rm_message_seq line 26:
$object_utils:has_callable_verb - #38:undo_rmm line 25:
$object_utils:has_callable_verb - #40:set_note_text line 19:
$object_utils:has_callable_verb - #40:note_match_failed line 15:
$object_utils:has_callable_verb - #40:note_match_failed line 15:
$object_utils:has_callable_verb - #49:mcd_2 line 77:
$object_utils:has_callable_verb - #50:find_help line 11:
$object_utils:has_callable_verb - #51:set_property_value line 13:
$object_utils:has_callable_verb - #52:full_index line 3:
$object_utils:has_callable_verb - #57:request line 15:
$object_utils:has_callable_verb - #62:set line 23:
$object_utils:has_callable_verb - #62:parse line 51:
$object_utils:has_callable_verb - #62:show line 12:
$object_utils:has_callable_verb - #65:add_cleanup line 33:
$object_utils:has_callable_verb - #65:send_home line 13:
$object_utils:has_callable_verb
Source
1"Usage: has_callable_verb(object, verb)"; 2"See if an object has a verb that can be called by another verb (i.e., that has its x permission bit set)."; 3"Return {location}, where location is the object that defines the verb, or 0 if the object doesn't have the verb."; 4return valid(args[1]) && has_callable_verb(@args);
match_verb
Referenced by
none
Source
1":match_verb(OBJ object, STR verb)"; 2"Find out if an object has a given verb, and some information about it."; 3"Returns {OBJ location, STR verb} if matched, 0 if not."; 4"Location is the object on which it is actually defined, verb is a name"; 5"for the verb which can subsequently be used in verb_info (i.e., no"; 6"asterisks)."; 7verbname = strsub(args[2], "*", ""); 8object = args[1]; 9while (E_VERBNF == (info = `verb_info(object, verbname) ! E_VERBNF, E_INVARG')) 10object = parent(object); 11endwhile 12return info ? {object, verbname} | 0;
isa
Referenced by
- #0:user_reconnected line 17:
$object_utils:isa - #2:@chparent line 6:
$object_utils:isa - #2:@chparent line 9:
$object_utils:isa - #2:@chparent line 13:
$object_utils:isa - #3:recalc_next_hops line 9:
$ou:isa - #3:building line 3:
$ou:isa - #4:co*nnect line 23:
$object_utils:isa - #4:co*nnect line 70:
$object_utils:isa - #6:edit_option line 2:
$object_utils:isa - #6:@registerme line 7:
$object_utils:isa - #9:restore_from line 17:
$object_utils:isa - #17:set_programmer line 7:
$object_utils:isa - #17:set_programmer line 17:
$object_utils:isa - #17:set_player line 9:
$object_utils:isa - #17:set_player line 19:
$object_utils:isa - #17:initialize_owned line 8:
$object_utils:isa - #17:boot_idlers line 26:
$object_utils:isa - #17:boot_idlers line 36:
$object_utils:isa - #17:newt_player line 25:
$object_utils:isa - #17:unset_programmer line 13:
$object_utils:isa - #21:object_audit_string line 71:
$object_utils:isa - #33:parse_mailread_cmd line 35:
$object_utils:isa - #33:@subscribe*-quick line 40:
$object_utils:isa - #33:@subscribe*-quick line 56:
$object_utils:isa - #33:mail_catch_up line 9:
$object_utils:isa - #33:@unsub*scribe line 28:
$object_utils:isa - #33:@unsub*scribe line 36:
$object_utils:isa - #33:@mail-all-new*-mail line 10:
$object_utils:isa - #33:@mail-all-new*-mail line 10:
$object_utils:isa - #33:@read-all-new*-mail line 15:
$object_utils:isa - #33:@read-all-new*-mail line 15:
$object_utils:isa - #33:@quick*send line 8:
$object_utils:isa - #37:is_usable_by line 5:
$object_utils:isa - #38:resolve_addr line 21:
$object_utils:isa - #38:is_readable_by line 2:
$object_utils:isa - #39:not-to*: line 8:
$object_utils:isa - #39:parse_msg_headers line 13:
$object_utils:isa - #43:new_session line 3:
$object_utils:isa - #43:get_room line 8:
$object_utils:isa - #44:object_match_failed line 23:
$object_utils:isa - #45:has_a line 4:
$ou:isa - #49:@programmer line 17:
$object_utils:isa - #49:make-core-database line 37:
$object_utils:isa - #49:make-core-database line 37:
$object_utils:isa - #49:mcd_2 line 68:
$object_utils:isa - #49:@toad line 40:
$object_utils:isa - #49:@untoad line 10:
$object_utils:isa - #49:@players line 41:
$object_utils:isa - #49:@make-guest line 11:
$object_utils:isa - #49:coredat line 28:
$object_utils:isa - #49:coredat line 28:
$object_utils:isa - #50:walkto line 8:
$ou:isa - #55:fly_ok line 2:
$ou:isa - #57:request line 13:
$object_utils:isa - #65:replace line 60:
$object_utils:isa - #65:add_cleanup line 8:
$object_utils:isa - #65:add_cleanup line 21:
$object_utils:isa - #65:add_cleanup line 24:
$object_utils:isa - #65:send_home line 8:
$object_utils:isa - #65:is_litter line 3:
$object_utils:isa - #65:is_litter line 3:
$object_utils:isa - #71:parse_dig_room line 18:
$object_utils:isa - #81:trivial_check line 10:
$object_utils:isa - #89:@join_old line 31:
$object_utils:isa - #94:accept line 1:
$ou:isa - #95:acceptable line 1:
$ou:isa - #100:respawn line 4:
$ou:isa - #107:respawn line 8:
$ou:isa - #107:doses_of line 2:
$ou:isa - #107:onset_of line 2:
$ou:isa - #125:try_cure line 5:
$ou:isa - #129:put line 23:
$ou:isa - #129:do_put line 3:
$ou:isa - #137:forbid_action_move line 8:
$ou:isa - #137:forbid_action_move line 15:
$ou:isa - #137:forbid_action_move line 21:
$ou:isa - #142:enter_room line 24:
$ou:isa - #142:maybe_assist line 1:
$ou:isa - #143:give_keys_to line 3:
$ou:isa - #144:hang line 4:
$ou:isa - #144:hang line 6:
$ou:isa - #146:_open line 16:
$ou:isa - #146:_is_locked line 4:
$ou:isa - #146:_can_be_unlocked_by line 6:
$ou:isa - #146:die line 2:
$ou:isa - #147:is_feasible_old line 8:
$ou:isa - #148:recycle line 1:
$ou:isa - #148:_knockout line 1:
$ou:isa - #148:entomb line 2:
$ou:isa - #301:destroy_session line 4:
$object_utils:isa - #310:is_char*acter line 2:
$object_utils:isa - #312:@add-package line 4:
$object_utils:isa
Source
1":isa(x,y) == valid(x) && (y==x || y in :ancestors(x))"; 2return is_a(@args);
ancestors
Referenced by
- #2:@digg line 37:
$object_utils:ancestors - #2:@digg line 40:
$object_utils:ancestors - #2:@par*ents line 11:
$object_utils:ancestors - #2:@d*isplay line 70:
$object_utils:ancestors - #2:@d*isplay line 117:
$object_utils:ancestors - #4:? line 5:
$object_utils:ancestors - #4:parse_command line 14:
$object_utils:ancestors - #5:find_recipe line 1:
$ou:ancestors - #17:move_prop_down line 8:
$ou:ancestors - #37:add_forward line 10:
$object_utils:ancestors - #38:touch line 9:
$object_utils:ancestors - #38:match line 8:
$object_utils:ancestors - #38:is_recipient line 1:
$object_utils:ancestors - #39:parse_msg_headers line 29:
$object_utils:ancestors - #39:parse_msg_headers(slow) line 34:
$object_utils:ancestors - #45:property_definer line 6:
$ou:ancestors - #50:@d*isplay line 70:
$object_utils:ancestors - #50:@d*isplay line 117:
$object_utils:ancestors - #50:@list*# line 75:
$object_utils:ancestors - #51:help_db_list line 4:
$object_utils:ancestors - #51:help_db_list line 6:
$object_utils:ancestors - #51:dump_properties line 32:
$object_utils:ancestors - #75:measurement_task_body line 59:
$object_utils:ancestors - #75:measurement_task_body line 67:
$object_utils:ancestors - #89:lookup_room line 21:
$object_utils:ancestors - #113:@vloc line 18:
$ou:ancestors - #113:@vloc line 20:
$ou:ancestors - #317:do_scope line 14:
$ou:ancestors - #342:_clone line 3:
$object_utils:ancestors
Source
1"Usage: ancestors(object[, object...])"; 2"Return a list of all ancestors of the object(s) in args, with no duplicates."; 3"If called with a single object, the result will be in order ascending up the inheritance hierarchy. If called with multiple objects, it probably won't."; 4ret = {}; 5for o in (args) 6what = o; 7while (valid(what = parent(what))) 8ret = setadd(ret, what); 9endwhile 10endfor 11return ret;
ordered_descendants
Referenced by
none
Source
1r = {what = args[1]}; 2for k in (children(what)) 3if (children(k)) 4r = {@r, @this:(verb)(k)}; 5else 6r = {@r, k}; 7endif 8endfor 9return r;
contains
Referenced by
- #46:eval_key line 7:
$object_utils:contains - #46:eval_key_new line 7:
$object_utils:contains - #89:teleport line 25:
$object_utils:contains
Source
1"$object_utils:contains(obj1, obj2) -- does obj1 contain obj2?"; 2""; 3"Return true iff obj2 is under obj1 in the containment hierarchy; that is, if obj1 is obj2's location, or its location's location, or ..."; 4{loc, what} = args; 5return is_in(what, loc); 6while (valid(what)) 7what = what.location; 8if (what == loc) 9return valid(loc); 10endif 11endwhile 12return 0;
all_contents
Referenced by
- #45:all_contents line 4:
this:all_contents - #46:eval_key_new line 22:
$object_utils:all_contents - #46:eval_key_new line 33:
$object_utils:all_contents - #49:@recycle-recursive line 11:
$ou:all_contents - #49:@recycle-recursive line 12:
$ou:all_contents
Source
1"all_contents(object)"; 2"Return a list of all objects contained (at some level) by object."; 3for y in (res = args[1].contents) 4y.contents && (res = {@res, @this:all_contents(y)}); 5endfor 6return res;
findable_properties
Referenced by
none
Source
1"findable_properties(object)"; 2"Return a list of properties on those members of object's ancestor list that are readable or are owned by the caller (or all properties if the caller is a wizard)."; 3what = args[1]; 4props = {}; 5who = caller_perms(); 6while (what != $nothing) 7if ((what.r || (who == what.owner)) || who.wizard) 8props = {@properties(what), @props}; 9endif 10what = parent(what); 11endwhile 12return props;
owned_properties
Referenced by
none
Source
1"owned_properties(what[, who])"; 2"Return a list of all properties on WHAT owned by WHO."; 3"Only wizardly verbs can specify WHO; mortal verbs can only search for properties owned by their own owners. For more information, talk to Gary_Severn."; 4what = anc = args[1]; 5who = ((c = caller_perms()).wizard && (length(args) > 1)) ? args[2] | c; 6props = {}; 7while (anc != $nothing) 8for k in (properties(anc)) 9if (property_info(what, k)[1] == who) 10props = listappend(props, k); 11endif 12endfor 13anc = parent(anc); 14endwhile 15return props;
property_conflicts
Referenced by
- #2:@check-chp*arent line 13:
$object_utils:property_conflicts
Source
1":property_conflicts(object,newparent)"; 2"Looks for propertyname conflicts that would keep chparent(object,newparent)"; 3" from working."; 4"Returns a list of elements of the form {<propname>, @<objectlist>}"; 5"where <objectlist> is list of descendents of object defining <propname>."; 6if (!valid(object = args[1])) 7return E_INVARG; 8elseif (!valid(newparent = args[2])) 9return (newparent == #-1) ? {} | E_INVARG; 10elseif (!($perm_utils:controls(caller_perms(), object) && (newparent.f || $perm_utils:controls(caller_perms(), newparent)))) 11"... if you couldn't chparent anyway, you don't need to know..."; 12return E_PERM; 13endif 14"... properties existing on newparent"; 15"... cannot be present on object or any descendent..."; 16props = conflicts = {}; 17for o in ({object, @$object_utils:descendents_suspended(object)}) 18for p in (properties(o)) 19if (`property_info(newparent, p) ! E_PROPNF => 0') 20if (i = p in props) 21conflicts[i] = {@conflicts[i], o}; 22else 23props = {@props, p}; 24conflicts = {@conflicts, {p, o}}; 25endif 26endif 27$command_utils:suspend_if_needed(0); 28endfor 29$command_utils:suspend_if_needed(0); 30endfor 31return conflicts;
descendants_with_property_suspended
Referenced by
- #45:descendants_with_property_suspended line 11:
this:descendants_with_property_suspended - #50:@check-p*roperty line 10:
$object_utils:descendants_with_property_suspended
Source
1":descendants_with_property_suspended(object,property)"; 2" => list of descendants of object on which property is defined."; 3"calls suspend(0) as needed"; 4{object, prop} = args; 5yield; 6if (`property_info(object, prop) ! E_PROPNF => 0') 7return {object}; 8endif 9r = {}; 10for c in (children(object)) 11r = {@r, @this:descendants_with_property_suspended(c, prop)}; 12endfor 13return r;
locations
Referenced by
- #2:@location*s line 9:
$object_utils:locations
Source
1"Usage: locations(object)"; 2"Return a listing of the location hierarchy above object."; 3ret = {}; 4what = args[1]; 5while (valid(what = what.location)) 6ret = {@ret, what}; 7endwhile 8return ret;
all_properties_suspended all_verbs_suspended
Referenced by
- #75:property_overhead_bytes line 1:
$object_utils:all_properties_suspended
Source
1"Syntax: all_properties_suspended (OBJ what)"; 2" all_verbs_suspended (OBJ what)"; 3""; 4"Returns all properties or verbs defined on `what' and all of its ancestors. Uses wizperms to get properties or verbs if the caller of this verb owns what, otherwise, uses caller's perms. Suspends as necessary"; 5what = args[1]; 6if (what.owner != caller_perms()) 7set_task_perms(caller_perms()); 8endif 9bif = (verb == "all_verbs") ? "verbs" | "properties"; 10res = `call_function(bif, what) ! E_PERM => {}'; 11while (valid(what = parent(what))) 12res = {@`call_function(bif, what) ! E_PERM => {}', @res}; 13$command_utils:suspend_if_needed(0); 14endwhile 15return res;
connected
Referenced by
- #4:co*nnect line 106:
$object_utils:connected - #33:notify_mail line 4:
$object_utils:connected - #65:move_players_home line 16:
$object_utils:connected
Source
1":connected(object) => true if object is a connected player."; 2"equivalent to (object in connected_players()) for valid players, perhaps with less server overhead."; 3"use object:is_listening() if you want to allow for puppets and other non-player objects that still 'care' about what's said."; 4return typeof(`connected_seconds(@args) ! E_INVARG') == INT;
isoneof
Referenced by
none
Source
1":isoneof(x,y) = x isa z, for some z in list y"; 2{what, targ} = args; 3while (valid(what)) 4if (what in targ) 5return 1; 6endif 7what = parent(what); 8endwhile 9return 0;
defines_verb
Referenced by
- #43:init_for_core line 7:
$object_utils:defines_verb - #49:make-core-database line 130:
$object_utils:defines_verb - #49:coredat line 98:
$object_utils:defines_verb - #51:move_verb line 19:
$object_utils:defines_verb - #51:copy_verb line 20:
$object_utils:defines_verb - #64:init_for_core line 2:
$object_utils:defines_verb
Source
1"Returns 1 if the verb is actually *defined* on this object, 0 else."; 2"Use this instead of :has_verb if your aim is to manipulate that verb code or whatever."; 3return `verb_info(@args) ! ANY => 0' && 1; 4"Old code below...Ho_Yan 10/22/96"; 5info = verb_info(@args); 6return typeof(info) != ERR;
defines_property
Referenced by
- #17:move_prop_down line 6:
$ou:defines_property - #17:move_prop_up line 6:
$ou:defines_property - #17:move_prop_up line 15:
$ou:defines_property - #51:move_prop*erty line 14:
$object_utils:defines_property
Source
1":defines_property(OBJ object, STR property name) => Returns 1 if the property is actually *defined* on the object given"; 2if (!valid(o = args[1])) 3return 0; 4elseif (!valid(p = parent(o))) 5return this:has_property(o, args[2]); 6else 7return (!this:has_property(p, args[2])) && this:has_property(o, args[2]); 8endif
has_any_verb has_any_property
Referenced by
none
Source
1":has_any_verb(object) / :has_any_property(object)"; 2" -- does `object' have any verbs/properties?"; 3return !(!`(verb == "has_any_verb") ? verbs(args[1]) | properties(args[1]) ! E_INVARG => 0');
has_readable_prop*erty hrp
Referenced by
none
Source
1":has_readable_property(OBJ object, STR property name) => 1 if property exists and is publically readable (has the r flag set true)."; 2{object, prop} = args; 3try 4pinfo = property_info(object, prop); 5return index(pinfo[2], "r") != 0; 6except (E_PROPNF) 7return (prop in $code_utils.builtin_props) > 0; 8endtry
descendants descendents
Referenced by
- #6:ip_total line 2:
$ou:descendants - #25:do_reset line 25:
$object_utils:descendants - #39:showlists line 2:
$object_utils:descendants - #53:is_writable_by line 1:
$object_utils:descendants - #95:@setup line 10:
$ou:descendants - #317:@countweapons line 3:
$ou:descendants - #317:@countarmor line 8:
$ou:descendants - #361:@unprop line 1:
$ou:descendants - #361:@cv line 1:
$ou:descendants - #361:@cp line 1:
$ou:descendants
Source
1":descendants (OBJ object) => {OBJs} all nested children of <object>"; 2r = children(args[1]); 3i = 1; 4while (i <= length(r)) 5if (kids = children(r[i])) 6r = {@r, @kids}; 7endif 8i = i + 1; 9endwhile 10return r;
leaves
Referenced by
- #6:teach line 7:
$ou:leaves - #6:_brainscan line 15:
$ou:leaves - #6:_heartbeat_age line 19:
$ou:leaves - #6:tell_standings line 2:
$ou:leaves - #6:job*s line 80:
$ou:leaves - #17:connected_wizards line 2:
$object_utils:leaves - #17:all_wizards_advertised line 2:
$object_utils:leaves - #17:is_wizard line 7:
$object_utils:leaves - #25:defer line 15:
$object_utils:leaves - #49:@guests line 14:
$object_utils:leaves - #49:@prog-check line 10:
$ou:leaves - #50:@task*s line 15:
$ou:leaves - #52:wizard_list line 2:
$object_utils:leaves - #89:_morph line 10:
$ou:leaves - #89:revert_code_name line 2:
$ou:leaves - #95:@setup line 4:
$ou:leaves - #95:@setup line 20:
$ou:leaves - #95:@setup line 31:
$ou:leaves - #97:flush line 2:
$ou:leaves - #100:sc*ore line 16:
$ou:leaves - #107:@setup line 8:
$ou:leaves - #111:@setup line 21:
$ou:leaves - #111:@setup line 32:
$ou:leaves - #112:holiday_today line 3:
$ou:leaves - #114:@weather-compile line 5:
$ou:leaves - #114:random_npc line 18:
$ou:leaves - #126:description line 4:
$ou:leaves - #142:show_sheet line 14:
$ou:leaves - #148:setup line 10:
$ou:leaves - #166:rumors line 2:
$ou:leaves - #167:disband_cleanup line 11:
$ou:leaves - #214:drift_clouds line 2:
$ou:leaves - #214:disperse_clouds line 2:
$ou:leaves - #223:calculate line 1:
$ou:leaves - #293:display_top_allfolders line 4:
$ou:leaves - #293:display_assigned_allfolders line 3:
$ou:leaves - #302:find_type line 2:
$object_utils:leaves - #307:pick_part line 4:
$ou:leaves - #307:forge_name line 20:
$ou:leaves - #317:@allitems line 35:
$ou:leaves - #317:@checkloot line 1:
$ou:leaves - #317:@checkloot line 2:
$ou:leaves
Source
1twigs = {args[1]}; 2leaves = {}; 3while (twigs) 4{l, @twigs} = twigs; 5if (kids = children(l)) 6twigs = {@kids, @twigs}; 7else 8leaves = {@leaves, l}; 9endif 10endwhile 11return leaves;
branches
Referenced by
- #317:@monsters line 48:
$ou:branches - #317:@monsters-xp line 8:
$ou:branches - #317:@monsters-new line 6:
$ou:branches
Source
1":branches (OBJ object) => {OBJs} descendants of <object> that have children"; 2r = args[1..1]; 3i = 1; 4while (i <= length(r)) 5if (kids = children(r[i])) 6r[i + 1..i] = kids; 7i = i + 1; 8else 9r[i..i] = {}; 10endif 11endwhile 12return r;
descendants_suspended descendents_suspended
Referenced by
- #1:number_of line 1:
$ou:descendants_suspended - #2:tell_tree line 21:
$ou:descendants_suspended - #2:tell_mytree line 35:
$ou:descendants_suspended - #17:move_prop_down line 16:
$ou:descendants_suspended - #17:move_prop_down line 22:
$ou:descendants_suspended - #17:move_prop_up line 25:
$ou:descendants_suspended - #17:move_prop_up line 31:
$ou:descendants_suspended - #45:property_conflicts line 17:
$object_utils:descendents_suspended - #45:objects_with_verb line 9:
$ou:descendants_suspended - #317:allitems line 20:
$ou:descendants_suspended - #317:@allitems line 8:
$object_utils:descendants_suspended
Source
1":descendants_suspended (OBJ object) => {OBJs} all nested children of <object>"; 2set_task_perms(caller_perms()); 3{what, ?susptime = 1} = args; 4r = children(what); 5i = 1; 6while (i <= length(r)) 7if (kids = children(r[i])) 8r = {@r, @kids}; 9endif 10i = i + 1; 11$cu:sin(susptime); 12endwhile 13return r;
leaves_suspended
Referenced by
- #1:named line 4:
$ou:leaves_suspended - #4:is_admin_alt line 2:
$ou:leaves_suspended - #6:journal*s line 62:
$ou:leaves_suspended - #6:tell_wanted line 2:
$ou:leaves_suspended - #17:expire_mail_lists line 5:
$object_utils:leaves_suspended - #49:reaper line 1:
$ou:leaves_suspended - #50:@current-daily-gain line 6:
$ou:leaves_suspended - #89:@morph line 1:
$ou:leaves_suspended - #96:report_daily_gain line 1:
$ou:leaves_suspended - #103:angel_of_death line 3:
$ou:leaves_suspended - #103:clear_signs_for line 2:
$ou:leaves_suspended - #103:meat_raper line 1:
$ou:leaves_suspended - #107:show_score_full line 24:
$ou:leaves_suspended - #107:show_score_full line 28:
$ou:leaves_suspended - #113:@leaves line 11:
$ou:leaves_suspended - #145:recycle line 2:
$ou:leaves_suspended - #145:recycle line 7:
$ou:leaves_suspended - #150:clear_all line 6:
$ou:leaves_suspended - #150:register_all line 2:
$ou:leaves_suspended - #150:register_all_long line 3:
$ou:leaves_suspended - #150:@h-areas line 2:
$ou:leaves_suspended - #150:megacheck line 14:
$ou:leaves_suspended - #223:calculate line 22:
$ou:leaves_suspended - #296:_start line 4:
$ou:leaves_suspended - #297:report_from_issuelists line 3:
$ou:leaves_suspended - #297:update_issuelist_counts line 1:
$ou:leaves_suspended - #317:@monsters-new line 3:
$ou:leaves_suspended - #317:@aspy line 1:
$ou:leaves_suspended - #317:@globstatus line 1:
$ou:leaves_suspended - #317:@checkspeciesquests line 1:
$ou:leaves_suspended
Source
1{what, ?ytime = 1} = args; 2twigs = {what}; 3leaves = {}; 4while (twigs) 5{l, @twigs} = twigs; 6if (kids = children(l)) 7twigs = {@kids, @twigs}; 8else 9leaves = {@leaves, l}; 10endif 11yield ytime; 12endwhile 13return leaves;
branches_suspended
Referenced by
- #5:find_recipe line 5:
$ou:branches_suspended - #5:find_recipe line 16:
$ou:branches_suspended - #17:move_prop_up line 8:
$ou:branches_suspended - #17:move_prop_up line 13:
$ou:branches_suspended - #95:tree_tag line 6:
$ou:branches_suspended - #145:recycle line 5:
$ou:branches_suspended - #317:update_monsters line 1:
$ou:branches_suspended
Source
1":branches_suspended (OBJ object [, INT suspend]) => {OBJs} all descendants of"; 2" <object> with children."; 3set_task_perms(caller_perms()); 4r = args[1..1]; 5suspend = (length(args) > 1) ? args[2] | 0; 6i = 1; 7while (i <= length(r)) 8if (kids = children(r[i])) 9r[i + 1..i] = kids; 10i = i + 1; 11else 12r[i..i] = {}; 13endif 14$command_utils:suspend_if_needed(suspend); 15endwhile 16return r;
disown disinherit
Referenced by
- #50:@disown line 26:
$object_utils:disown
Source
1":disown(object) / :disinherit(object)"; 2" => 1 (for a successful disinheritance)"; 3" raises E_PERM, E_INVARG, E_ARGS"; 4cp = caller_perms(); 5" no set_task_perms() because we need to be able to"; 6" chparent() an object we don't own"; 7{victim} = args; 8parent = parent(victim); 9if ($perm_utils:controls(cp, victim)) 10raise(E_INVARG, tostr(victim.name, " (", victim, ") is yours. Use @chparent.")); 11elseif (!valid(parent)) 12raise(E_INVARG, tostr(victim.name, " (", victim, ") is already an orphan.")); 13elseif (!$perm_utils:controls(cp, parent)) 14raise(E_PERM, tostr(parent.name, " (", parent, "), the parent of ", victim.name, " (", victim, "), is not yours.")); 15elseif (!valid(grandparent = parent(parent))) 16"... still not sure about this... do we care? --Rog..."; 17raise(E_INVARG, tostr(victim.name, " (", victim, ") has no grandparent to take custody.")); 18else 19chparent(victim, grandparent); 20return 1; 21endif
accessible_verbs
Referenced by
- #2:@d*isplay line 91:
$object_utils:accessible_verbs - #50:@d*isplay line 91:
$object_utils:accessible_verbs - #50:@verbs* line 20:
$object_utils:accessible_verbs - #51:_find_verbs_containing line 7:
$object_utils:accessible_verbs - #51:_find_verbs_matching line 7:
$object_utils:accessible_verbs
Source
1" accessible_verbs(object) => a list of verb names (or E_PERM) regardless of readability of object"; 2set_task_perms(caller_perms()); 3thing = args[1]; 4verbs = {}; 5i = 1; 6while ((info = `verb_info(thing, i) ! ANY') != E_VERBNF) 7verbs = {@verbs, info ? info[3] | E_PERM}; 8i = i + 1; 9endwhile 10return verbs;
fertile_kids
Referenced by
none
Source
1what = args[1]; 2kids = {}; 3for x in (children(what)) 4if (x.f || children(x)) 5kids = setadd(kids, x); 6endif 7endfor 8return kids;
has_a
Referenced by
none
Source
1":has_a(LIST object-list, OBJ object-type)"; 2"If there's a descendant of object-type in object-list, return it, otherwise #-1."; 3for x in (args[1]) 4if ($ou:isa(x, args[2])) 5return x; 6endif 7endfor 8return #-1;
fertile_branches
Referenced by
- #1:named line 4:
$ou:fertile_branches - #45:fertile_branches line 13:
this:fertile_branches - #103:random_treasure line 18:
$ou:fertile_branches - #103:random_treasure line 25:
$ou:fertile_branches - #313:find_in_spawns line 4:
$ou:fertile_branches
Source
1":fertile_branches(OBJ what [, LIST got])"; 2"Return all kids & grandkids that are fertile."; 3if (length(args) > 1) 4got = args[2]; 5else 6got = {}; 7endif 8what = args[1]; 9for x in (children(what)) 10$cu:sin(); 11if (x.f) 12got = {@got, x}; 13got = {@got, @this:fertile_branches(x)}; 14endif 15endfor 16return got;
verb_name
Referenced by
none
Source
1{verb_name} = args; 2verb_name = $su:explode(verb_name)[1]; 3if (star = index(verb_name, "*")) 4verb_name = verb_name[1..star - 1]; 5endif 6return verb_name;
fertile_kids_suspended
Referenced by
- #2:tell_tree line 53:
$ou:fertile_kids_suspended - #2:tell_mytree line 43:
$ou:fertile_kids_suspended
Source
1what = args[1]; 2kids = {}; 3for x in (children(what)) 4if (x.f || children(x)) 5kids = setadd(kids, x); 6endif 7$cu:sin(2); 8endfor 9return kids;
fertile_descendants_suspended
Referenced by
- #103:set_recipes line 1:
$ou:fertile_descendants_suspended
Source
1s = {}; 2what = args[1]; 3for x in (children(what)) 4$cu:sin(); 5if (x.f) 6s = listappend(s, x); 7s = {@s, @this:(verb)(x)}; 8endif 9endfor 10return s;
objects_with_verb
Referenced by
none
Source
1{findstr, ?from = #-1} = args; 2if (typeof(findstr) != STR) 3raise(E_INVARG, "findstr (arg 1) must be string"); 4elseif (typeof(from) != OBJ) 5raise(E_INVARG, "from (arg 2) must be object"); 6endif 7results = {}; 8if (from) 9for o in ($ou:descendants_suspended(from)) 10if (`verb_info(o, findstr) ! ANY => {}') 11results = {@results, o}; 12endif 13$cu:sin(); 14endfor 15else 16for o in [#0..max_object()] 17if (`verb_info(o, findstr) ! ANY => {}') 18results = {@results, o}; 19endif 20$cu:sin(); 21endfor 22endif 23return results;
tree_properties
Referenced by
- #317:update_sources line 4:
$ou:tree_properties - #317:update_sources line 17:
$ou:tree_properties - #317:update_sources line 35:
$ou:tree_properties - #317:update_sources line 48:
$ou:tree_properties - #317:update_sources line 67:
$ou:tree_properties - #317:update_sources line 85:
$ou:tree_properties - #317:update_sources line 98:
$ou:tree_properties - #317:update_sources line 114:
$ou:tree_properties - #317:update_sources line 127:
$ou:tree_properties
Source
1":tree_properties(OBJ from, STR propname) => an alist of values of properties of objects descended from 'from'."; 2" => { {OBJ a, ANY a.propname}, {OBJ b, ANY b.propname}, ... }"; 3{from, propname} = args; 4if (propname == "") 5raise(E_INVARG); 6return {}; 7endif 8result = {}; 9togo = {from}; 10try 11from.(propname); 12except e (E_PROPNF) 13raise(E_PROPNF, tostr(from, " does not define .", propname)); 14return {}; 15endtry 16while (togo) 17o = togo[1]; 18try 19result = {@result, {o, o.(propname)}}; 20togo = {@togo, @children(o)}; 21except e (ANY) 22"oh well"; 23endtry 24togo = togo[2..$]; 25$cu:sin(); 26endwhile 27return result;
siblings
Referenced by
- #17:move_prop_up line 11:
$ou:siblings
Source
1target = args[1]; 2return setremove(children(parent(target)), target);
limited_children
Referenced by
none
Source
1{OBJ, n} = args; 2if (n) 3children = children(OBJ); 4return $lu:append(children, @$lu:map_arg(this, verb, children, n - 1)); 5else 6return {}; 7endif
limited_children_suspended
Referenced by
none
Source
1{OBJ, n} = args; 2$cu:sin(); 3if (n) 4children = children(OBJ); 5return $lu:append(children, @$lu:map_arg(this, verb, children, n - 1)); 6else 7return {}; 8endif
has_verb_and_args
Referenced by
none
Source
1":has_verb_and_args(OBJ o, STR verb, STR arg, STR arg, STR arg) => 1|0"; 2{o, v, dstr, astr, istr} = args; 3try 4verbargs = verb_args(o, v); 5return {dstr, astr, istr} == verbargs; 6except e (E_VERBNF) 7return 0; 8endtry
property_definer
Referenced by
- #50:@canedit line 78:
$ou:property_definer
Source
1":property_defined(OBJ an object with the prop, STR propname) => OBJ which actually defines said prop. #-1 for built in props."; 2{object, pname} = args; 3if (pname in $code_utils.builtin_props) 4return #-1; 5endif 6for o in ({@$lu:reverse($ou:ancestors(object)), object}) 7if (`property_info(o, pname) ! E_PROPNF') 8return o; 9endif 10endfor 11raise(E_PROPNF);
is_in_a
Referenced by
- #2:tell_tree line 65:
$ou:is_in_a
Source
1return is_in_a(@args);
treesize
Referenced by
none
Source
1{parent} = args; 2todo = children(parent); 3size = 0; 4while (todo) 5o = todo[1]; 6size = size + object_bytes(o); 7todo = {@todo[2..$], @children(o)}; 8yield; 9endwhile 10return size;
is_true
Referenced by
none
Source
1"is_true(OBJ, STR or LIST prop ref)"; 2"This little util is specifically for use with $list_utilities:remove_*. Does the obvious."; 3{object, prop} = args; 4ref = object; 5if (typeof(prop) == LIST) 6for p in (prop) 7ref = ref.(p); 8endfor 9else 10ref = object.(prop); 11endif 12return !(!ref);
bf_op
Referenced by
none
Source
1":bf_op(OBJ, STR or LIST prop ref, STR builtin function, arg, arg, ...)"; 2"This is to allow $lu:remove_* to perform functions on properties of the objects in the list given without corrupting the original list for the results."; 3{object, prop, func, @fargs} = args; 4if (typeof(prop) == LIST) 5for p in (prop) 6object = object.(p); 7endfor 8else 9object = object.(prop); 10endif 11return !(!$bf:(func)(object, @fargs));
bf_op_eq_to bf_op_equal_to bf_op_eq bf_op_greater_than bf_op_gt bf_op_less_than bf_op_lt bf_op_not_equal_to bf_op_ne bf_op_greater_than_eq bf_op_ge bf_op_less_than_eq bf_op_le
Referenced by
none
Source
1":bf_op(OBJ, STR or LIST prop ref, STR builtin function, ANY val to compare, arg, arg, ...)"; 2"Same as this:bf_op except that it checks if the result is equivalent to, greater than, less than, etc. a given value. More shit for $lu:remove_*."; 3{object, prop, func, val, @fargs} = args; 4if (typeof(prop) == LIST) 5for p in (prop) 6object = object.(p); 7endfor 8else 9object = object.(prop); 10endif 11ref = `$bf:(func)(object, @fargs) ! ANY'; 12if (verb in {"bf_op_equal_to", "bf_op_eq", "bf_op_eq"}) 13return ref == val; 14elseif (verb in {"bf_op_not_equal_to", "bf_op_ne"}) 15return ref != val; 16elseif (verb in {"bf_op_greater_than", "bf_op_gt"}) 17return ref > val; 18elseif (verb in {"bf_op_less_than", "bf_op_lt"}) 19return ref < val; 20elseif (verb in {"bf_op_greater_than_eq", "bf_op_ge"}) 21return ref >= val; 22elseif (verb in {"bf_op_less_than_eq", "bf_op_le"}) 23return ref <= val; 24endif
less_than_eq greater_than_eq greater_than less_than equal_to eq le gt ge lt not_equal_to ne
Referenced by
none
Source
1":verb(OBJ, STR or LIST prop ref, ANY value to compare against)"; 2"Another little util for use with $lu:remove_*. Checks if an object's property is equal to, greater than, less than, etc. to a given value. Obviously the greater than/less than varieties have type constraints."; 3{object, prop, val} = args; 4ref = object; 5if (typeof(prop) == LIST) 6for p in (prop) 7ref = ref.(p); 8endfor 9else 10ref = $code_utils:verb_or_property(object, prop); 11endif 12if (verb in {"equal_to", "eq"}) 13return ref == val; 14elseif (verb in {"not_equal_to", "ne"}) 15return ref != val; 16elseif (verb in {"greater_than", "gt"}) 17return ref > val; 18elseif (verb in {"less_than", "lt"}) 19return ref < val; 20elseif (verb in {"greater_than_eq", "ge"}) 21return ref >= val; 22elseif (verb in {"less_than_eq", "le"}) 23return ref <= val; 24endif
verb_definer
Referenced by
- #50:@disassemble line 10:
$ou:verb_definer
Source
1":verb_definer(OBJ, STR verbname [, INT original definer]) => OBJ definer of verb."; 2"By default returns the original definer or #-1 if undefined. If the third argument is given as 0, it will return the nearest defining object."; 3{o, v, ?top = 1} = args; 4while (valid(o)) 5if (`verb_info(o, v) ! E_VERBNF') 6if (((!valid(p = parent(o))) || (!top)) || (!has_callable_verb(p, v))) 7return o; 8else 9o = p; 10endif 11else 12o = parent(o); 13endif 14endwhile 15return o;
children_hash ch
Referenced by
none
Source
1h = []; 2{what} = args; 3for c in (children(what)) 4for n in ({c.name, @`c.aliases ! ANY => {}'}) 5h[n] = c; 6endfor 7endfor 8return h;
property_hash
Referenced by
none
Source
1{what} = args; 2h = []; 3for p in (properties(what)) 4h[p] = what.(p); 5yield; 6endfor 7return h;
reverse_property_hash rph
Referenced by
- #297:update_corelist line 1:
$ou:rph
Source
1{what} = args; 2h = []; 3for p in (properties(what)) 4val = what.(p); 5if (!(typeof(val) in {STR, OBJ, INT, ERR, FLOAT})) 6continue; 7endif 8h[val] = p; 9yield; 10endfor 11return h;
propgrep
Referenced by
none
Source
1"$ou:propgrep(LIST objs, STR property, ANY thing_to_match) => LIST matching_objs"; 2" for example: $ou:propgrep(children($wiz), \"name\", \"Seraph\") => {#7195}"; 3{objs, propname, match} = args; 4hits = {}; 5for o in (objs) 6p = `o.(propname) ! E_PROPNF'; 7if (typeof(p) == LIST) 8if (match in p) 9hits = {@hits, o}; 10endif 11else 12if (p == match) 13hits = {@hits, o}; 14endif 15endif 16yield; 17endfor 18return hits;
map_leaves_suspended
Referenced by
none
Source
1":map_leaves_suspended(OBJ parent, OBJ verbloc, STR verbname [, LIST extraverbargs [, INT yieldtime]])"; 2" => LIST of the results of calling verbloc:verbname(leaf, @extraverbargs) for each leaf of parent."; 3" (hopefully) faster than getting the leaves and calling the verb each time yourself."; 4" NOTE: If verbloc is #-1, then it calls the verb on each leaf!"; 5{parent, vo, vname, ?extra_args = {}, ?ytime = 0} = args; 6leaves = {parent}; 7results = {}; 8while (leaves) 9{l, @leaves} = leaves; 10if (kids = children(l)) 11leaves = {@kids, @leaves}; 12else 13if (!valid(vo)) 14results = {@results, l:(vname)(l, @extra_args)}; 15else 16results = {@results, vo:(vname)(l, @extra_args)}; 17endif 18endif 19yield ytime; 20endwhile
map_leaves
Referenced by
none
Source
1":map_leaves(OBJ parent, OBJ verbloc, STR verbname [, LIST extraverbargs])"; 2" => LIST of the results of calling verbloc:verbname(leaf, @extraverbargs) for each leaf of parent."; 3" (hopefully) faster than getting the leaves and calling the verb each time yourself."; 4" NOTE: If verbloc is #-1, then it calls the verb on each leaf!"; 5{parent, vo, vname, ?extra_args = {}} = args; 6leaves = {parent}; 7results = {}; 8while (leaves) 9{l, @leaves} = leaves; 10if (kids = children(l)) 11leaves = {@kids, @leaves}; 12else 13if (!valid(vo)) 14results = {@results, l:(vname)(l, @extra_args)}; 15else 16results = {@results, vo:(vname)(l, @extra_args)}; 17endif 18endif 19endwhile
fastfind
Referenced by
- #317:@ff line 29:
$ou:fastfind
Source
1":fastfind(OBJ what, STR search [, INT fertile_only]) => matching child of what with 'search' as a name or alias."; 2{what, search, ?fertile_only = 0} = args; 3objs = {what}; 4while (objs) 5{o, @objs} = objs; 6yield; 7if (!gamevalid(o)) 8continue; 9endif 10if (kids = children(o)) 11objs = {@kids, @objs}; 12endif 13if (fertile_only && (!valid(first_child(o)))) 14continue; 15endif 16if (search in {o.name, o:name(), @o.aliases}) 17return o; 18endif 19endwhile 20return #-3;