mirror of
https://git.743378673.xyz/MeloNX/MeloNX.git
synced 2025-07-29 17:57:11 +02:00
Merge Latest Ryujinx (Unstable)
This commit is contained in:
parent
aaefc0a9e5
commit
12ab8bc3e2
1237 changed files with 48656 additions and 21399 deletions
31
src/Ryujinx/UI/Models/Generic/LastPlayedSortComparer.cs
Normal file
31
src/Ryujinx/UI/Models/Generic/LastPlayedSortComparer.cs
Normal file
|
@ -0,0 +1,31 @@
|
|||
using Ryujinx.UI.App.Common;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Ryujinx.Ava.UI.Models.Generic
|
||||
{
|
||||
internal class LastPlayedSortComparer : IComparer<ApplicationData>
|
||||
{
|
||||
public LastPlayedSortComparer() { }
|
||||
public LastPlayedSortComparer(bool isAscending) { IsAscending = isAscending; }
|
||||
|
||||
public bool IsAscending { get; }
|
||||
|
||||
public int Compare(ApplicationData x, ApplicationData y)
|
||||
{
|
||||
DateTime aValue = DateTime.UnixEpoch, bValue = DateTime.UnixEpoch;
|
||||
|
||||
if (x?.LastPlayed != null)
|
||||
{
|
||||
aValue = x.LastPlayed.Value;
|
||||
}
|
||||
|
||||
if (y?.LastPlayed != null)
|
||||
{
|
||||
bValue = y.LastPlayed.Value;
|
||||
}
|
||||
|
||||
return (IsAscending ? 1 : -1) * DateTime.Compare(aValue, bValue);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue