Skip to content

Commit

Permalink
Use GameTime elsewhere
Browse files Browse the repository at this point in the history
  • Loading branch information
NoahStolk committed Sep 7, 2024
1 parent 5faab20 commit 9f46c37
Show file tree
Hide file tree
Showing 14 changed files with 67 additions and 69 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using DevilDaggersInfo.Core.Common.Extensions;
using DevilDaggersInfo.Core.Common;
using DevilDaggersInfo.Web.ApiSpec.Admin.CustomEntries;
using DevilDaggersInfo.Web.Server.Domain.Admin.Exceptions;
using DevilDaggersInfo.Web.Server.Domain.Entities;
Expand Down Expand Up @@ -45,12 +45,12 @@ public async Task AddCustomEntryAsync(AddCustomEntry addCustomEntry)
GemsTotal = addCustomEntry.GemsTotal,
HomingStored = addCustomEntry.HomingStored,
HomingEaten = addCustomEntry.HomingEaten,
LevelUpTime2 = addCustomEntry.LevelUpTime2.To10thMilliTime(),
LevelUpTime3 = addCustomEntry.LevelUpTime3.To10thMilliTime(),
LevelUpTime4 = addCustomEntry.LevelUpTime4.To10thMilliTime(),
LevelUpTime2 = (int)GameTime.FromSeconds(addCustomEntry.LevelUpTime2).GameUnits,
LevelUpTime3 = (int)GameTime.FromSeconds(addCustomEntry.LevelUpTime3).GameUnits,
LevelUpTime4 = (int)GameTime.FromSeconds(addCustomEntry.LevelUpTime4).GameUnits,
PlayerId = addCustomEntry.PlayerId,
SubmitDate = addCustomEntry.SubmitDate,
Time = addCustomEntry.Time.To10thMilliTime(),
Time = (int)GameTime.FromSeconds(addCustomEntry.Time).GameUnits,
};
_dbContext.CustomEntries.Add(customEntry);
await _dbContext.SaveChangesAsync();
Expand Down Expand Up @@ -81,12 +81,12 @@ public async Task EditCustomEntryAsync(int id, EditCustomEntry editCustomEntry)
customEntry.GemsTotal = editCustomEntry.GemsTotal;
customEntry.HomingStored = editCustomEntry.HomingStored;
customEntry.HomingEaten = editCustomEntry.HomingEaten;
customEntry.LevelUpTime2 = editCustomEntry.LevelUpTime2.To10thMilliTime();
customEntry.LevelUpTime3 = editCustomEntry.LevelUpTime3.To10thMilliTime();
customEntry.LevelUpTime4 = editCustomEntry.LevelUpTime4.To10thMilliTime();
customEntry.LevelUpTime2 = (int)GameTime.FromSeconds(editCustomEntry.LevelUpTime2).GameUnits;
customEntry.LevelUpTime3 = (int)GameTime.FromSeconds(editCustomEntry.LevelUpTime3).GameUnits;
customEntry.LevelUpTime4 = (int)GameTime.FromSeconds(editCustomEntry.LevelUpTime4).GameUnits;
customEntry.PlayerId = editCustomEntry.PlayerId;
customEntry.SubmitDate = editCustomEntry.SubmitDate;
customEntry.Time = editCustomEntry.Time.To10thMilliTime();
customEntry.Time = (int)GameTime.FromSeconds(editCustomEntry.Time).GameUnits;
await _dbContext.SaveChangesAsync();
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using DevilDaggersInfo.Core.Common.Extensions;
using DevilDaggersInfo.Core.Common;
using DevilDaggersInfo.Core.CriteriaExpression;
using DevilDaggersInfo.Core.CriteriaExpression.Parts;
using DevilDaggersInfo.Core.Spawnset;
Expand Down Expand Up @@ -514,10 +514,13 @@ levelUpTime3Operator is CustomLeaderboardCriteriaOperator.Equal or CustomLeaderb
return expressionBytes;
}

/// <summary>
/// Gets the dagger value in game units if the rank sorting is time, otherwise the value as is.
/// </summary>
private static int GetDaggerValue(ApiSpec.Admin.CustomLeaderboards.CustomLeaderboardRankSorting apiRankSorting, double apiValue)
{
if (apiRankSorting.ToDomain().IsTime())
return apiValue.To10thMilliTime();
return (int)GameTime.FromSeconds(apiValue).GameUnits;

return (int)apiValue;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using DevilDaggersInfo.Core.Common.Extensions;
using DevilDaggersInfo.Core.Common;
using DevilDaggersInfo.Core.Spawnset;
using DevilDaggersInfo.Web.ApiSpec.Admin.Spawnsets;
using DevilDaggersInfo.Web.Server.Domain.Admin.Exceptions;
Expand Down Expand Up @@ -53,13 +53,13 @@ public async Task AddSpawnsetAsync(AddSpawnset addSpawnset)
GameMode = spawnsetBinary.GameMode.ToDomain(),
SpawnVersion = spawnsetBinary.SpawnVersion,
WorldVersion = spawnsetBinary.WorldVersion,
PreLoopLength = sections.PreLoopSection.Length?.To10thMilliTime(),
PreLoopLength = sections.PreLoopSection.Length.HasValue ? (int)GameTime.FromSeconds(sections.PreLoopSection.Length.Value).GameUnits : null,
PreLoopSpawnCount = sections.PreLoopSection.SpawnCount,
LoopLength = sections.LoopSection.Length?.To10thMilliTime(),
LoopLength = sections.LoopSection.Length.HasValue ? (int)GameTime.FromSeconds(sections.LoopSection.Length.Value).GameUnits : null,
LoopSpawnCount = sections.LoopSection.SpawnCount,
HandLevel = spawnsetBinary.HandLevel.ToDomain(),
AdditionalGems = spawnsetBinary.AdditionalGems,
TimerStart = spawnsetBinary.TimerStart.To10thMilliTime(),
TimerStart = (int)GameTime.FromSeconds(spawnsetBinary.TimerStart).GameUnits,
EffectiveHandLevel = effectivePlayerSettings.HandLevel.ToDomain(),
EffectiveGemsOrHoming = effectivePlayerSettings.GemsOrHoming,
EffectiveHandMesh = effectivePlayerSettings.HandMesh.ToDomain(),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using DevilDaggersInfo.Core.Common;
using DevilDaggersInfo.Core.Common.Extensions;
using DevilDaggersInfo.Web.ApiSpec.Main.LeaderboardHistoryStatistics;
using DevilDaggersInfo.Web.Server.Domain.Models.FileSystem;
using DevilDaggersInfo.Web.Server.Domain.Models.LeaderboardHistory;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using DevilDaggersInfo.Core.Common;
using DevilDaggersInfo.Core.Common.Extensions;
using DevilDaggersInfo.Core.Wiki;
using DevilDaggersInfo.Web.Server.Domain.Entities;
using DevilDaggersInfo.Web.Server.Domain.Entities.Enums;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using DevilDaggersInfo.Core.Common;
using DevilDaggersInfo.Core.Common.Extensions;
using DevilDaggersInfo.Web.Server.Domain.Entities;
using DevilDaggersInfo.Web.Server.Domain.Entities.Enums;
using DevilDaggersInfo.Web.Server.Domain.Models.FileSystem;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using DevilDaggersInfo.Core.Common;
using DevilDaggersInfo.Core.Common.Extensions;
using DevilDaggersInfo.Core.Wiki;
using DevilDaggersInfo.Core.Wiki.Objects;
using DevilDaggersInfo.Web.Server.Domain.Models.FileSystem;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using DevilDaggersInfo.Core.Common.Extensions;
using DevilDaggersInfo.Core.Common;
using DevilDaggersInfo.Web.Server.Domain.Entities.Enums;
using DevilDaggersInfo.Web.Server.Domain.Models.CustomLeaderboards;
using System.Diagnostics;
Expand All @@ -24,7 +24,7 @@ public static DdLiveApi.GetCustomLeaderboardOverviewDdLive ToDdLiveApi(this Cust
Category = GetCategory(customLeaderboard.RankSorting, customLeaderboard.GameMode),
TopPlayerId = customLeaderboard.WorldRecord?.PlayerId,
TopPlayerName = customLeaderboard.WorldRecord?.PlayerName,
WorldRecord = customLeaderboard.WorldRecord?.Time.ToSecondsTime(),
WorldRecord = customLeaderboard.WorldRecord == null ? null : GameTime.FromGameUnits(customLeaderboard.WorldRecord.Time).Seconds,
WorldRecordDagger = customLeaderboard.WorldRecord?.Dagger?.ToDdLiveApi(),
RankSorting = customLeaderboard.RankSorting.ToDdLiveApi(),
SpawnsetGameMode = customLeaderboard.GameMode.ToDdLiveApi(),
Expand Down Expand Up @@ -53,11 +53,11 @@ private static DdLiveApi.GetCustomLeaderboardDaggersDdLive ToDdLiveApi(this Cust
{
return new()
{
Bronze = customLeaderboard.Bronze.ToSecondsTime(),
Silver = customLeaderboard.Silver.ToSecondsTime(),
Golden = customLeaderboard.Golden.ToSecondsTime(),
Devil = customLeaderboard.Devil.ToSecondsTime(),
Leviathan = customLeaderboard.Leviathan.ToSecondsTime(),
Bronze = GameTime.FromGameUnits(customLeaderboard.Bronze).Seconds,
Silver = GameTime.FromGameUnits(customLeaderboard.Silver).Seconds,
Golden = GameTime.FromGameUnits(customLeaderboard.Golden).Seconds,
Devil = GameTime.FromGameUnits(customLeaderboard.Devil).Seconds,
Leviathan = GameTime.FromGameUnits(customLeaderboard.Leviathan).Seconds,
};
}

Expand All @@ -80,13 +80,13 @@ private static DdLiveApi.GetCustomEntryDdLive ToDdLiveApi(this CustomEntry custo
HomingStored = customEntry.HomingStored,
HomingEaten = customEntry.HomingEaten,
EnemiesKilled = customEntry.EnemiesKilled,
LevelUpTime2 = customEntry.LevelUpTime2.ToSecondsTime(),
LevelUpTime3 = customEntry.LevelUpTime3.ToSecondsTime(),
LevelUpTime4 = customEntry.LevelUpTime4.ToSecondsTime(),
LevelUpTime2 = GameTime.FromGameUnits(customEntry.LevelUpTime2).Seconds,
LevelUpTime3 = GameTime.FromGameUnits(customEntry.LevelUpTime3).Seconds,
LevelUpTime4 = GameTime.FromGameUnits(customEntry.LevelUpTime4).Seconds,
DaggersFired = customEntry.DaggersFired,
DaggersHit = customEntry.DaggersHit,
SubmitDate = customEntry.SubmitDate,
Time = customEntry.Time.ToSecondsTime(),
Time = GameTime.FromGameUnits(customEntry.Time).Seconds,
CustomLeaderboardDagger = customEntry.CustomLeaderboardDagger?.ToDdLiveApi(),
HasGraphs = customEntry.HasGraphs,
HasReplay = hasReplay,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using DevilDaggersInfo.Core.Common.Extensions;
using DevilDaggersInfo.Core.Common;
using DevilDaggersInfo.Web.Server.Domain.Entities;
using DevilDaggersInfo.Web.Server.Domain.Entities.Enums;
using System.Diagnostics;
Expand All @@ -23,12 +23,12 @@ public static DdseApi.GetSpawnsetDdse ToDdseApi(this SpawnsetEntity spawnset, bo
AdditionalGems = spawnset.EffectiveGemsOrHoming,
GameMode = spawnset.GameMode.ToDdseApi(),
Hand = (byte)spawnset.EffectiveHandLevel,
LoopLength = (float?)spawnset.LoopLength?.ToSecondsTime(),
LoopLength = spawnset.LoopLength.HasValue ? (float)GameTime.FromGameUnits(spawnset.LoopLength.Value).Seconds : null,
LoopSpawnCount = spawnset.LoopSpawnCount,
NonLoopLength = (float?)spawnset.PreLoopLength?.ToSecondsTime(),
NonLoopLength = spawnset.PreLoopLength.HasValue ? (float)GameTime.FromGameUnits(spawnset.PreLoopLength.Value).Seconds : null,
NonLoopSpawnCount = spawnset.PreLoopSpawnCount,
SpawnVersion = spawnset.SpawnVersion,
TimerStart = (float)spawnset.TimerStart.ToSecondsTime(),
TimerStart = (float)GameTime.FromGameUnits(spawnset.TimerStart).Seconds,
WorldVersion = spawnset.WorldVersion,
},
Name = spawnset.Name,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using DevilDaggersInfo.Core.Common.Extensions;
using DevilDaggersInfo.Core.Common;
using DevilDaggersInfo.Core.CriteriaExpression;
using DevilDaggersInfo.Web.Server.Domain.Entities;
using DevilDaggersInfo.Web.Server.Domain.Entities.Enums;
Expand Down Expand Up @@ -76,13 +76,13 @@ private static MainApi.GetCustomEntry ToMainApi(this CustomEntry customEntry, Sp
HomingStored = customEntry.HomingStored,
HomingEaten = customEntry.HomingEaten,
EnemiesKilled = customEntry.EnemiesKilled,
LevelUpTime2 = customEntry.LevelUpTime2.ToSecondsTime(),
LevelUpTime3 = customEntry.LevelUpTime3.ToSecondsTime(),
LevelUpTime4 = customEntry.LevelUpTime4.ToSecondsTime(),
LevelUpTime2 = GameTime.FromGameUnits(customEntry.LevelUpTime2).Seconds,
LevelUpTime3 = GameTime.FromGameUnits(customEntry.LevelUpTime3).Seconds,
LevelUpTime4 = GameTime.FromGameUnits(customEntry.LevelUpTime4).Seconds,
DaggersFired = customEntry.DaggersFired,
DaggersHit = customEntry.DaggersHit,
SubmitDate = customEntry.SubmitDate,
Time = customEntry.Time.ToSecondsTime(),
Time = GameTime.FromGameUnits(customEntry.Time).Seconds,
CustomLeaderboardDagger = customEntry.CustomLeaderboardDagger?.ToMainApi(),
HasGraphs = customEntry.HasGraphs,
};
Expand All @@ -92,11 +92,11 @@ private static MainApi.GetCustomLeaderboardDaggers ToMainApi(this CustomLeaderbo
{
return new()
{
Bronze = isTime ? customLeaderboardDaggers.Bronze.ToSecondsTime() : customLeaderboardDaggers.Bronze,
Silver = isTime ? customLeaderboardDaggers.Silver.ToSecondsTime() : customLeaderboardDaggers.Silver,
Golden = isTime ? customLeaderboardDaggers.Golden.ToSecondsTime() : customLeaderboardDaggers.Golden,
Devil = isTime ? customLeaderboardDaggers.Devil.ToSecondsTime() : customLeaderboardDaggers.Devil,
Leviathan = isTime ? customLeaderboardDaggers.Leviathan.ToSecondsTime() : customLeaderboardDaggers.Leviathan,
Bronze = isTime ? GameTime.FromGameUnits(customLeaderboardDaggers.Bronze).Seconds : customLeaderboardDaggers.Bronze,
Silver = isTime ? GameTime.FromGameUnits(customLeaderboardDaggers.Silver).Seconds : customLeaderboardDaggers.Silver,
Golden = isTime ? GameTime.FromGameUnits(customLeaderboardDaggers.Golden).Seconds : customLeaderboardDaggers.Golden,
Devil = isTime ? GameTime.FromGameUnits(customLeaderboardDaggers.Devil).Seconds : customLeaderboardDaggers.Devil,
Leviathan = isTime ? GameTime.FromGameUnits(customLeaderboardDaggers.Leviathan).Seconds : customLeaderboardDaggers.Leviathan,
};
}

Expand Down Expand Up @@ -261,13 +261,13 @@ public static MainApi.GetCustomEntryData ToMainApi(this CustomEntryEntity custom
HomingStored = customEntry.HomingStored,
HomingEaten = customEntry.HomingEaten,
EnemiesKilled = customEntry.EnemiesKilled,
LevelUpTime2 = customEntry.LevelUpTime2.ToSecondsTime(),
LevelUpTime3 = customEntry.LevelUpTime3.ToSecondsTime(),
LevelUpTime4 = customEntry.LevelUpTime4.ToSecondsTime(),
LevelUpTime2 = GameTime.FromGameUnits(customEntry.LevelUpTime2).Seconds,
LevelUpTime3 = GameTime.FromGameUnits(customEntry.LevelUpTime3).Seconds,
LevelUpTime4 = GameTime.FromGameUnits(customEntry.LevelUpTime4).Seconds,
DaggersFired = customEntry.DaggersFired,
DaggersHit = customEntry.DaggersHit,
SubmitDate = customEntry.SubmitDate,
Time = customEntry.Time.ToSecondsTime(),
Time = GameTime.FromGameUnits(customEntry.Time).Seconds,
CustomLeaderboardDagger = customEntry.CustomLeaderboard.DaggerFromStat(customEntry)?.ToMainApi(),

GemsCollectedData = GetInt32Arr(customEntryData?.GemsCollectedData),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using DevilDaggersInfo.Core.Common.Extensions;
using DevilDaggersInfo.Core.Common;
using DevilDaggersInfo.Web.ApiSpec.Main.Leaderboards;
using DevilDaggersInfo.Web.Server.Domain.Services.Inversion;

Expand All @@ -19,7 +19,7 @@ public static GetLeaderboard ToMainApi(this IDdLeaderboardService.LeaderboardRes
GemsGlobal = leaderboardResponse.GemsGlobal,
KillsGlobal = leaderboardResponse.KillsGlobal,
TotalPlayers = leaderboardResponse.TotalPlayers,
TimeGlobal = leaderboardResponse.TimeGlobal == 0 ? 0 : leaderboardResponse.TimeGlobal.ToSecondsTime(),
TimeGlobal = leaderboardResponse.TimeGlobal == 0 ? 0 : GameTime.FromGameUnits(leaderboardResponse.TimeGlobal).Seconds,
};
}

Expand All @@ -39,8 +39,8 @@ public static GetEntry ToMainApi(this IDdLeaderboardService.EntryResponse entryR
Kills = entryResponse.Kills,
KillsTotal = entryResponse.KillsTotal,
Rank = entryResponse.Rank,
Time = entryResponse.Time.ToSecondsTime(),
TimeTotal = entryResponse.TimeTotal.ToSecondsTime(),
Time = GameTime.FromGameUnits(entryResponse.Time).Seconds,
TimeTotal = GameTime.FromGameUnits(entryResponse.TimeTotal).Seconds,
Username = entryResponse.Username,
};
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using DevilDaggersInfo.Core.Common.Extensions;
using DevilDaggersInfo.Core.Common;
using DevilDaggersInfo.Web.ApiSpec.Main.LeaderboardHistory;
using DevilDaggersInfo.Web.Server.Domain.Models.LeaderboardHistory;

Expand All @@ -17,7 +17,7 @@ public static GetLeaderboardHistory ToMainApi(this LeaderboardHistory leaderboar
Entries = leaderboard.Entries.ConvertAll(eh => eh.ToMainApi(leaderboard.DateTime)),
GemsGlobal = leaderboard.GemsGlobal,
KillsGlobal = leaderboard.KillsGlobal,
TimeGlobal = leaderboard.TimeGlobal.ToSecondsTime(),
TimeGlobal = GameTime.FromGameUnits(leaderboard.TimeGlobal).Seconds,
TotalPlayers = leaderboard.Players,
};
}
Expand All @@ -39,8 +39,8 @@ private static GetEntryHistory ToMainApi(this EntryHistory entry, DateTime dateT
Kills = entry.Kills,
KillsTotal = entry.KillsTotal,
Rank = entry.Rank,
Time = entry.Time.ToSecondsTime(),
TimeTotal = entry.TimeTotal.ToSecondsTime(),
Time = GameTime.FromGameUnits(entry.Time).Seconds,
TimeTotal = GameTime.FromGameUnits(entry.TimeTotal).Seconds,
Username = entry.Username,
};
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using DevilDaggersInfo.Core.Common.Extensions;
using DevilDaggersInfo.Core.Common;
using DevilDaggersInfo.Core.CriteriaExpression;
using DevilDaggersInfo.Web.Server.Domain.Entities.Enums;
using DevilDaggersInfo.Web.Server.Domain.Extensions;
Expand Down Expand Up @@ -173,11 +173,11 @@ private static ToolsApi.GetCustomLeaderboardDaggers ToAppApi(this CustomLeaderbo
{
return new()
{
Bronze = customLeaderboardDaggers.Bronze.ToSecondsTime(),
Silver = customLeaderboardDaggers.Silver.ToSecondsTime(),
Golden = customLeaderboardDaggers.Golden.ToSecondsTime(),
Devil = customLeaderboardDaggers.Devil.ToSecondsTime(),
Leviathan = customLeaderboardDaggers.Leviathan.ToSecondsTime(),
Bronze = GameTime.FromGameUnits(customLeaderboardDaggers.Bronze).Seconds,
Silver = GameTime.FromGameUnits(customLeaderboardDaggers.Silver).Seconds,
Golden = GameTime.FromGameUnits(customLeaderboardDaggers.Golden).Seconds,
Devil = GameTime.FromGameUnits(customLeaderboardDaggers.Devil).Seconds,
Leviathan = GameTime.FromGameUnits(customLeaderboardDaggers.Leviathan).Seconds,
};
}

Expand Down Expand Up @@ -228,14 +228,14 @@ private static ToolsApi.GetCustomEntry ToAppApi(this CustomEntry customEntry)
HomingEaten = customEntry.HomingEaten,
HomingStored = customEntry.HomingStored,
Id = customEntry.Id,
LevelUpTime2InSeconds = customEntry.LevelUpTime2.ToSecondsTime(),
LevelUpTime3InSeconds = customEntry.LevelUpTime3.ToSecondsTime(),
LevelUpTime4InSeconds = customEntry.LevelUpTime4.ToSecondsTime(),
LevelUpTime2InSeconds = GameTime.FromGameUnits(customEntry.LevelUpTime2).Seconds,
LevelUpTime3InSeconds = GameTime.FromGameUnits(customEntry.LevelUpTime3).Seconds,
LevelUpTime4InSeconds = GameTime.FromGameUnits(customEntry.LevelUpTime4).Seconds,
PlayerId = customEntry.PlayerId,
PlayerName = customEntry.PlayerName,
Rank = customEntry.Rank,
SubmitDate = customEntry.SubmitDate,
TimeInSeconds = customEntry.Time.ToSecondsTime(),
TimeInSeconds = GameTime.FromGameUnits(customEntry.Time).Seconds,
CustomLeaderboardDagger = customEntry.CustomLeaderboardDagger?.ToAppApi(),
};
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using DevilDaggersInfo.Core.Common;
using DevilDaggersInfo.Core.Common.Extensions;
using DevilDaggersInfo.Web.Server.Domain.Entities;
using DevilDaggersInfo.Web.Server.Domain.Entities.Enums;
using DevilDaggersInfo.Web.Server.Domain.Models.CustomLeaderboards;
Expand Down Expand Up @@ -111,7 +110,7 @@ private static string GetFormattedScoreValue(CustomLeaderboardRankSorting rankSo
{
return rankSorting switch
{
CustomLeaderboardRankSorting.TimeAsc or CustomLeaderboardRankSorting.TimeDesc => customEntry.Time.ToSecondsTime().ToString(StringFormats.TimeFormat),
CustomLeaderboardRankSorting.TimeAsc or CustomLeaderboardRankSorting.TimeDesc => GameTime.FromGameUnits(customEntry.Time).Seconds.ToString(StringFormats.TimeFormat),
CustomLeaderboardRankSorting.GemsCollectedAsc or CustomLeaderboardRankSorting.GemsCollectedDesc => customEntry.GemsCollected.ToString(),
CustomLeaderboardRankSorting.GemsDespawnedAsc or CustomLeaderboardRankSorting.GemsDespawnedDesc => customEntry.GemsDespawned.ToString(),
CustomLeaderboardRankSorting.GemsEatenAsc or CustomLeaderboardRankSorting.GemsEatenDesc => customEntry.GemsEaten.ToString(),
Expand All @@ -127,7 +126,7 @@ private static string GetFormattedScoreValueDifference(CustomLeaderboardRankSort
{
return rankSorting switch
{
CustomLeaderboardRankSorting.TimeAsc or CustomLeaderboardRankSorting.TimeDesc => valueDifference.ToSecondsTime().ToString("+0.0000;-0.0000;+0.0000"),
CustomLeaderboardRankSorting.TimeAsc or CustomLeaderboardRankSorting.TimeDesc => GameTime.FromGameUnits(valueDifference).Seconds.ToString("+0.0000;-0.0000;+0.0000"),
_ => valueDifference.ToString("+0;-0;+0"),
};
}
Expand Down

0 comments on commit 9f46c37

Please sign in to comment.