Module:Sandbox/BrandonXLF/1: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Line 4:
 
local p = {}
 
local function displayService(service, dest, dir)
if not service then return '' end
return '<div>' .. (dir == 'left' and '←' or '→') .. ' ' .. service .. ' toward ' .. dest .. '</div>'
end
 
local function displayTrack(floorPart)
local out = displayService(floorPart.service, floorPart.dest, floorPart.dir)
for i = 1, floorPart.max do
out = out .. displayService(floorPart[i].service, floorPart[i].dest, floorPart.dir)
end
return out
end
 
local function displayFloorPart(floorPart, floorNum, partNum)
Line 10 ⟶ 26:
if floorPart.name then
out = out .. '<div>' .. floorPart.name .. '</div>'
out = out .. '<div>' .. displayTrack(floorPart.desc ) .. '</div>'
elseif floorPart.platform then
out = out .. '<div style="grid-column: 1 / 3;">' .. floorPart.platform .. '</div>'