23 lines
No EOL
637 B
C#
23 lines
No EOL
637 B
C#
using System.IO;
|
|
using Newtonsoft.Json;
|
|
|
|
namespace GCMM
|
|
{
|
|
public class Configuration
|
|
{
|
|
public string GamePath { get; set; }
|
|
public AutoPatchingState AutoPatch { get; set; } = AutoPatchingState.Unspecified;
|
|
|
|
public static Configuration Load()
|
|
{
|
|
if (File.Exists("configuration.json"))
|
|
return JsonConvert.DeserializeObject<Configuration>(File.ReadAllText("configuration.json"));
|
|
return new Configuration();
|
|
}
|
|
|
|
public void Save()
|
|
{
|
|
File.WriteAllText("configuration.json", JsonConvert.SerializeObject(this));
|
|
}
|
|
}
|
|
} |