Skip to content

Commit

Permalink
Stop using deprecated time extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
NoahStolk committed Sep 7, 2024
1 parent c108954 commit e96e051
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 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,3 +1,4 @@
using DevilDaggersInfo.Core.Common;
using DevilDaggersInfo.Core.Common.Extensions;
using DevilDaggersInfo.Core.CriteriaExpression;
using DevilDaggersInfo.Web.Server.Domain.Constants;
Expand Down Expand Up @@ -219,10 +220,10 @@ public TargetCollection CreateTargetCollection()
HomingStored = GetFinalHomingValue(),
HomingEaten = HomingEaten,
DeathType = DeathType,
Time = TimeInSeconds.To10thMilliTime(),
LevelUpTime2 = LevelUpTime2InSeconds.To10thMilliTime(),
LevelUpTime3 = LevelUpTime3InSeconds.To10thMilliTime(),
LevelUpTime4 = LevelUpTime4InSeconds.To10thMilliTime(),
Time = (int)GameTime.FromSeconds(TimeInSeconds).GameUnits,
LevelUpTime2 = (int)GameTime.FromSeconds(LevelUpTime2InSeconds).GameUnits,
LevelUpTime3 = (int)GameTime.FromSeconds(LevelUpTime3InSeconds).GameUnits,
LevelUpTime4 = (int)GameTime.FromSeconds(LevelUpTime4InSeconds).GameUnits,
EnemiesAlive = EnemiesAlive,
Skull1Kills = GetFinalEnemyStat(urd => urd.Skull1sKilled),
Skull2Kills = GetFinalEnemyStat(urd => urd.Skull2sKilled),
Expand Down

0 comments on commit e96e051

Please sign in to comment.