Anonymous

Module:Sandbox/GauTest/Township: Difference between revisions

From Melvor Idle
no edit summary
(Created page with "local Shared = require('Module:Shared') local Icons = require('Module:Icons') local GameData = require('Module:GameData') local resource_data = { ['melvorF:GP'] = {icon = {'Coins'}, skill = nil}, ['melvorF:Food'] = {icon = {'Raw Beef', type='item'}, skill = 'melvorD:Cooking'}, ['melvorF:Wood'] = {icon = {'Wood', type='resource'}, skill = 'melvorD:Woodcutting'}, ['melvorF:Stone'] = {icon = {'Stone', type='resource'}, skill = 'melvorD:Mining'}, ['melvorF:Ore'] = {ic...")
 
No edit summary
Line 312: Line 312:
function p._GetBuildingByID(id)
function p._GetBuildingByID(id)
GameData.getEntityByID(Township.buildings, id)
GameData.getEntityByID(Township.buildings, id)
end
-- Gets a Township building by name, e.g. Hunters Cabin
function p._GetBuildingByID(name)
GameData.getEntityByName(Township.buildings, name)
end
end


Line 320: Line 325:


-- Gets a building and prepares all the relevant stats for the building
-- Gets a building and prepares all the relevant stats for the building
function p._GetBuildingProfile(id)
function p.GetBuildingTable(name)
local building = p._GetBuildingByID(id)
local building = p._GetBuildingByName(name)
local resources = p._ResourcesData()
local resources = p._ResourcesData()
local ret = {}
table.insert(ret, '{| class="wikitable infobox" |- hi |}')
return table.concat(ret)
end
end


572

edits