From 8c0db8e0c2461e8644dc3343d7b9d9e973017c6f Mon Sep 17 00:00:00 2001 From: Dev Date: Thu, 14 Nov 2024 11:20:01 +0000 Subject: [PATCH] Updated to store standing for kill in a dictionary keyed by difficulty --- Common.Models/Output/Output.cs | 6 +++--- Generator/BaseBotGenerator.cs | 11 ++++++++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Common.Models/Output/Output.cs b/Common.Models/Output/Output.cs index 71aa21c..30b8709 100644 --- a/Common.Models/Output/Output.cs +++ b/Common.Models/Output/Output.cs @@ -71,14 +71,14 @@ public class Experience { level = new MinMax(0, 1); reward = new MinMax(-1, -1); - standingForKill = -0.02; - aggressorBonus = 0.01; + standingForKill = new Dictionary(); + aggressorBonus = null; useSimpleAnimator = false; } public MinMax level { get; set; } public MinMax reward { get; set; } - public object standingForKill { get; set; } + public Dictionary standingForKill { get; set; } public object aggressorBonus { get; set; } public bool useSimpleAnimator { get; set; } } diff --git a/Generator/BaseBotGenerator.cs b/Generator/BaseBotGenerator.cs index 9ede243..50d8af7 100644 --- a/Generator/BaseBotGenerator.cs +++ b/Generator/BaseBotGenerator.cs @@ -4,7 +4,6 @@ using Common.Models.Input; using Common.Models.Output; using Generator.Helpers; using Generator.Helpers.Gear; -using System.Diagnostics; namespace Generator { @@ -42,8 +41,14 @@ namespace Generator private static void AddStandingForKill(Bot botToUpdate, Datum rawBotData) { - botToUpdate.experience.standingForKill = rawBotData.Info.Settings.StandingForKill; - botToUpdate.experience.aggressorBonus = rawBotData.Info.Settings.AggressorBonus; + botToUpdate.experience.standingForKill ??= new Dictionary(); + + if (!botToUpdate.experience.standingForKill.ContainsKey(rawBotData.Info.Settings.BotDifficulty)) + { + botToUpdate.experience.standingForKill.Add(rawBotData.Info.Settings.BotDifficulty, rawBotData.Info.Settings.StandingForKill); + } + + botToUpdate.experience.aggressorBonus ??= rawBotData.Info.Settings.AggressorBonus; } private static void AddExperience(Bot botToUpdate, Datum rawBotData)