- Welcome to the Kancolle Wiki!
- If you have any questions regarding site content, account registration, etc., please visit the KanColle Wiki Discord
Changes
Jump to navigation
Jump to search
Line 143:
Line 143:
− +
Line 156:
Line 156:
− local type = numberKey('type', context, n)
− local pred = function(e, i)
− return e:type() == type
− end
− local pre
Line 191:
Line 186:
+
+
+
+
+
+
+
generalize enemy iterators
-- * Enemy iterators.
-- * Enemy iterators.
function Iterator.enemiesByType(context, n)
function Iterator.enemiesBy(context, n, pred, pre)
local collection = U.imap(CollectionEnemy, function(name)
local collection = U.imap(CollectionEnemy, function(name)
return EnemyShip(name)
return EnemyShip(name)
end
end
end)
end)
local i = 1
local i = 1
local current = nil
local current = nil
end,
end,
}
}
end
function Iterator.enemiesByType(context, n)
local type = numberKey('type', context, n)
return Iterator.enemiesBy(context, n, function(e)
return e:type() == type
end)
end
end