mirror of
https://jihulab.com/DGP-Studio/Snap.Hutao.git
synced 2025-11-19 21:02:53 +08:00
use weapon sort
This commit is contained in:
@@ -24,6 +24,8 @@ internal sealed partial class Weapon : INameQualityAccess,
|
||||
|
||||
public PromoteId PromoteId { get; set; }
|
||||
|
||||
public uint Sort { get; set; }
|
||||
|
||||
public WeaponType WeaponType { get; set; }
|
||||
|
||||
public QualityType RankLevel { get; set; }
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
using Google.OrTools.LinearSolver;
|
||||
using Microsoft.Extensions.Caching.Memory;
|
||||
using Snap.Hutao.Core;
|
||||
using Snap.Hutao.Core.Diagnostics;
|
||||
using Snap.Hutao.Core.ExceptionService;
|
||||
using Snap.Hutao.Model.Metadata.Abstraction;
|
||||
using Snap.Hutao.Model.Primitive;
|
||||
@@ -21,6 +22,7 @@ internal sealed partial class MinimalPromotionDelta
|
||||
{
|
||||
private const string CacheKey = $"{nameof(MinimalPromotionDelta)}.Cache";
|
||||
|
||||
private readonly ILogger<MinimalPromotionDelta> logger;
|
||||
private readonly IMetadataService metadataService;
|
||||
private readonly IMemoryCache memoryCache;
|
||||
|
||||
@@ -37,7 +39,11 @@ internal sealed partial class MinimalPromotionDelta
|
||||
.. (await metadataService.GetWeaponListAsync().ConfigureAwait(false)).Where(w => w.Quality >= Model.Intrinsic.QualityType.QUALITY_BLUE),
|
||||
];
|
||||
|
||||
List<ICultivationItemsAccess> minimal = Minimize(cultivationItemsEntryList);
|
||||
List<ICultivationItemsAccess> minimal;
|
||||
using (ValueStopwatch.MeasureExecution(logger))
|
||||
{
|
||||
minimal = Minimize(cultivationItemsEntryList);
|
||||
}
|
||||
|
||||
// Gurantee the order of avatar and weapon
|
||||
// Make sure weapons can have avatar to attach
|
||||
|
||||
@@ -102,9 +102,7 @@ internal sealed partial class WikiWeaponViewModel : Abstraction.ViewModel
|
||||
|
||||
List<Weapon> weapons = await metadataService.GetWeaponListAsync().ConfigureAwait(false);
|
||||
IEnumerable<Weapon> sorted = weapons
|
||||
.OrderByDescending(weapon => weapon.RankLevel)
|
||||
.ThenBy(weapon => weapon.WeaponType)
|
||||
.ThenByDescending(weapon => weapon.Id.Value);
|
||||
.OrderByDescending(weapon => weapon.Sort);
|
||||
List<Weapon> list = [.. sorted];
|
||||
|
||||
await CombineComplexDataAsync(list, idMaterialMap).ConfigureAwait(false);
|
||||
|
||||
Reference in New Issue
Block a user