All help topics · Link to this topic
Showing help on '$object_utils'
object utilities ($object_utils #52)These routines are useful for finding out information about individual objects.
Examining everything an object has defined on it:
all_verbs (object) => like it says
all_properties (object) => likewise
findable_properties(object) => tests to see if caller can "find" them
owned_properties (object[, owner]) => tests for ownership
Investigating inheritance:
ancestors(object[,object...]) => all ancestors
descendants (object) => all descendants
ordered_descendants(object) => descendants, in a different order
leaves (object) => descendants with no children
branches (object) => descendants with children
isa (object,class) => true iff object is a descendant of class (or ==)
property_conflicts (object,newparent) => can object chparent to newparent?
isoneof (object,list) => true if object :isa class in list of parents
Considering containment:
contains (obj1, obj2) => Does obj1 contain obj2 (nested)?
all_contents (object) => return all the (nested) contents of object
locations (object) => list of location hierarchy above object
Verifying verbs and properties:
has_property(object,pname) => false/true according as object.(pname) exists
has_readable_property(object,pname) => false/true if prop exists and is +r
defines_property(object,pname) => does object *define* this property
has_verb (object,vname) => false/{#obj} according as object:(vname) exists
has_callable_verb => same, but verb must be callable from a program
defines_verb(object,vname) => does this object *define* this verb
match_verb (object,vname) => false/{location, newvname}
(identify location and usable name of verb)
accessible_verbs(object) => a list of verb names (or E_PERM) regardless of
readability of object
Player checking:
connected (object) => true if object is a player and is connected
Suspending:
Many of the above verbs have ..._suspended versions to assist with very large object hierarchies. The following exist:
descendants_suspended
branches_suspended
leaves_suspended
all_properties_suspended
descendants_with_property_suspended
:has_property - Syntax: has_property(OBJ, STR) => INT 0|1
:all_properties - Syntax: all_properties (OBJ what)
:has_verb(OBJ object, STR verbname)
:has_callable_verb - Usage: has_callable_verb(object, verb)
:match_verb(OBJ object, STR verb)
:isa(x,y) == valid(x) && (y==x || y in :ancestors(x))
:ancestors - Usage: ancestors(object[, object...])
:contains - $object_utils:contains(obj1, obj2) -- does obj1 contain obj2?
:all_contents - all_contents(object)
:findable_properties - findable_properties(object)
:owned_properties - owned_properties(what[, who])
:descendants_with_property_suspended(object,property)
:locations - Usage: locations(object)
:all_properties_suspended - Syntax: all_properties_suspended (OBJ what)
:connected(object) => true if object is a connected player.
:isoneof(x,y) = x $object_utils:isa z, for some z in list y
:defines_verb - Returns 1 if the verb is actually *defined* on this object, 0 else.
:defines_property(OBJ object, STR property name) => Returns 1 if the property is actually *defined* on the object given
:has_any_verb(object) / :has_any_property(object)
:has_readable_property(OBJ object, STR property name) => 1 if property exists and is publically readable (has the r flag set true).
:descendants (OBJ object) => {OBJs} all nested children of <object>
:leaves (OBJ object) => {OBJs} descendants of <object> that have no children
:branches (OBJ object) => {OBJs} descendants of <object> that have children
:descendants_suspended (OBJ object) => {OBJs} all nested children of <object>
:leaves_suspended (OBJ object) => {OBJs} descendants of <object> that have
:branches_suspended (OBJ object) => {OBJs} all descendants of <object> that
:disown(object) / :disinherit(object)
:accessible_verbs - accessible_verbs(object) => a list of verb names (or E_PERM) regardless of readability of object
:descendants_with_nonclear_property - $object_utils:descendants_with_nonclear_property(OBJ object, STR property) -> MAP
:locate - same as locate_by_name, but with filtering by class of object
Also from $generic_utils: 1 documented verb. help $generic_utils