private static List <BeatPerformance> GetBpWithCurrentPP(List <BeatPerformance> bps, double pp, int?mapID) { List <BeatPerformance> tempBps = new List <BeatPerformance>(bps); BeatPerformance currMapBP = new BeatPerformance(); currMapBP.PP = pp; currMapBP.BeatmapID = mapID.HasValue ? mapID.Value : 0; if (mapID.HasValue) { foreach (BeatPerformance bP in bps) { if (bP.BeatmapID == mapID.Value) { if (bP.PP < pp) { tempBps.Remove(bP); } } } } tempBps.Add(currMapBP); tempBps.Sort(CompareBP); tempBps.Reverse(); return(tempBps); }
private static int CompareBP(BeatPerformance x, BeatPerformance y) { if (x.PP < y.PP) { return(-1); } if (x.PP > y.PP) { return(1); } return(0); }