2019-09-10 06:44:25 +08:00
|
|
|
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;
|
|
|
|
|
|
|
|
|
2019-09-17 06:48:26 +08:00
|
|
|
public double solarPanelNonSunnyDayEnergyMultiplier;
|
|
|
|
public double solarPanelNightEnergyGenerationMultiplier;
|
|
|
|
|
2019-09-10 06:44:25 +08:00
|
|
|
public GlobalMachineConfig()
|
|
|
|
{
|
|
|
|
this.doMachinesConsumeEnergy = true;
|
2019-09-17 06:48:26 +08:00
|
|
|
this.solarPanelNonSunnyDayEnergyMultiplier = 0.0d;
|
|
|
|
this.solarPanelNightEnergyGenerationMultiplier = .125d;
|
2019-09-10 06:44:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|