Anonymous

Module:FunList/Iterators: Difference between revisions

From Melvor Idle
no edit summary
(Add ConcatEnumerator)
No edit summary
Line 12: Line 12:


-- BASE ENUMERATOR CLASS --
-- BASE ENUMERATOR CLASS --
--enumerable = {}
local Enumerator = {}
local Enumerator = {}
local Enumerator_mt = {
local Enumerator_mt = {
Line 40: Line 39:
function Enumerator:overridePairs(startIndex)
function Enumerator:overridePairs(startIndex)
-- Get or create clean enumerator. This ensures the state is 0.
-- Get or create clean enumerator. This ensures the state is 0.
local enum = self:getEnumerator(isArray)
local enum = self:getEnumerator(startIndex == 0)
enum.current = nil
enum.current = nil
enum.index = startIndex
enum.index = startIndex
2,875

edits