I'd be ecstatic if we could have a proc like it. It would return a list of all types that are direct children of the node fed into the procedure.
For example, if a game had the following types:
/mob
/mob/vehicle/car
/mob/vehicle/city_bus
/mob/vehicle/scooter
/mob/person
...then children(/mob) would result in a list containing:
/mob/vehicle
/mob/person
...without including any nodes that aren't the current node's direct children.
As far as I'm aware, there's no way to do this manually within DM without using typesof(), converting the types into strings, and then cutting off the excess. An alternate method involves using typesof(), converting the types into instances, and then checking to see if their parent_type matches the type fed into the procedure. Either way is extremely inefficient.
Some other wording than plain old "children" might be necessary to avoid name conflicts, since "children" is a fairly common word. "pathchildren" comes to mind.
ID:136448
Oct 14 2002, 5:54 am
|
|