Module:BuildingData: Difference between revisions

From Against the Storm Official Wiki
m (changed function scope)
m (improving commenting)
Line 20: Line 20:
-- Dependencies
-- Dependencies
--
--
RecipeData = RecipeData or require("Module:RecipeData") -- used to get recipe data
RecipeData = RecipeData or require("Module:RecipeData") -- need recipe relationships
Utility = Utility or require("Module:Utility") -- need normalize functions
Utility = Utility or require("Module:Utility") -- need normalize functions


Line 54: Line 54:
-- Class Variables
-- Class Variables
--
--


-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
Line 65: Line 63:
-- the rest of the data. (The lookup method will handle converting it to  
-- the rest of the data. (The lookup method will handle converting it to  
-- lowercase.)
-- lowercase.)
--
-- Structure:
-- Structure:
-- @key a lowercase version of the building name, with the same spaces,  
-- @key a lowercase version of the building name, with the same spaces,  
-- apostrophes, singular, and spelling
-- apostrophes, singular, and spelling
-- @field iconfile a string of the filename.png of the icon used in the  
-- @field iconfile a string of the filename.png of the icon used in the game,
-- game, case-sensitive and must include extension, but without the "File:"
-- case-sensitive and must include extension, but without the "File:"
-- @field page the name of the wiki page, case-sensitive, but otherwise  
-- @field page the name of the wiki page, case-sensitive, but otherwise must be
-- must be the same as the key
-- the same as the key
-- @field spec1[opt] the first specialization listed in the in-game  
-- @field spec1[opt] the first specialization listed in the in-game  
-- encyclopedia (use the constants, above), if any
-- encyclopedia (use the constants, above), if any
Line 78: Line 77:
-- @field cost1 the first listed resource cost in the in-game encyclopedia  
-- @field cost1 the first listed resource cost in the in-game encyclopedia  
-- (use constants, above)
-- (use constants, above)
-- @field cost2 the second listed resource cost in the in-game encyclopedia
-- @field cost2[opt] the second listed resource cost in the in-game  
-- (use constants, above), if any
-- encyclopedia (use constants, above), if any
-- @field cost3 the third listed resource cost in the in-game encyclopedia
-- @field cost3[opt] the third listed resource cost in the in-game  
-- (use constants, above), if any
-- encyclopedia (use constants, above), if any
-- @field workers the number of worker slots
-- @field workers the number of worker slots
-- @field raintype the color of rain used in the Rain Engine of this building  
-- @field raintype the color of rain used in the Rain Engine of this building  
Line 90: Line 89:
-- Starting Buildings
-- Starting Buildings
["ancient hearth"] = {iconfile="Small Hearth icon.png", page="Ancient Hearth", spec1=S_WARM, workers=1, description="The heart of the colony is protected by the Holy Flame. {{Villagers}} gather here to rest, eat, and receive clothing. If the fire goes out, people will lose hope. Can't be moved. Size: 4x4."},
["ancient hearth"] = { page="Ancient Hearth",
["main warehouse"] = {iconfile="Main_Storage_icon.png", page="Main Warehouse"},
iconfile="Small Hearth icon.png",  
spec1=S_WARM,  
workers=1,  
description="The heart of the colony is protected by the Holy Flame. Villagers gather here to rest, eat, and receive clothing. If the fire goes out, people will lose hope. Can't be moved. Size: 4x4." },
["main warehouse"] = { page="Main Warehouse",
iconfile="Main_Storage_icon.png" },
-- Camps
-- Camps
["foragers' camp"] = {iconfile="Forager's Camp icon", page="Foragers' Camp"},
["foragers' camp"] = { page="Foragers' Camp",  
["harvesters' camp"] = {iconfile="Harvester Camp icon.png", page="Harvesters' Camp"},
iconfile="Forager's Camp icon" },
["herbalists' camp"] = {iconfile="Herbalist's_Camp_icon.png", page="Herbalists' Camp"},
["harvesters' camp"] = { page="Harvesters' Camp",
["stonecutters' camp"] = {iconfile="Stonecutter's Camp icon.png", page="Stonecutters' Camp"},
iconfile="Harvester Camp icon.png" },
["trappers' camp"] = {iconfile="Trapper's Camp icon.png", page="Trappers' Camp"},
["herbalists' camp"] = { page="Herbalists' Camp",
["woodcutters' camp"] = {iconfile="Woodcutters Camp icon", page="Woodcutters' Camp"},
iconfile="Herbalist's_Camp_icon.png" },
["stonecutters' camp"] = { page="Stonecutters' Camp",
iconfile="Stonecutter's Camp icon.png" },
["trappers' camp"] = { page="Trappers' Camp",
iconfile="Trapper's Camp icon.png" },
["woodcutters' camp"] = { page="Woodcutters' Camp",  
iconfile="Woodcutters Camp icon" },
-- Farms
-- Farms
["farm field"] = {iconfile="Farmfield_icon.png", page="Farm Field"},
["farm field"] = { page="Farm Field",
["greenhouse"] = {iconfile="Greenhouse_icon.png", page="Greenhouse"},
iconfile="Farmfield_icon.png" },
["herb garden"] = {iconfile="HerbGarden_icon.png", page="Herb Garden"},
["greenhouse"] = { page="Greenhouse",
["plantation"] = {iconfile="Plantation_icon.png", page="Plantation"},
iconfile="Greenhouse_icon.png" },
["small farm"] = {iconfile="SmallFarm_icon.png", page="Small Farm"},
["herb garden"] = { page="Herb Garden",
iconfile="HerbGarden_icon.png" },
["plantation"] = { page="Plantation",
iconfile="Plantation_icon.png" },
["small farm"] = { page="Small Farm",
iconfile="SmallFarm_icon.png" },
-- Food production
-- Food production
["bakery"] = {iconfile="Bakery_icon.png", page="Bakery"},
["bakery"] = { page="Bakery",
["butcher"] = {iconfile="Butcher_icon.png", page="Butcher"},
iconfile="Bakery_icon.png" },
["cellar"] = {iconfile="Cellar_icon.png", page="Cellar"},
["butcher"] = { page="Butcher",
["cookhouse"] = {iconfile="Cookhouse_icon.png", page="Cookhouse"},
iconfile="Butcher_icon.png" },
["field kitchen"] = {iconfile="Field_Kitchen_icon.png", page="Field Kitchen"},
["cellar"] = { page="Cellar",
["granary"] = {iconfile="Granary_icon.png", page="Granary"},
iconfile="Cellar_icon.png" },
["grill"] = {iconfile="Grill_icon.png", page="Grill"},
["cookhouse"] = { page="Cookhouse",
["ranch"] = {iconfile="Ranch_icon.png", page="Ranch"},
iconfile="Cookhouse_icon.png" },
["smokehouse"] = {iconfile="Smokehouse_icon.png", page="Smokehouse"},
["field kitchen"] = { page="Field Kitchen",
iconfile="Field_Kitchen_icon.png" },
["granary"] = { page="Granary",
iconfile="Granary_icon.png" },
["grill"] = { page="Grill",
iconfile="Grill_icon.png" },
["ranch"] = { page="Ranch",
iconfile="Ranch_icon.png" },
["smokehouse"] = { page="Smokehouse",
iconfile="Smokehouse_icon.png" },
-- Housing
-- Housing
["shelter"] = {iconfile="Shelter icon.png", page="Shelter"},
["shelter"] = { page="Shelter",  
["big shelter"] = {iconfile="Big Shelter icon.png", page="Big Shelter"},
iconfile="Shelter icon.png" },
["human house"] = {iconfile="Human House icon.png", page="Human House"},
["big shelter"] = { page="Big Shelter",  
["beaver house"] = {iconfile="Beaver House icon.png", page="Beaver House"},
iconfile="Big Shelter icon.png" },
["lizard house"] = {iconfile="Lizard House icon.png", page="Lizard House"},
["human house"] = { page="Human House",  
["harpy house"] = {iconfile="Harpy House icon.png", page="Harpy House"},
iconfile="Human House icon.png" },
["beaver house"] = { page="Beaver House",  
iconfile="Beaver House icon.png" },
["lizard house"] = { page="Lizard House",  
iconfile="Lizard House icon.png" },
["harpy house"] = { page="Harpy House",  
iconfile="Harpy House icon.png" },
-- Industry
-- Industry
["crude workstation"] = {iconfile="Crude_Workstation_icon.png", page="Crude Workstation"},
["crude workstation"] = { page="Crude Workstation",
["makeshift post"] = {iconfile="Makeshift_Post_icon.png", page="Makeshift Post"},
iconfile="Crude_Workstation_icon.png" },
["advanced rain collector"] = {iconfile="Advanced_Rain_Collector_icon.png", page="Advanced Rain Collector", spec1=S_ENGI, spec2=S_ALCH, cost1=C_PIPES, cost2=C_PARTS, cost3=C_PLANK, description="Can collect [[infused rainwater]] used for crafting and powering [[Rain Engines]] in production buildings. The type of collected rainwater depends on the [[season]]. Can't be moved. Size: 3x2."},
["makeshift post"] = { page="Makeshift Post",
["alchemist's hut"] = {iconfile="Alchemist_Hut_icon.png", page="Alchemist's Hut", spec1=S_ALCH, spec2=S_BREW, cost1=C_PLANK, cost2=C_BRICK, workers=2, recipe1="Crystalized Dew", grade1=2, recipe2="Cosmetics", grade2=2, recipe3="Wine", grade3=2, description="Can produce: {{rl|Crystalized Dew}} {{P2Star}}, {{rl|Cosmetics}} {{P2star}}, {{rl|Wine}} {{P2Star}}. Can use: {{rl|Clearance Water}}. Can't be moved. Size: 3x2."},
iconfile="Makeshift_Post_icon.png" },
["apothecary"] = {iconfile="Apothecary_icon.png", page="Apothecary", spec1=S_ALCH, cost1=C_PLANK, cost2=C_BRICK, workers=2, recipe1="Cosmetics", grade1=2, recipe2="Incense", grade2=2, recipe3="Biscuits", grade3=2, description="Can produce: {{rl|Cosmetics}} {{P2Star}}, {{rl|Incense}} {{P2Star}}, {{rl|Biscuits}} {{P2Star}}. Can use: {{rl|Clearance Water}}. Can't be moved. Size: 3x3."},
["advanced rain collector"] = { page="Advanced Rain Collector",
["artisan"] = {iconfile="Artisan_icon.png", page="Artisan"},
iconfile="Advanced_Rain_Collector_icon.png",  
["brewery"] = {iconfile="Brewery_icon.png", page="Brewery"},
spec1=S_ENGI, spec2=S_ALCH,  
["brick oven"] = {iconfile="Brick_Oven_icon.png", page="Brick Oven"},
cost1=C_PIPES, cost2=C_PARTS, cost3=C_PLANK,  
["brickyard"] = {iconfile="Brickyard_icon.png", page="Brickyard"},
description="Can collect infused rainwater used for crafting and powering Rain Engines in production buildings. The type of collected rainwater depends on the season. Can't be moved. Size: 3x2." },
["carpenter"] = {iconfile="Carpenter_icon.png", page="Carpenter"},
["alchemist's hut"] = { page="Alchemist's Hut",  
["clothier"] = {iconfile="Clothier_icon.png", page="Clothier"},
iconfile="Alchemist_Hut_icon.png",
["cooperage"] = {iconfile="Cooperage_icon.png", page="Cooperage"},
spec1=S_ALCH, spec2=S_BREW,  
["druid's hut"] = {iconfile="Druid_icon.png", page="Druid's Hut"},
cost1=C_PLANK, cost2=C_BRICK,  
["flawless brewery"] = {iconfile="Brewery_icon.png", page="Flawless Brewery"},
workers=2,  
["flawless rain mill"] = {iconfile="Rain_Mill_icon.png", page="Flawless Rain Mill"},
description="Can produce: Crystalized Dew (★★), Cosmetics (★★), Wine (★★). Can use: Clearance Water. Can't be moved. Size: 3x2." },
["furnace"] = {iconfile="Furnace_icon.png", page="Furnace"},
["apothecary"] = { page="Apothecary",
["kiln"] = {iconfile="Kiln_icon.png", page="Kiln"},
iconfile="Apothecary_icon.png",  
["leatherworker"] = {iconfile="Leatherworks_icon.png", page="Leatherworker"},
spec1=S_ALCH,  
["lumber mill"] = {iconfile="Lumbermill_icon.png", page="Lumber Mill"},
cost1=C_PLANK, cost2=C_BRICK,  
["mine"] = {iconfile="Mine_icon.png", page="Mine"},
workers=2,  
["press"] = {iconfile="Press_icon.png", page="Press"},
description="Can produce: Cosmetics (★★), Incense (★★), Biscuits (★★). Can use: Clearance Water. Can't be moved. Size: 3x3." },
["provisioner"] = {iconfile="Provisioner_icon.png", page="Provisioner"},
["artisan"] = { page="Artisan",
["rain collector"] = {iconfile="Rain_Collector_icon.png", page="Rain Collector"},
iconfile="Artisan_icon.png" },
["rain mill"] = {iconfile="Rain_Mill_icon.png", page="Rain Mill"},
["brewery"] = { page="Brewery",
["scribe"] = {iconfile="Scribe_icon.png", page="Scribe"},
iconfile="Brewery_icon.png" },
["smelter"] = {iconfile="Smelter_icon.png", page="Smelter"},
["brick oven"] = { page="Brick Oven",
["toolshop"] = {iconfile="Toolshop_icon.png", page="Toolshop"},
iconfile="Brick_Oven_icon.png" },
["weaver"] = {iconfile="Weaver_icon.png", page="Weaver"},
["brickyard"] = { page="Brickyard",
iconfile="Brickyard_icon.png" },
["carpenter"] = { page="Carpenter",
iconfile="Carpenter_icon.png" },
["clothier"] = { page="Clothier",
iconfile="Clothier_icon.png" },
["cooperage"] = { page="Cooperage",
iconfile="Cooperage_icon.png" },
["druid's hut"] = { page="Druid's Hut",
iconfile="Druid_icon.png" },
["flawless brewery"] = { page="Flawless Brewery",
iconfile="Brewery_icon.png" },
["flawless rain mill"] = { page="Flawless Rain Mill",
iconfile="Rain_Mill_icon.png" },
["furnace"] = { page="Furnace",
iconfile="Furnace_icon.png" },
["kiln"] = { page="Kiln",
iconfile="Kiln_icon.png" },
["leatherworker"] = { page="Leatherworker",
iconfile="Leatherworks_icon.png" },
["lumber mill"] = { page="Lumber Mill",
iconfile="Lumbermill_icon.png" },
["mine"] = { page="Mine",
iconfile="Mine_icon.png" },
["press"] = { page="Press",
iconfile="Press_icon.png" },
["provisioner"] = { page="Provisioner",
iconfile="Provisioner_icon.png" },
["rain collector"] = { page="Rain Collector",
iconfile="Rain_Collector_icon.png" },
["rain mill"] = { page="Rain Mill",
iconfile="Rain_Mill_icon.png" },
["scribe"] = { page="Scribe",
iconfile="Scribe_icon.png" },
["smelter"] = { page="Smelter",
iconfile="Smelter_icon.png" },
["toolshop"] = { page="Toolshop",
iconfile="Toolshop_icon.png" },
["weaver"] = { page="Weaver",
iconfile="Weaver_icon.png" },
-- City Buildings
-- City Buildings
["archaeologist's office"] = {iconfile="Archeologist_office_icon.png", page="Archaeologist's Office", cost1=C_PLANK, cost2=C_BRICK, cost3=C_FABRI, description="A building designed to help you study the past. Can be [[upgrade]]d to locate [[archaeological discoveries]] or improve [[exploration]] capabilities. Can be moved for: 5 {{rl|Wood}}. Size: 3x3."},
["archaeologist's office"] = { page="Archaeologist's Office",  
["small hearth"] = {iconfile="Temporary_Hearth_icon.png", page="Small Hearth"},
iconfile="Archeologist_office_icon.png",
["warehouse"] = {iconfile="Storage_icon.png", page="Warehouse"},
cost1=C_PLANK, cost2=C_BRICK, cost3=C_FABRI,  
["trading post"] = {iconfile="Trading_Post_icon.png", page="Trading Post"},
description="A building designed to help you study the past. Can be upgraded to locate archaeological discoveries or improve exploration capabilities. Can be moved for: 5 Wood. Size: 3x3." },
["blight post"] = {iconfile="Blight_Post_icon.png", page="Blight Post"},
["small hearth"] = { page="Small Hearth",
["hydrant"] = {iconfile="Hydrant_icon.png", page="Hydrant"},
iconfile="Temporary_Hearth_icon.png" },
["forsaken altar"] = {iconfile="Altar_icon.png", page="Forsaken Altar"},
["warehouse"] = { page="Warehouse",
iconfile="Storage_icon.png" },
["trading post"] = { page="Trading Post",
iconfile="Trading_Post_icon.png" },
["blight post"] = { page="Blight Post",
iconfile="Blight_Post_icon.png" },
["hydrant"] = { page="Hydrant",
iconfile="Hydrant_icon.png" },
["forsaken altar"] = { page="Forsaken Altar",
iconfile="Altar_icon.png" },
-- Service Buildings
-- Service Buildings
["bath house"] = {iconfile="Bath_House_icon.png", page="Bath House"},
["bath house"] = { page="Bath House",
["clan hall"] = {iconfile="Clan_Hall_icon.png", page="Clan Hall"},
iconfile="Bath_House_icon.png" },
["explorers' lodge"] = {iconfile="Explorers_Lodge_icon.png", page="Explorers' Lodge"},
["clan hall"] = { page="Clan Hall",
["guild house"] = {iconfile="Guild_House_icon.png", page="Guild House"},
iconfile="Clan_Hall_icon.png" },
["monastery"] = {iconfile="Monastery_icon.png", page="Monastery"},
["explorers' lodge"] = { page="Explorers' Lodge",
["tavern"] = {iconfile="Tavern_icon.png", page="Tavern"},
iconfile="Explorers_Lodge_icon.png" },
["temple"] = {iconfile="Temple_icon.png", page="Temple"},
["guild house"] = { page="Guild House",
iconfile="Guild_House_icon.png" },
["monastery"] = { page="Monastery",
iconfile="Monastery_icon.png"},
["tavern"] = { page="Tavern",
iconfile="Tavern_icon.png" },
["temple"] = { page="Temple",
iconfile="Temple_icon.png" },
}
}



Revision as of 05:29, 13 February 2023

Documentation for this module may be created at Module:BuildingData/doc

-------------------------------------------------------------------------------
-- This module primarily supplies data and lookup functions for other modules 
-- that support templates like {{Building_link}}.
-- https://hoodedhorse.com/wiki/Against_the_Storm/Template:Building_link
-- 
-- The main data table stores all available data about buildings themselves 
-- and relies on other modules to store relationships between buildings and 
-- products, services, etc.
--
-- The helper functions include getters (to keep the data hidden) and a large
-- deconfliction method to provide some robustness when using the template
-- and from other Lua modules. Looking up a building requires using in-game 
-- names, but forgives small differences in spacing, apostrophes, and plurals.

-- Please help keep this table updated as the game is updated.
-- @module BuildingData
local BuildingData = {}

--
-- Dependencies
--
RecipeData = RecipeData or require("Module:RecipeData") -- need recipe relationships
Utility = Utility or require("Module:Utility") -- need normalize functions



-- 
-- Constants
-- 
-- Specializations
local S_ALCH = "Alchemy"
local S_BREW = "Brewing"
local S_CLOT = "Cloth"
local S_ENGI = "Engineering"
local S_MEAT = "Meat production"
local S_WARM = "Warmth"
local S_WOOD = "Wood"

-- Resource names of building costs
local C_BRICK = "Bricks"
local C_FABRI = "Fabric"
local C_PARTS = "Parts"
local C_PIPES = "Pipes"
local C_PLANK = "Planks"

-- Rain types for rain engines
local R_DRIZZ = "Drizzle Water"
local R_CLEAR = "Clearance Water"
local R_STORM = "Storm Water"



--
-- Class Variables
--

-------------------------------------------------------------------------------
-- Primary data table for this module.
-- 
-- This table stores the details of buildings according to in-game information.
-- A design decision of this table is to make the key the same as the page 
-- name, so that whenever .page is referenced, it can be used again to retrieve 
-- the rest of the data. (The lookup method will handle converting it to 
-- lowercase.)
--
-- Structure:
-- @key a lowercase version of the building name, with the same spaces, 
-- apostrophes, singular, and spelling
-- @field iconfile a string of the filename.png of the icon used in the game, 
-- case-sensitive and must include extension, but without the "File:"
-- @field page the name of the wiki page, case-sensitive, but otherwise must be 
-- the same as the key
-- @field spec1[opt] the first specialization listed in the in-game 
-- encyclopedia (use the constants, above), if any
-- @field spec2[opt] the second specialization listed in the in-game 
-- encyclopedia (use the constants, above), if any
-- @field cost1 the first listed resource cost in the in-game encyclopedia 
-- (use constants, above)
-- @field cost2[opt] the second listed resource cost in the in-game 
-- encyclopedia (use constants, above), if any
-- @field cost3[opt] the third listed resource cost in the in-game 
-- encyclopedia (use constants, above), if any
-- @field workers the number of worker slots
-- @field raintype the color of rain used in the Rain Engine of this building 
-- (use constants, above), if any
-- @field description the in-game description text, in plain text
-- @table tBuildingData the primary data table for buildings
local tBuildingData = { 
	
	-- Starting Buildings
	["ancient hearth"] = { page="Ancient Hearth", 
		iconfile="Small Hearth icon.png", 
		spec1=S_WARM, 
		workers=1, 
		description="The heart of the colony is protected by the Holy Flame. Villagers gather here to rest, eat, and receive clothing. If the fire goes out, people will lose hope. Can't be moved. Size: 4x4." },
	["main warehouse"] = { page="Main Warehouse", 
		iconfile="Main_Storage_icon.png" },
	
	-- Camps
	["foragers' camp"] = { page="Foragers' Camp", 
		iconfile="Forager's Camp icon" },
	["harvesters' camp"] = { page="Harvesters' Camp", 
		iconfile="Harvester Camp icon.png" },
	["herbalists' camp"] = { page="Herbalists' Camp", 
		iconfile="Herbalist's_Camp_icon.png" },
	["stonecutters' camp"] = { page="Stonecutters' Camp", 
		iconfile="Stonecutter's Camp icon.png" },
	["trappers' camp"] = { page="Trappers' Camp", 
		iconfile="Trapper's Camp icon.png" },
	["woodcutters' camp"] = { page="Woodcutters' Camp", 
		iconfile="Woodcutters Camp icon" },
	
	-- Farms
	["farm field"] = { page="Farm Field", 
		iconfile="Farmfield_icon.png" },
	["greenhouse"] = { page="Greenhouse", 
		iconfile="Greenhouse_icon.png" },
	["herb garden"] = { page="Herb Garden", 
		iconfile="HerbGarden_icon.png" },
	["plantation"] = { page="Plantation", 
		iconfile="Plantation_icon.png" },
	["small farm"] = { page="Small Farm", 
		iconfile="SmallFarm_icon.png" },
	
	-- Food production
	["bakery"] = { page="Bakery", 
		iconfile="Bakery_icon.png" },
	["butcher"] = { page="Butcher", 
		iconfile="Butcher_icon.png" },
	["cellar"] = { page="Cellar", 
		iconfile="Cellar_icon.png" },
	["cookhouse"] = { page="Cookhouse", 
		iconfile="Cookhouse_icon.png" },
	["field kitchen"] = { page="Field Kitchen", 
		iconfile="Field_Kitchen_icon.png" },
	["granary"] = { page="Granary", 
		iconfile="Granary_icon.png" },
	["grill"] = { page="Grill", 
		iconfile="Grill_icon.png" },
	["ranch"] = { page="Ranch", 
		iconfile="Ranch_icon.png" },
	["smokehouse"] = { page="Smokehouse", 
		iconfile="Smokehouse_icon.png" },
	
	-- Housing
	["shelter"] = { page="Shelter", 
		iconfile="Shelter icon.png" },
	["big shelter"] = { page="Big Shelter", 
		iconfile="Big Shelter icon.png" },
	["human house"] = { page="Human House", 
		iconfile="Human House icon.png" },
	["beaver house"] = { page="Beaver House", 
		iconfile="Beaver House icon.png" },
	["lizard house"] = { page="Lizard House", 
		iconfile="Lizard House icon.png" },
	["harpy house"] = { page="Harpy House", 
		iconfile="Harpy House icon.png" },
	
	-- Industry
	["crude workstation"] = { page="Crude Workstation", 
		iconfile="Crude_Workstation_icon.png" },
	["makeshift post"] = { page="Makeshift Post", 
		iconfile="Makeshift_Post_icon.png" },
	["advanced rain collector"] = { page="Advanced Rain Collector", 
		iconfile="Advanced_Rain_Collector_icon.png", 
		spec1=S_ENGI, spec2=S_ALCH, 
		cost1=C_PIPES, cost2=C_PARTS, cost3=C_PLANK, 
		description="Can collect infused rainwater used for crafting and powering Rain Engines in production buildings. The type of collected rainwater depends on the season. Can't be moved. Size: 3x2." },
	["alchemist's hut"] = { page="Alchemist's Hut", 
		iconfile="Alchemist_Hut_icon.png",
		spec1=S_ALCH, spec2=S_BREW, 
		cost1=C_PLANK, cost2=C_BRICK, 
		workers=2, 
		description="Can produce: Crystalized Dew (★★), Cosmetics (★★), Wine (★★). Can use: Clearance Water. Can't be moved. Size: 3x2." },
	["apothecary"] = { page="Apothecary", 
		iconfile="Apothecary_icon.png", 
		spec1=S_ALCH, 
		cost1=C_PLANK, cost2=C_BRICK, 
		workers=2, 
		description="Can produce: Cosmetics (★★), Incense (★★), Biscuits (★★). Can use: Clearance Water. Can't be moved. Size: 3x3." },
	["artisan"] = { page="Artisan", 
		iconfile="Artisan_icon.png" },
	["brewery"] = { page="Brewery", 
		iconfile="Brewery_icon.png" },
	["brick oven"] = { page="Brick Oven", 
		iconfile="Brick_Oven_icon.png" },
	["brickyard"] = { page="Brickyard", 
		iconfile="Brickyard_icon.png" },
	["carpenter"] = { page="Carpenter", 
		iconfile="Carpenter_icon.png" },
	["clothier"] = { page="Clothier", 
		iconfile="Clothier_icon.png" },
	["cooperage"] = { page="Cooperage", 
		iconfile="Cooperage_icon.png" },
	["druid's hut"] = { page="Druid's Hut", 
		iconfile="Druid_icon.png" },
	["flawless brewery"] = { page="Flawless Brewery", 
		iconfile="Brewery_icon.png" },
	["flawless rain mill"] = { page="Flawless Rain Mill", 
		iconfile="Rain_Mill_icon.png" },
	["furnace"] = { page="Furnace", 
		iconfile="Furnace_icon.png" },
	["kiln"] = { page="Kiln", 
		iconfile="Kiln_icon.png" },
	["leatherworker"] = { page="Leatherworker", 
		iconfile="Leatherworks_icon.png" },
	["lumber mill"] = { page="Lumber Mill", 
		iconfile="Lumbermill_icon.png" },
	["mine"] = { page="Mine", 
		iconfile="Mine_icon.png" },
	["press"] = { page="Press", 
		iconfile="Press_icon.png" },
	["provisioner"] = { page="Provisioner", 
		iconfile="Provisioner_icon.png" },
	["rain collector"] = { page="Rain Collector", 
		iconfile="Rain_Collector_icon.png" },
	["rain mill"] = { page="Rain Mill", 
		iconfile="Rain_Mill_icon.png" },
	["scribe"] = { page="Scribe", 
		iconfile="Scribe_icon.png" },
	["smelter"] = { page="Smelter", 
		iconfile="Smelter_icon.png" },
	["toolshop"] = { page="Toolshop", 
		iconfile="Toolshop_icon.png" },
	["weaver"] = { page="Weaver", 
		iconfile="Weaver_icon.png" },
	
	-- City Buildings
	["archaeologist's office"] = { page="Archaeologist's Office", 
		iconfile="Archeologist_office_icon.png",
		cost1=C_PLANK, cost2=C_BRICK, cost3=C_FABRI, 
		description="A building designed to help you study the past. Can be upgraded to locate archaeological discoveries or improve exploration capabilities. Can be moved for: 5 Wood. Size: 3x3." },
	["small hearth"] = { page="Small Hearth", 
		iconfile="Temporary_Hearth_icon.png" },
	["warehouse"] = { page="Warehouse", 
		iconfile="Storage_icon.png" },
	["trading post"] = { page="Trading Post", 
		iconfile="Trading_Post_icon.png" },
	["blight post"] = { page="Blight Post", 
		iconfile="Blight_Post_icon.png" },
	["hydrant"] = { page="Hydrant", 
		iconfile="Hydrant_icon.png" },
	["forsaken altar"] = { page="Forsaken Altar", 
		iconfile="Altar_icon.png" },
	
	-- Service Buildings
	["bath house"] = { page="Bath House", 
		iconfile="Bath_House_icon.png" },
	["clan hall"] = { page="Clan Hall", 
		iconfile="Clan_Hall_icon.png" },
	["explorers' lodge"] = { page="Explorers' Lodge", 
		iconfile="Explorers_Lodge_icon.png" },
	["guild house"] = { page="Guild House",	
		iconfile="Guild_House_icon.png"	},
	["monastery"] = { page="Monastery", 
		iconfile="Monastery_icon.png"},
	["tavern"] = { page="Tavern", 
		iconfile="Tavern_icon.png" },
	["temple"] = { page="Temple", 
		iconfile="Temple_icon.png" },
}



-------------------------------------------------------------------------------
-- Main lookup function
-- Accepts the in-game name and returns the name of the page on the wiki
-- associated with that in-game item, resource, building, etc.
-------------------------------------------------------------------------------



-- returns the whole data table for the specified key
-- need to run normalize function first
function BuildingData.getData(strArg)

	-- normalize input
    local strArg = Utility.normalizeBuildingName(strArg)
	
	-- Get it from the big table below and return it.
    return tBuildingData[strArg]
end



-- simpler version if all that's needed is the iconfile.
-- error handling by the calling module is required.
function BuildingData.getIconFilename(strArg)

	local data = getData(strArg)
	
	-- if this particular data block doesn't have a iconfile, this will return nil
	-- therefore, error handling will be necessary
	return data.iconfile or nil
end



-- simpler version if all that's needed is the page name.
-- error handling by the calling module is required.
function BuildingData.getPagename(strArg)

	local data = getData(strArg)
	
	-- if this particular data block doesn't have a page name, this will return nil
	-- therefore, error handling will be necessary
	return data.page or nil
end



-- simpler version if all that's needed is the description.
-- error handling by the calling module is required.
function BuildingData.getDescription(strArg)

	local data = getData(strArg)
	
	-- if this particular data block doesn't have a description, this will return nil
	-- therefore, error handling will be necessary
	return data.description or nil
end



-- Return this class when required into another module.
return BuildingData