lib-reflist

A reflist is a property on an object that contains a string with a series of space and # delimited dbrefs in it. For example:
propname:#1234 #9364 #21 #6466 #37

A reflist only will contain one copy of any one dbref within it. A reflist can be no longer than 4096 characters long. Generally, this means around 500+ refs.

REF-add objref reflistname dbreftoadd -- Adds a dbref to the dbreflist. If the given dbref is already in the reflist, it moves it to the end of the reflist.
REF-deleteobjref reflistname dbreftokill -- Removes a dbref from the dbreflist.
REF-firstobjref reflistname -- firstdbref Returns the first dbref in the reflist.
REF-nextobjref reflistname currdbref -- nextdbref Returns the next dbref in the list after the one you give it. Returns #-1 at the end of the list.
REF-inlist? objref reflistname dbreftocheck -- inlist? Returns whether or not the given dbref is in the dbreflist.
REF-listobjref reflistname -- liststr Returns a comma delimited string with the names of all the objects in the given reflist.
REF-allrefs objref reflistname -- refx...ref1 refcount Returns a range on the stack containing all the refs in the list, with the count of them on top.
REF-filter address objref reflistname -- refx...ref1 refcount Returns a range of dbrefs on the stack, filtered from the given reflist.
The filtering is done by a function that you pass the address of. The filter routine is [d -- i]. It takes a dbref and returns a boolean int. If the integer is 0, the ref is not included in the returned list. If the integer is not 0, then it is in the returned list.
REF-editlistplayers? objref reflistname -- Enters the user into an interactive editor that lets them add and remove objects from the given reflist. 'players?' is an integer boolean value, where if it is true, the list only lets you add players to it. Otherwise it lets you add regular objects to it.

feaelin@kemenel.org
lib-reflist / Revised 2004 March 31 22:06 (Wednesday)
© 2004 Iain E. Davis

Green Web Hosting! This site hosted by DreamHost. Standards Now! Valid XHTML 1.1! Valid CSS! We rated with ICRA!