Skip to content

Commit

Permalink
[F] RatingUpWhenSSSp Algo
Browse files Browse the repository at this point in the history
  • Loading branch information
clansty committed Nov 15, 2024
1 parent 0455a83 commit cd075a3
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions AquaMai/Utils/SelectionDetail.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,19 @@ public void OnGUI()

private uint CalcB50(MusicData musicData, int difficulty)
{
var newRate = new UserRate(musicData.name.id, difficulty, 1010000, (uint)musicData.version);
var userLowRate = (newRate.OldFlag ? userData.RatingList.RatingList : userData.RatingList.NewRatingList).Last();
var theory = new UserRate(musicData.name.id, difficulty, 1010000, (uint)musicData.version);
var list = theory.OldFlag ? userData.RatingList.RatingList : userData.RatingList.NewRatingList;
var userLowRate = list.Last();
var userSongRate = list.FirstOrDefault(it => it.MusicId == musicData.name.id && it.Level == difficulty);

if (newRate.SingleRate > userLowRate.SingleRate)
if (!userSongRate.Equals(default(UserRate)))
{
return newRate.SingleRate - userLowRate.SingleRate;
return theory.SingleRate - userSongRate.SingleRate;
}

if (theory.SingleRate > userLowRate.SingleRate)
{
return theory.SingleRate - userLowRate.SingleRate;
}

return 0;
Expand Down

0 comments on commit cd075a3

Please sign in to comment.