Part one of refactor of LS.ckint/LS.tryint/LS.isint

This commit is contained in:
2024-03-13 17:46:26 -04:00
parent fd8166f09c
commit 26d0715deb
8 changed files with 262 additions and 149 deletions

View File

@@ -1,10 +1,10 @@
makeclass('ug')
function ug.the()
return tangible.scan('globals',0,0,0,true)[1]
return tangible.find{plane="globals", center={0,0,0}, radius=1}[1]
end
lis=tangible.scan('globals',0,0,0,true)
lis=tangible.find{plane="globals", center={0,0,0}, radius=1}
if #lis==0 then
local ugid=tangible.build{class='ug', animstate={xyz={0,0,0}, plane='globals'}}
print("The global table is "..tangible.id(ugid))
@@ -42,8 +42,8 @@ function tabcat(t1,t2)
-- Example: multistart(function(t) return tangible.id(t)%3==0 end,function() print("Tangible "..tangible.id(tangible.place()).." here") end)
function multistart(fil,closure)
local lis=tangible.scan('nowhere',0,0,100,false)
tabcat(lis,tangible.scan('main',0,0,100,true))
local lis=tangible.find{plane="nowhere", center={0,0,100}, radius=1}
tabcat(lis,tangible.find{plane="main", center={0,0,100}, radius=1})
local filter=type(fil)=='function' and fil or function(t) return isa(t,fil) end
for _,t in ipairs(lis) do if filter(t) then tangible.start(t,closure) end end
end