Module:GoodsCSV

--- -- Lua storage module for Goods.csv, when provided by EG developers. -- -- Stores the bare minimum, the raw text of the CSV file uploaded to Google -- Drive by the ATS developers. Other modules need to process the data itself -- and the relationships between goods and buildings. -- -- The only helper function here returns the CSV data but structured as a Lua -- table by using ParseCSV module. -- @module GoodsCSV local GoodsCSV = {}

-- -- Dependencies -- local ParseCSV = require("ParseCSV")

-- -- Constants --

-- The csv data is defined as a multiline string using the double square -- bracket syntax (...). This allows the CSV data to span multiple lines -- without any special handling of line breaks or escape characters. The -- multiline string can be easily copied and pasted as is, making it convenient -- to update the CSV data without any additional editing or reformatting. local csvData = [[ id,displayName,description,category,eatable,canBeBurned,burningTime,tradingSellValue,tradingBuyValue,iconName, [Crafting] Coal,Coal,"Efficient fuel. Obtained by: Mine, Brick Oven, Kiln.",Fuel & Exploration,False,True,60,3.75,6.25,Icon_Resource_Coal, [Crafting] Flour,Flour,"Used for cooking. Produced by: Flawless Rain Mill, Rain Mill, Press, Provisioner, Stamping Mill, Supplier.",Crafting Resources,False,False,0,2.2,3.8,Icon_Resource_Flour, [Crafting] Oil,Oil,"Efficient fuel. Obtained by: Butcher, Press, Druid's Hut.",Fuel & Exploration,False,True,30,1.95,3.25,Icon_Resource_Oil, [Crafting] Pigment,Pigment,"Used for crafting. Produced by: Cookhouse, Artisan, Tinctury, Manufactory.",Crafting Resources,False,False,0,1.5,2.5,Icon_Resource_Pigment, [Crafting] Sea Marrow,Sea Marrow,Efficient fuel. Obtained by: Stonecutters' Camp.,Fuel & Exploration,False,True,60,3.75,6.25,Icon_Resource_SeaMarrow, [Food Processed] Biscuits,Biscuits,"Tasty and crunchy. Produced by: Field Kitchen, Bakery, Cookhouse, Smelter, Apothecary.",Food,True,False,0,3,5,Icon_Resource_Biscuits, [Food Processed] Jerky,Jerky,"Preserved, dried meat. Produced by: Field Kitchen, Smokehouse, Kiln, Butcher, Cellar.",Food,True,False,0,1.8,3,Icon_Resource_Jerky, [Food Processed] Pickled Goods,Pickled Goods,"A Beaver specialty. Produced by: Field Kitchen, Granary, Cellar, Brewery, Flawless Brewery.",Food,True,False,0,2.4,4,Icon_Resource_PickledGoods, [Food Processed] Pie,Pie,"A Human specialty. Produced by: Bakery, Brick Oven, Furnace.",Food,True,False,0,3,5,Icon_Resource_Pie, [Food Processed] Skewers,Skewers,"A Lizard specialty. Produced by: Cookhouse, Grill, Butcher.",Food,True,False,0,2.4,4,Icon_Resource_Skewers, [Food Raw] Berries,Berries,"Common food source. Obtained by: Plantation, Hallowed Herb Garden, Herbalists' Camp, Small Herbalists' Camp.",Food,True,False,0,2.4,4,Icon_Resource_Berries, [Food Raw] Eggs,Eggs,"Common food source. Obtained by: Ranch, Trappers' Camp, Small Trappers' Camp.",Food,True,False,0,2.4,4,Icon_Resource_Eggs, [Food Raw] Grain,Grain,"Isn't eaten raw, but can be processed. Obtained by: Hallowed Small Farm, Small Farm, Foragers' Camp, Small Foragers' Camp, Homestead.",Crafting Resources,False,False,0,2.4,4,Icon_Resource_Grain, [Food Raw] Herbs,Herbs,"Isn't eaten raw, but can be processed. Obtained by: Hallowed Herb Garden, Herb Garden, Herbalists' Camp, Small Herbalists' Camp, Greenhouse.",Crafting Resources,False,False,0,2.4,4,Icon_Resource_Herbs, [Food Raw] Insects,Insects,"Common food source. Obtained by: Trappers' Camp, Small Trappers' Camp.",Food,True,False,0,2.4,4,Icon_Resource_Insects, [Food Raw] Meat,Meat,"Common food source. Obtained by: Ranch, Trappers' Camp, Small Trappers' Camp.",Food,True,False,0,2.4,4,Icon_Resource_Meat, [Food Raw] Mushrooms,Mushrooms,"Common food source. Obtained by: Herbalists' Camp, Small Herbalists' Camp, Greenhouse, Homestead.",Food,True,False,0,2.4,4,Icon_Resource_Mushrooms, [Food Raw] Roots,Roots,"Common food source. Obtained by: Hallowed Herb Garden, Herb Garden, Foragers' Camp, Small Foragers' Camp.",Food,True,False,0,2.4,4,Icon_Resource_Roots, [Food Raw] Vegetables,Vegetables,"Common food source. Obtained by: Hallowed Small Farm, Small Farm, Foragers' Camp, Small Foragers' Camp, Homestead.",Food,True,False,0,2.4,4,Icon_Resource_Vegetables, [Mat Processed] Bricks,Bricks,"Mostly used for construction. Produced by: Crude Workstation, Workshop, Brickyard, Kiln, Furnace.",Building Materials,False,False,0,3.75,6.25,Icon_Resource_Bricks, [Mat Processed] Fabric,Fabric,"Used for construction or production of clothes. Produced by: Crude Workstation, Workshop, Weaver, Granary, Leatherworker.",Building Materials,False,False,0,3.75,6.25,Icon_Resource_Fabric, [Mat Processed] Parts,Parts,Rare elements used in camp construction. Difficult to produce in this harsh environment.,Building Materials,False,False,0,28.8,48,Icon_Resource_Parts, [Mat Processed] Pipe,Pipes,"Used to install Rainpunk Engines in production buildings and build Geyser Pumps. Produced by: Crude Workstation, Workshop, Smelter, Toolshop.",Building Materials,False,False,0,7,12,en_craft_23, [Mat Processed] Planks,Planks,"Mostly used for construction. Produced by: Crude Workstation, Workshop, Lumber Mill, Carpenter, Supplier.",Building Materials,False,False,0,2.25,3.75,Icon_Resource_Planks, [Mat Raw] Clay,Clay,"Flesh of the earth. Used mostly for crafting. Obtained by: Stonecutters' Camp, Clay Pit.",Crafting Resources,False,False,0,1.8,3,Icon_Resource_Clay, [Mat Raw] Leather,Leather,Used for crafting. Obtained by: Ranch.,Crafting Resources,False,False,0,1.8,3,Icon_Resource_Leather, [Mat Raw] Plant Fibre,Plant Fiber,"Used for crafting. Obtained by: Hallowed Small Farm, Plantation, Harvesters' Camp, Homestead.",Crafting Resources,False,False,0,1.8,3,Icon_Resource_PlantFiber, [Mat Raw] Reeds,Reed,"Used for crafting. Obtained by: Harvesters' Camp, Clay Pit.",Crafting Resources,False,False,0,1.8,3,Icon_Resource_Reeds, [Mat Raw] Resin,Resin,Used for crafting. Obtained by: Forester's Hut.,Crafting Resources,False,False,0,1.8,3,Icon_Resource_Resin, [Mat Raw] Sparkdew,Sparkdew,"Charged rainwater. Extremely useful, and dangerous at the same time. Obtained by: ",Crafting Resources,False,False,0,0.75,1.25,Icon_Resource_Sparkdew, [Mat Raw] Stone,Stone,Bones of the earth. Used mostly for crafting. Obtained by: Stonecutters' Camp.,Crafting Resources,False,False,0,1.8,3,Icon_Resource_Stone, [Mat Raw] Wood,Wood,"An abundant, yet crucial resource. Obtained by: Woodcutters' Camp.",Fuel & Exploration,False,True,15,0.75,1.25,Icon_Resource_Wood, [Metal] Copper Bar,Copper Bars,"Refined copper ore, used for crafting. Produced by: Grill, Furnace, Stamping Mill, Smelter.",Crafting Resources,False,False,0,7.2,12,Icon_Resource_CopperBar, [Metal] Copper Ore,Copper Ore,A soft and malleable metal. Obtained by: Mine.,Crafting Resources,False,False,0,1.8,3,Icon_Resource_CopperOre, [Metal] Crystalized Dew,Crystalized Dew,"Crystalized rain essence. Produced by: Forester's Hut, Brickyard, Alchemist's Hut.",Crafting Resources,False,False,0,7.2,12,Icon_Resource_CrystalizedDew, [Needs] Ale,Ale,"Used for Leisure at: Tavern, Monastery, Forum. Produced by: Grill, Brewery, Flawless Brewery, Tinctury, Scribe.",Consumable Items,False,False,0,2.1,3.5,Icon_Resource_Ale, [Needs] Coats,Coats,"Used as clothing by some villagers. Produced by: Clothier, Smithy, Artisan, Druid's Hut.",Consumable Items,False,False,0,1.2,2,Icon_Resource_Coats, [Needs] Cosmetics,Cosmetics,"Used for Cleanliness at: Bath House, Holy Market, Market. Produced by: Cooperage, Alchemist's Hut, Apothecary.",Consumable Items,False,False,0,1.8,3,Icon_Resource_Cosmetics, [Needs] Incense,Incense,"Used for Religion at: Holy Temple, Temple, Monastery, Clan Hall. Produced by: Smokehouse, Brick Oven, Apothecary, Druid's Hut.",Consumable Items,False,False,0,2.25,3.75,Icon_Resource_Incense, [Needs] Scrolls,Scrolls,"Used for Education at: Holy Temple, Temple, Explorers' Lodge, Forum. Produced by: Lumber Mill, Clothier, Flawless Rain Mill, Rain Mill, Scribe.",Consumable Items,False,False,0,1.8,3,Icon_Resource_Scrolls, [Needs] Scrolls - tutorial,Scrolls,Luxury goods used for Education. Unavailable in this tutorial.Click the icon to change to another resource.,Consumable Items,False,False,0,1.8,3,Icon_Resource_Scrolls, [Needs] Training Gear,Training Gear,"Used for Brawling at: Tavern, Clan Hall, Explorers' Lodge. Produced by: Cooperage, Weaver, Tinkerer, Manufactory.",Consumable Items,False,False,0,2.55,4.25,Icon_Resource_TrainingGear, [Needs] Wine,Wine,"Used for Luxury at: Guild House, Holy Market, Market. Produced by: Cellar, Alchemist's Hut, Tinctury.",Consumable Items,False,False,0,1.8,3,Icon_Resource_Wine, [Packs] Pack of Building Materials,Pack of Building Materials,"Goods packed for delivery, used for fulfilling orders or trading. Produced by: Makeshift Post, Flawless Rain Mill, Rain Mill, Tinkerer.",Trade Goods,False,False,0,10.5,16,Icon_Resource_BuildingMaterials, [Packs] Pack of Crops,Pack of Crops,"Goods packed for delivery, used for fulfilling orders or trading. Produced by: Makeshift Post, Granary, Brewery, Flawless Brewery.",Trade Goods,False,False,0,7.1,11,Icon_Resource_Crops, [Packs] Pack of Luxury Goods,Pack of Luxury Goods,"Goods packed for delivery, used for fulfilling orders or trading. Produced by: Carpenter, Leatherworker, Press.",Trade Goods,False,False,0,7.8,12,Icon_Resource_Luxury, [Packs] Pack of Provisions,Pack of Provisions,"Goods packed for delivery, used for fulfilling orders or trading. Produced by: Makeshift Post, Provisioner, Manufactory.",Trade Goods,False,False,0,4.8,8,Icon_Resource_Provisions, [Packs] Pack of Trade Goods,Pack of Trade Goods,"Goods packed for delivery, used for fulfilling orders or trading. Produced by: Lumber Mill, Weaver, Smithy.",Trade Goods,False,False,0,9.6,16,Icon_Resource_TradeGoods, [Tools] Infused Tools,Infused Tools,"Used in exploration, for opening caches and completing difficult events. Produced by: Finesmith, Rainpunk Foundry.",Fuel & Exploration,False,False,0,21.15,35.25,Icon_Resource_InfusedTools, [Tools] Simple Tools,Simple Tools,"Used in exploration, for opening caches and completing difficult events. Produced by: Carpenter, Smithy, Toolshop, Tinkerer, Scribe.",Fuel & Exploration,False,False,0,16.65,27.75,Icon_Resource_SimpleTools, [Valuable] Amber,Amber,A widely accepted currency in the kingdom. Crystalized tree blood... fitting.,Trade Goods,False,False,0,12,15,Icon_Resource_Amber, [Valuable] Ancient Tablet,Ancient Tablet,"Valuable sources of knowledge, highly sought after by traders and the Queen herself. They can be found in Dangerous or Forbidden Glades.",Trade Goods,False,False,0,96,160,Icon_Resource_AncientTablet, [Vessel] Barrels,Barrels,"Used for crafting. Produced by: Cooperage, Provisioner, Toolshop, Artisan.",Crafting Resources,False,False,0,2.4,4,Icon_Resource_Barrels, [Vessel] Pottery,Pottery,"Used for crafting. Produced by: Bakery, Smokehouse, Brickyard, Stamping Mill.",Crafting Resources,False,False,0,2.25,3.75,Icon_Resource_Pottery, [Vessel] Waterskin,Waterskins,"Used for crafting. Produced by: Clothier, Leatherworker, Supplier.",Crafting Resources,False,False,0,2.25,3.75,Icon_Resource_Waterskins, [Water] Clearance Water,Clearance Water,Highly concentrated yellow clearance rainwater. Used to power Rain Engines in crafting-oriented buildings.,Crafting Resources,False,False,0,3.75,6.25,yellow_30, [Water] Drizzle Water,Drizzle Water,Highly concentrated green drizzle rainwater. Used to power Rain Engines in food-oriented buildings.,Crafting Resources,False,False,0,3.75,6.25,green_11, [Water] Storm Water,Storm Water,Highly concentrated blue storm rainwater. Used to power Rain Engines in industry-oriented buildings.,Crafting Resources,False,False,0,3.75,6.25,blue_14, _Meta Artifacts,Artifacts,"Curiosities of a varied nature. Fascinating, sinister, and all in between. Can be used to buy more advanced upgrades in the Smoldering City.",Trade Goods,False,False,0,60,90,Icon_MetaResource_Artifact, _Meta Food Stockpiles,Food Stockpiles,A basic currency in the realm. Workers are eager to exchange their labor for food for their families. Can be used to buy upgrades in the Smoldering City.,Trade Goods,False,False,0,30,45,Icon_MetaResource_FoodStockpiles, _Meta Machinery,Machinery,Rainpunk technology ripped from the past. Repurposed using skill and labor. Can be used to buy upgrades in the Smoldering City.,Trade Goods,False,False,0,60,90,Icon_MetaResource_Machinery, Blight Fuel,Purging Fire,A unique resource used by Blight Fighters to burn down Blightrot Cysts. Produced by: Blight Post.,Fuel & Exploration,False,False,0,3.75,6.25,Icon_Resource_PurgingFire, Hearth Parts,Wildfire Essence,"A sentient flame trapped in a bottle. This rare material is used to light the Holy Flame in Hearths. Can be acquired from orders, Glade Events, or traders.",Building Materials,False,False,0,30,50,MiningIcons_73_b, ]]

-- -- Class variables -- GoodsCSV.header, GoodsCSV.rows = ParseCSV.parseCSV(csvData) -- Parse the CSV data using the ParseCSV module

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