fix typing

This commit is contained in:
CWX
2025-01-14 17:22:32 +00:00
parent d147d81701
commit 1c93a6eaaf
3 changed files with 7 additions and 7 deletions
+2 -2
View File
@@ -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 };
@@ -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; }
}
+2 -2
View File
@@ -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