Anonymous

Module:FunList/Iterators: Difference between revisions

From Melvor Idle
no edit summary
No edit summary
No edit summary
Line 16: Line 16:


function Enumerator:moveNext()
function Enumerator:moveNext()
mw.log('calling broken func')
error('Not implemented in base class.')
error('Not implemented in base class.')
end
end
Line 22: Line 21:
-- Hooks the moveNext function into the Lua 'pairs' function
-- Hooks the moveNext function into the Lua 'pairs' function
function Enumerator:overridePairs()
function Enumerator:overridePairs()
mw.log('overriding pairs()')
self.index = nil
self.index = nil
self.current = nil
self.current = nil
Line 49: Line 47:


function TableEnumerator:moveNext()
function TableEnumerator:moveNext()
mw.log('calling override with')
mw.log('key: ' .. tostring(self.index))
mw.log('val: ' .. tostring(self.current))
-- Grab the next index for the internal table.
-- Grab the next index for the internal table.
local key = self.index
local key = self.index
2,875

edits