-
Notifications
You must be signed in to change notification settings - Fork 0
/
Runconfig.cs
35 lines (31 loc) · 1002 Bytes
/
Runconfig.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
namespace StandaloneGeneratorV3
{
class RunconfigPatch
{
public string archive { get; set; }
public RunconfigPatch(string archive)
{
this.archive = archive;
}
}
class Runconfig
{
public bool console { get; set; } = false;
public bool dat_dump { get; set; } = false;
public List<RunconfigPatch> patches { get; set; } = new List<RunconfigPatch>();
public void Save(string config_name)
{
if (!Directory.Exists("config"))
Directory.CreateDirectory("config");
string jsonRunconfig = JsonSerializer.Serialize(this, new JsonSerializerOptions { WriteIndented = true });
File.WriteAllText("config/" + config_name + ".js", jsonRunconfig);
}
}
}