Module:Township: Difference between revisions

Updated resourceDisplayOrder/buildingDisplayOrder
(Add GetBuildingBiomeTable)
(Updated resourceDisplayOrder/buildingDisplayOrder)
Line 79: Line 79:
-- Get a sorted list of all the resources
-- Get a sorted list of all the resources
local resources = GameData.sortByOrderTable(Township.resources, Township.resourceDisplayOrder[1].ids)
local resources = GameData.sortByOrderTable(Township.resources, Township.resourceDisplayOrder)
-- TODO Fix when the GameData is updated
-- local resources = GameData.sortByOrderTable(Township.resources, Township.resourceDisplayOrder)
resources = Shared.clone(resources)
resources = Shared.clone(resources)
Line 89: Line 87:
-- Returns a sorted list of all Township buildings
-- Returns a sorted list of all Township buildings
function p._SortedBuildings()
function p._SortedBuildings()
return Township.buildings
return GameData.sortByOrderTable(Township.buildings, Township.buildingDisplayOrder)
-- TODO Fix when the GameData is updated. Currently doesn't actually sort
-- return GameData.sortByOrderTable(Township.buildings, Township.buildingDisplayOrder)
end
end


572

edits