Updated to store standing for kill in a dictionary keyed by difficulty

This commit is contained in:
Dev 2024-11-14 11:20:01 +00:00
parent 1dbf46179d
commit 8c0db8e0c2
2 changed files with 11 additions and 6 deletions

View File

@ -71,14 +71,14 @@ public class Experience
{ {
level = new MinMax(0, 1); level = new MinMax(0, 1);
reward = new MinMax(-1, -1); reward = new MinMax(-1, -1);
standingForKill = -0.02; standingForKill = new Dictionary<string, object>();
aggressorBonus = 0.01; aggressorBonus = null;
useSimpleAnimator = false; useSimpleAnimator = false;
} }
public MinMax level { get; set; } public MinMax level { get; set; }
public MinMax reward { get; set; } public MinMax reward { get; set; }
public object standingForKill { get; set; } public Dictionary<string, object> standingForKill { get; set; }
public object aggressorBonus { get; set; } public object aggressorBonus { get; set; }
public bool useSimpleAnimator { get; set; } public bool useSimpleAnimator { get; set; }
} }

View File

@ -4,7 +4,6 @@ using Common.Models.Input;
using Common.Models.Output; using Common.Models.Output;
using Generator.Helpers; using Generator.Helpers;
using Generator.Helpers.Gear; using Generator.Helpers.Gear;
using System.Diagnostics;
namespace Generator namespace Generator
{ {
@ -42,8 +41,14 @@ namespace Generator
private static void AddStandingForKill(Bot botToUpdate, Datum rawBotData) private static void AddStandingForKill(Bot botToUpdate, Datum rawBotData)
{ {
botToUpdate.experience.standingForKill = rawBotData.Info.Settings.StandingForKill; botToUpdate.experience.standingForKill ??= new Dictionary<string, object>();
botToUpdate.experience.aggressorBonus = rawBotData.Info.Settings.AggressorBonus;
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) private static void AddExperience(Bot botToUpdate, Datum rawBotData)