mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-08-12 05:05:26 +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.
32 lines
835 B
C#
32 lines
835 B
C#
using Ryujinx.Ava.Systems.AppLibrary;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace Ryujinx.Ava.UI.Models.Generic
|
|
{
|
|
internal class TimePlayedSortComparer : IComparer<ApplicationData>
|
|
{
|
|
public TimePlayedSortComparer() { }
|
|
public TimePlayedSortComparer(bool isAscending) { IsAscending = isAscending; }
|
|
|
|
public bool IsAscending { get; }
|
|
|
|
public int Compare(ApplicationData x, ApplicationData y)
|
|
{
|
|
TimeSpan aValue = TimeSpan.Zero, bValue = TimeSpan.Zero;
|
|
|
|
if (x?.TimePlayed != null)
|
|
{
|
|
aValue = x.TimePlayed;
|
|
}
|
|
|
|
if (y?.TimePlayed != null)
|
|
{
|
|
bValue = y.TimePlayed;
|
|
}
|
|
|
|
return (IsAscending ? 1 : -1) * TimeSpan.Compare(aValue, bValue);
|
|
}
|
|
}
|
|
}
|