-
Notifications
You must be signed in to change notification settings - Fork 0
/
Config.cs
executable file
·59 lines (42 loc) · 1.64 KB
/
Config.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
using System;
using System.IO;
using Newtonsoft.Json;
using TwitchLib.Api.Helix.Models.Users.GetUsers;
namespace TwitchPredictionsBG
{
public class Config
{
public static readonly string _configLocation = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\TwitchPredictionsBG\data\TwitchPredictionsBG.config";
public TwitchApiTokenAdapter authToken;
public User user;
public int delay = 0;
public bool debug = false;
public string hsUserName;
public string hsRegion;
public string[] blueOutcomeTitle;
public string[] pinkOutcomeTitle;
public string[] predictionTitle;
public string predictionStrategy = "PredictionOutcomeStrategy13_BLUE_47_PINK_8_RETURN";
public int[] blueOutcomePlacements = null;
public int[] pinkOutcomePlacements = null;
public int[] returnOutcomePlacements = null;
public int roflanRatio = 0;
public bool outcomesSwapped = false;
public int predictionWindowSeconds = 120;
public Prediction prediction;
public void save()
{
File.WriteAllText(_configLocation, JsonConvert.SerializeObject(this, Formatting.Indented));
}
public Config load()
{
if (File.Exists(_configLocation))
{
// load config from file, if available
var config = JsonConvert.DeserializeObject<Config>(File.ReadAllText(_configLocation));
return config;
}
return null;
}
}
}