2,869
edits
No edit summary |
(Add sorting of calculated obstacles) |
||
Line 10: | Line 10: | ||
local Debug = require('Module:Debug') -- Comment out when Module is finalised. | local Debug = require('Module:Debug') -- Comment out when Module is finalised. | ||
-- | -- Gets all associated metadata from an obstacle based on its name. | ||
local function getObstacle(name) | local function getObstacle(name) | ||
name = Shared.specialTitleCase(name) | name = Shared.specialTitleCase(name) | ||
Line 101: | Line 79: | ||
end | end | ||
-- Sort course on category | |||
local sortFunc = function(a, b) | |||
-- Special case to sort pillars AFTER all regular obstacles. | |||
local pillar = { ["Pillar"] = 99, ["Elite Pillar"] = 100 } | |||
return (pillar[a.Slot] or a.Slot) < (pillar[b.Slot] or b.Slot) | |||
end | |||
table.sort(courseObstacles, sortFunc) | |||
return { | return { | ||
Obstacles = courseObstacles, | Obstacles = courseObstacles, |
edits