mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-04-21 18:13:14 +02:00

Moved AppLibrary, Configuration, and PlayReport namespaces to Ryujinx.Systems, add the compat list stuff in the base Ryujinx.Systems namespace. Moved the compatibility UI stuff to the proper UI view/viewmodel folders.
31 lines
857 B
C#
31 lines
857 B
C#
using Ryujinx.Ava.Systems.AppLibrary;
|
|
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);
|
|
}
|
|
}
|
|
}
|