improve readme, rename :iterate to :members

This commit is contained in:
Redo
2025-10-01 20:36:03 -07:00
parent b5dc7988f5
commit a6d7fd2c98
2 changed files with 25 additions and 26 deletions

View File

@@ -306,10 +306,10 @@ local tsObjectMeta = {
error('ts object __len: object has no getCount method', 2) end
return tonumber(_bllua_ts.callobj(t._tsObjectId, 'getCount'))
end,
-- object:iterate()
-- object:members()
-- Return an iterator for Torque objects with the getCount and getObject methods
-- for index, object in group:iterate() do ... end
iterate = function(t)
-- for index, object in group:members() do ... end
members = function(t)
if t==nil then
error('ts object method: be sure to use :func() not .func()', 2) end
if t._deleted then
@@ -317,7 +317,7 @@ local tsObjectMeta = {
if not (
tsIsFunctionNs(t._tsNamespace, 'getCount' ) and
tsIsFunctionNs(t._tsNamespace, 'getObject')) then
error('ts object :iterate() - '..
error('ts object :members() - '..
'Object does not have getCount and getObject methods', 2) end
local count = tonumber(_bllua_ts.callobj(t._tsObjectId, 'getCount'))
local idx = 0