code reformat and cleanup

This commit is contained in:
2025-04-05 05:59:22 +05:00
parent 758388cda0
commit e9c7c8f5c1
10 changed files with 357 additions and 344 deletions
+6 -6
View File
@@ -5,10 +5,10 @@ namespace ParadoxSaveParser.WebAPI;
public class Config
{
public const int ActualVersion = 1;
public int Version = ActualVersion;
public string BaseUrl = "http://127.0.0.1:5226/";
public int Version = ActualVersion;
public static Config FromDtsod(DtsodV23 d)
{
var cfg = new Config
@@ -18,16 +18,16 @@ public class Config
};
if (cfg.Version < ActualVersion)
throw new Exception($"config is obsolete (config v{cfg.Version} < program v{ActualVersion})");
if(cfg.Version > ActualVersion)
if (cfg.Version > ActualVersion)
throw new Exception($"program is obsolete (config v{cfg.Version} > program v{ActualVersion})");
return cfg;
}
public DtsodV23 ToDtsod() =>
new()
public DtsodV23 ToDtsod()
=> new()
{
{ "version", Version },
{ "baseUrl", BaseUrl },
{ "baseUrl", BaseUrl }
};
public override string ToString() => ToDtsod().ToString();