Open main menu
Home
Random
Nearby
Log in
Settings
About Kancolle Wiki
Disclaimers
Kancolle Wiki
Search
Changes
← Older edit
Newer edit →
Module:Development
(view source)
Revision as of 19:41, 15 April 2018
503 bytes added
,
6 years ago
no edit summary
Line 329:
Line 329:
for resourceGroup, _ in pairs(resourceGroups) do
for resourceGroup, _ in pairs(resourceGroups) do
local fuel, ammo, steel, bauxite = ensureResourceGroup(fuel, ammo, steel, bauxite, resourceGroup)
local fuel, ammo, steel, bauxite = ensureResourceGroup(fuel, ammo, steel, bauxite, resourceGroup)
−
result[
U.format{
+
local recipe =
U.format{
−
"${fuel}/${ammo}/${steel}/${bauxite}
(${typeGroup})
",
+
"${fuel}/${ammo}/${steel}/${bauxite}",
fuel = fuel,
fuel = fuel,
ammo = ammo,
ammo = ammo,
steel = steel,
steel = steel,
bauxite = bauxite,
bauxite = bauxite,
−
typeGroup
= Self.typeGroups[typeGroup]
,
+
}
−
}
] = true
+
result[recipe]
=
result[recipe] or {}
+
result[recipe][
Self.typeGroups[typeGroup]] = true
end
end
end
end
−
return
table
.
concat
(U.isort(U.keys(result)), "<br>")
+
return
U.ijoin(
+
U.imap(
+
U.isort(U.keys(result)),
+
function(recipe)
+
return U
.
format{
+
"${recipe} (${types})",
+
recipe = recipe,
+
types = U.ijoin
(U.isort(U.keys(result
[recipe])), "/"
)
+
}
+
end
+
),
+
"<br>"
+
)
else
else
return 'N/A'
return 'N/A'
Line 347:
Line 360:
function Self.test()
function Self.test()
local Equipment = require("Module:Equipment")
local Equipment = require("Module:Equipment")
−
return Self.formatResources(Equipment("46cm Triple Gun Mount"))
+
return
+
Self.formatResources(Equipment("46cm Triple
Gun Mount")) ..
+
"\n" ..
+
Self.formatResources(Equipment("12cm Single
Gun Mount"))
end
end
+
-- print(p.test())
return Self
return Self
がか
cssedit, gkautomate
7,064
edits