Stardew_Valley_Mods/GeneralMods/Revitalize/Framework/Configs/GlobalMachineConfig.cs

39 lines
1.2 KiB
C#
Raw Normal View History

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Revitalize.Framework.Configs
{
public class GlobalMachineConfig
{
public bool doMachinesConsumeEnergy;
public double solarPanelNonSunnyDayEnergyMultiplier;
public double solarPanelNightEnergyGenerationMultiplier;
public GlobalMachineConfig()
{
this.doMachinesConsumeEnergy = true;
this.solarPanelNonSunnyDayEnergyMultiplier = 0.0d;
this.solarPanelNightEnergyGenerationMultiplier = .125d;
}
public static GlobalMachineConfig InitializeConfig()
{
if (File.Exists(Path.Combine(ModCore.ModHelper.DirectoryPath, "Configs", "MachinesConfig.json")))
return ModCore.ModHelper.Data.ReadJsonFile<GlobalMachineConfig>(Path.Combine("Configs", "MachinesConfig.json"));
else
{
GlobalMachineConfig Config = new GlobalMachineConfig();
ModCore.ModHelper.Data.WriteJsonFile<GlobalMachineConfig>(Path.Combine("Configs", "MachinesConfig.json"), Config);
return Config;
}
}
}
}