Open biscuitWizard opened 2 years ago
I've also added an optional argument that lets you specify the type of waif you are looking for:
@prop me.test {} +rwc
Property added with value {}.
;me.test = {$waif:new()}
=> {[[class = #118, owner = #2]]}
;waifs($waif)
=> {[[class = #118, owner = #2]]}
@create $waif named "Mysterious Waif"
You now have Mysterious Waif with object number #64 and parent Generic Waif (#118).
;waifs(#64)
=> {}
;waif_stats()
=> ["pending_recycle" -> 0, "total" -> 0]
;me.test = {#64:new()}
=> {[[class = #64, owner = #2]]}
;waifs(#64)
=> {[[class = #64, owner = #2]]}
;waifs($waif)
=> {}
Added a builtin that returns all waifs called "waifs()"
It is garbage collector safe and doesn't maintain a reference to waifs.
For example:
When the game recycles the WAIF it also removes it from the cache of all waif references. This is much faster than the in-moo implementation of searching every property on every object in the game and is much safer.