From 1c93a6eaaf30a9bf628f493b640ffa53cea15d41 Mon Sep 17 00:00:00 2001 From: CWX Date: Tue, 14 Jan 2025 17:22:32 +0000 Subject: [PATCH] fix typing --- Core/Generators/BotLevelGenerator.cs | 4 ++-- Core/Models/Eft/Bot/RandomisedBotLevelResult.cs | 6 +++--- Core/Models/Eft/Common/Globals.cs | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Core/Generators/BotLevelGenerator.cs b/Core/Generators/BotLevelGenerator.cs index 6f5dc9dd..d074ef8a 100644 --- a/Core/Generators/BotLevelGenerator.cs +++ b/Core/Generators/BotLevelGenerator.cs @@ -42,7 +42,7 @@ public class BotLevelGenerator var botLevelRange = GetRelativeBotLevelRange(botGenerationDetails, levelDetails, expTable.Length); // Get random level based on the exp table. - double exp = 0; + int exp = 0; var level = int.Parse(ChooseBotLevel(botLevelRange.Min.Value, botLevelRange.Max.Value, 1, 1.15).ToString()); // TODO - nasty double to string to int conversion for (var i = 0; i < level; i++) { @@ -52,7 +52,7 @@ public class BotLevelGenerator // Sprinkle in some random exp within the level, unless we are at max level. if (level < expTable.Length - 1) { - exp += _randomUtil.GetDouble(0, expTable[level].Experience.Value - 1); + exp += _randomUtil.GetInt(0, expTable[level].Experience.Value - 1); } return new RandomisedBotLevelResult{ Level = level, Exp = exp }; diff --git a/Core/Models/Eft/Bot/RandomisedBotLevelResult.cs b/Core/Models/Eft/Bot/RandomisedBotLevelResult.cs index d9187556..82bce567 100644 --- a/Core/Models/Eft/Bot/RandomisedBotLevelResult.cs +++ b/Core/Models/Eft/Bot/RandomisedBotLevelResult.cs @@ -1,12 +1,12 @@ -using System.Text.Json.Serialization; +using System.Text.Json.Serialization; namespace Core.Models.Eft.Bot; public class RandomisedBotLevelResult { [JsonPropertyName("level")] - public double? Level { get; set; } + public int? Level { get; set; } [JsonPropertyName("exp")] - public double? Exp { get; set; } + public int? Exp { get; set; } } diff --git a/Core/Models/Eft/Common/Globals.cs b/Core/Models/Eft/Common/Globals.cs index 880d7786..f1c7609c 100644 --- a/Core/Models/Eft/Common/Globals.cs +++ b/Core/Models/Eft/Common/Globals.cs @@ -1,4 +1,4 @@ -using Core.Models.Eft.Common.Tables; +using Core.Models.Eft.Common.Tables; using Core.Models.Eft.Hideout; namespace Core.Models.Eft.Common; @@ -1255,7 +1255,7 @@ public class Level public class ExpTable { [JsonPropertyName("exp")] - public double? Experience { get; set; } + public int? Experience { get; set; } } public class LootAttempt