Open main menu
Home
Random
Nearby
Log in
Settings
About Kancolle Wiki
Disclaimers
Kancolle Wiki
Search
Changes
← Older edit
Newer edit →
Module:Iterator
(view source)
Revision as of 20:00, 6 October 2017
724 bytes added
,
7 years ago
no edit summary
Line 29:
Line 29:
for _ = i, #collection do
for _ = i, #collection do
if i >= from and i <= to then
if i >= from and i <= to then
+
current = collection[i].name
+
i = i + 1
+
return true
+
end
+
i = i + 1
+
end
+
current = nil
+
return false
+
end,
+
current = function()
+
return current
+
end,
+
}
+
end
+
+
function Iterator.equipment()
+
return Iterator.equipmentById()
+
end
+
+
function Iterator.equipmentByType(context)
+
local type = context and context.type and tonumber(context.type)
+
local collection = require('Module:Collection/Equipment')
+
local i = 1
+
local current
+
return {
+
next = function()
+
for _ = i, #collection do
+
if collection[i].type == type then
current = collection[i].name
current = collection[i].name
i = i + 1
i = i + 1
がか
cssedit, gkautomate
7,064
edits