public void UpdatePerfectTrialInfo() { if (SongInfo != null && SongInfo.IsPPDSong) { int totalCount = 0; for (int i = 0; i < 4; i++) { if (SongInfo.Difficulty.HasFlag((SongInformation.AvailableDifficulty)(1 << i))) { var str = CryptographyUtility.Getx2Encoding(SongInfo.GetScoreHash((PPDFrameworkCore.Difficulty)i)); perfectTrials[i] = PerfectTrialCache.Instance.IsPerfect(str); totalCount++; } } if (totalCount == 0) { PerfectRatio = 0; } else { PerfectRatio = perfectTrials.Count(p => p) / (float)totalCount; } } }