private static void GenerateOriginalBioFuels() { const string fileName = "BioReactor_Values.txt"; if (File.Exists(OriginalsFolder + fileName)) { return; } var allBioFuels = ValidBioFuels.charge; var bioFuelList = new CustomBioFuelList(); foreach (TechType bioEnergyKey in allBioFuels.Keys) { bioFuelList.Add(new CustomBioFuel { ItemID = bioEnergyKey.ToString(), Energy = allBioFuels[bioEnergyKey] }); } var printyPrints = new List <string>(); printyPrints.AddRange(EmUtils.CommentTextLinesCentered(new string[] { "This file was generated with original BIoFuel energy values in the game", "You can copy individual entries from this file to use in your personal overrides", "--------------------------------------------------------------------------------", })); printyPrints.Add(bioFuelList.PrettyPrint()); File.WriteAllLines(OriginalsFolder + fileName, printyPrints.ToArray()); Logger.Log($"{fileName} file not found. File generated."); }
public void Sample_BioFuels_Ok() { var cFuels = new CustomBioFuelList(); string sample = File.ReadAllText(SampleFileDirectory + "CustomBioFuels_Samples.txt"); bool result = cFuels.FromString(sample); Assert.IsTrue(result); }