1
0
mirror of synced 2024-11-28 09:20:53 +01:00
OpenTaiko/TJAPlayer3/Songs/C曲リストノードComparers/C曲リストノードComparerLevel.cs

32 lines
992 B
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System.Collections.Generic;
namespace TJAPlayer3.C曲リストードComparers
{
internal sealed class C曲リストードComparerLevel : IComparer<C曲リストード>
{
private readonly int _order;
public C曲リストードComparerLevel(int order)
{
this._order = order;
}
public int Compare(C曲リストード n1, C曲リストード n2)
{
int _n1s = (n1.eード種別 != C曲リストード.Eード種別.SCORE) ? 0 : 1;
int _n2s = (n2.eード種別 != C曲リストード.Eード種別.SCORE) ? 0 : 1;
if (_n1s == 0 || _n2s == 0)
{
return 0;
}
return _order * _diffOf(n1).CompareTo(_diffOf(n2));
}
private int _diffOf(C曲リストード n1)
{
return n1.nLevel[TJAPlayer3.stage選曲.act曲リスト.tFetchDifficulty(n1)];
}
}
}