private void OnReload(ReloadEventArgs args) { Settings = SupplySettings.Read(PVP_CONFIG_PATH); if (Settings == null) { Console.WriteLine("Config is null."); Settings = new SupplySettings(new List <SupplySet>(), new List <MapData>()); } }
public AutoSupplyMain(Main game) : base(game) { Settings = SupplySettings.Read(PVP_CONFIG_PATH); if (Settings == null) { Console.WriteLine("Config is null."); Settings = new SupplySettings(new List <SupplySet>(), new List <MapData>()); } Instance = this; }
public static SupplySettings Read(string filePath) { if (!File.Exists(filePath)) { Console.WriteLine(USE_DEFAULT_CONFIG_MESSAGE); var settings = new SupplySettings(new List <SupplySet>(), new List <MapData>()); return(settings); } using (var fs = new FileStream(filePath, FileMode.Open, FileAccess.Read, FileShare.Read)) { return(Read(fs)); } }