Compare commits

..

2 Commits

Author SHA1 Message Date
bd206aaa12 Version: 1.0.6.3 -> 1.0.7 2025-10-31 22:24:10 +05:00
689779e9de Fixed key not found exception in dictionary 2025-10-31 22:23:27 +05:00
2 changed files with 15 additions and 13 deletions

View File

@ -2,23 +2,25 @@
public sealed class GameSettings(int gameSettingsCount = 8)
{
private readonly Dictionary<string, int> _settings = new(gameSettingsCount);
public IReadOnlyDictionary<string, int> Settings => _settings;
private readonly Dictionary<string, int?> _settings = new(gameSettingsCount);
public IReadOnlyDictionary<string, int?> Settings => _settings;
public void AddSetting(string name, int value)
public int? this[string name] => _settings.GetValueOrDefault(name);
internal void AddSetting(string name, int value)
{
_settings.Add(name, value);
}
public int AiDifficulty => _settings["FDIA"]; // FDIA = AIDF = AI Difficulty
public int StartResources => _settings["TSSR"]; // TSSR = RSST = Starting Resources
public int LockTeams => _settings["MTKL"]; // MTKL = LKTM = Lock Teams
public int CheatsOn => _settings["AEHC"]; // AEHC = CHEA = Cheats Enabled
public int StartingLocation => _settings["COLS"]; // COLS = SLOC = Starting Location
public int GameSpeed => _settings["DPSG"]; // DPSG = GSPD = Game Speed
public int ResourceSharing => _settings["HSSR"]; // HSSR = RSSH = Resource Sharing
public int ResourceRate => _settings["TRSR"]; // TRSR = RSRT = Resource Rate
public int DisableFlyers => _settings["YLFN"]; // YLFN = NFLY = No flyers
public int? AiDifficulty => _settings.GetValueOrDefault("FDIA"); // FDIA = AIDF = AI Difficulty
public int? StartResources => _settings.GetValueOrDefault("TSSR"); // TSSR = RSST = Starting Resources
public int? LockTeams => _settings.GetValueOrDefault("MTKL"); // MTKL = LKTM = Lock Teams
public int? CheatsOn => _settings.GetValueOrDefault("AEHC"); // AEHC = CHEA = Cheats Enabled
public int? StartingLocation => _settings.GetValueOrDefault("COLS"); // COLS = SLOC = Starting Location
public int? GameSpeed => _settings.GetValueOrDefault("DPSG"); // DPSG = GSPD = Game Speed
public int? ResourceSharing => _settings.GetValueOrDefault("HSSR"); // HSSR = RSSH = Resource Sharing
public int? ResourceRate => _settings.GetValueOrDefault("TRSR"); // TRSR = RSRT = Resource Rate
public int? DisableFlyers => _settings.GetValueOrDefault("YLFN"); // YLFN = NFLY = No flyers
public bool IsQuickStart => StartResources == 1;
public bool AreCheatsOn => CheatsOn == 1;

View File

@ -4,7 +4,7 @@
<PackageId>SoulstormReplayReader.Core</PackageId>
<Authors>Bununic</Authors>
<Company>Dowonline</Company>
<Version>1.0.6.3</Version>
<Version>1.0.7</Version>
</PropertyGroup>
<PropertyGroup>