ConfigurationValid() tobeimplemented

This commit is contained in:
glax 2024-01-19 01:55:15 +01:00
parent 968c3a5c37
commit dbb0bcd89f

View File

@ -31,6 +31,8 @@ public struct Configuration
Setup.Run().SaveConfiguration();
Configuration c = JsonConvert.DeserializeObject<Configuration>(File.ReadAllText(settingsFilePath), new CShocker.Shockers.ShockerJsonConverter());
if (!c.ConfigurationValid())
throw new Exception("Configuration validation failed.");
foreach (Shocker cShocker in c.Shockers)
cShocker.SetLogger(logger);
return c;
@ -41,4 +43,9 @@ public struct Configuration
string settingsFilePath = path ?? "config.json";
File.WriteAllText(settingsFilePath, JsonConvert.SerializeObject(this, Formatting.Indented));
}
private bool ConfigurationValid()
{
return true; //TODO Check values
}
}