Removed unnecessary TODOs and fixed typos

Removed unnecessary uses of `GetByJsonProp`
This commit is contained in:
Chomp
2025-02-09 15:13:05 +00:00
parent 5aaa5a2841
commit abd7f243e8
14 changed files with 57 additions and 66 deletions
+6 -6
View File
@@ -279,7 +279,7 @@ public class BotController(
pmcProfile,
false,
raidSettings,
_botConfig.PresetBatch?.GetByJsonProp<int>(requestedBot?.Role ?? string.Empty),
_botConfig.PresetBatch.GetValueOrDefault(requestedBot?.Role, 5),
_botHelper.IsBotPmc(requestedBot?.Role)
);
@@ -310,7 +310,7 @@ public class BotController(
botGenerationDetails.Role = _botHelper.GetRandomizedPmcRole();
botGenerationDetails.Side = _botHelper.GetPmcSideByRole(botGenerationDetails.Role);
botGenerationDetails.BotDifficulty = GetPmcDifficulty(requestedBot?.Difficulty);
botGenerationDetails.BotCountToGenerate = _botConfig.PresetBatch?.GetByJsonProp<int>(botGenerationDetails.Role);
botGenerationDetails.BotCountToGenerate = _botConfig.PresetBatch?.GetValueOrDefault(botGenerationDetails.Role, 5);
}
}
@@ -320,7 +320,7 @@ public class BotController(
var bossesToConvertToWeights = _botConfig.AssaultToBossConversion.BossesToConvertToWeights;
if (bossConvertEnabled && botGenerationDetails.IsPmc is not null && !botGenerationDetails.IsPmc.Value)
{
var bossConvertPercent = bossConvertMinMax.GetByJsonProp<MinMax>(requestedBot?.Role?.ToLower() ?? string.Empty);
var bossConvertPercent = bossConvertMinMax.GetValueOrDefault(requestedBot?.Role?.ToLower());
if (bossConvertPercent is not null)
// Roll a percentage check if we should convert scav to boss
{
@@ -374,7 +374,7 @@ public class BotController(
// Bosses are only ever 'normal'
botGenerationDetails.BotDifficulty = "normal";
botGenerationDetails.BotCountToGenerate = _botConfig.PresetBatch?.GetByJsonProp<int>(botGenerationDetails.Role);
botGenerationDetails.BotCountToGenerate = _botConfig.PresetBatch?.GetValueOrDefault(botGenerationDetails.Role);
}
private string? GetPmcDifficulty(string? requestedBotDifficulty)
@@ -391,8 +391,8 @@ public class BotController(
private MinMax? GetPmcConversionMinMaxForLocation(string? requestedBotRole, string? location)
{
return _pmcConfig.ConvertIntoPmcChance!.TryGetValue(location?.ToLower() ?? "", out var mapSpecificConversionValues)
? mapSpecificConversionValues.GetByJsonProp<MinMax>(requestedBotRole?.ToLower())
: _pmcConfig.ConvertIntoPmcChance.GetValueOrDefault("default")?.GetValueOrDefault(requestedBotRole);
? mapSpecificConversionValues.GetValueOrDefault(requestedBotRole?.ToLower())
: _pmcConfig.ConvertIntoPmcChance["default"]?.GetValueOrDefault(requestedBotRole);
}
private GetRaidConfigurationRequestData? GetMostRecentRaidSettings()