Module:Sandbox/GauTest/Township: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 340: Line 340:
-- Icon
-- Icon
table.insert(ret, '\r\n|-\r\n|style="text-align:center"|'..Icons.Icon({building.name, type='building', size='250', notext=true}))
table.insert(ret, '\r\n|-\r\n|style="text-align:center"|'..Icons.Icon({building.name, type='building', size='250', notext=true}))
-- Description - disabled because all buildings have the same description "A basic house"
-- table.insert(ret, '\r\n|-\r\n|style="text-align:center"|'..building.description)
-- ID
-- ID
table.insert(ret, '\r\n|-\r\n| <b>Building ID:</b> '..building.id)
table.insert(ret, '\r\n|-\r\n| <b>Building ID:</b> '..building.id)
Line 405: Line 403:
local job = p._GetJobFromResource(resource.id)
local job = p._GetJobFromResource(resource.id)
local workers = GameData.getEntityByID(building.provides.workers, job).quantity
local workers = GameData.getEntityByID(building.provides.workers, job).quantity
-- township.js -> Township.computeTownResourceGain()
-- Sourced from township.js -> Township.computeTownResourceGain()
local production = workers*resource.quantity*100*(Township.tickLength/10)
local production = workers*resource.quantity*100*(Township.tickLength/10)
local resource_data = GameData.getEntityByID(resources, resource.id)
local resource_data = GameData.getEntityByID(resources, resource.id)
Line 415: Line 413:
end
end
end
end
retProduction = table.concat(retProduction, ', ')..'/tick/'..workers..' '..p.GetTownshipStatIcon('Workers')
retProduction = table.concat(retProduction, ', ')..'/ ('..p.GetTownshipStatIcon('Workers')..workers..')'
table.insert(retResources, retProduction)
table.insert(retResources, retProduction)
end
end
572

edits