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 02:17, 11 September 2022
66 bytes added
,
2 years ago
m
→Can leave type nil to return all ships
Line 188:
Line 188:
local type = numberKey('type', context, n)
local type = numberKey('type', context, n)
return Iterator.shipsBy(context, n, function(e)
return Iterator.shipsBy(context, n, function(e)
−
return e._type == type
+
return
type == nil or
e._type == type
end)
end)
end
end
Line 439:
Line 439:
testIterator('shipsByType', { type = '11', sort = '_class' , listBase = true})
testIterator('shipsByType', { type = '11', sort = '_class' , listBase = true})
+
testIterator('shipsByType', { sort = '_name'})
testIterator('shipsBy', { pred = 'is_auxiliary' , sort = '_name'})
testIterator('shipsBy', { pred = 'is_auxiliary' , sort = '_name'})
Memetails
1,032
edits