mirror of
https://github.com/ppy/osu.git
synced 2025-01-15 10:42:55 +08:00
Reduce + make beatmap scores testcase work
This commit is contained in:
parent
a7ad29ca9d
commit
8c0e325d8b
@ -13,9 +13,7 @@ using osu.Game.Rulesets.Scoring;
|
|||||||
using osu.Game.Users;
|
using osu.Game.Users;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Game.Beatmaps;
|
|
||||||
using osu.Game.Online.API.Requests.Responses;
|
using osu.Game.Online.API.Requests.Responses;
|
||||||
using osu.Game.Rulesets.Osu;
|
|
||||||
using osu.Game.Scoring;
|
using osu.Game.Scoring;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
|
|
||||||
@ -67,6 +65,7 @@ namespace osu.Game.Tests.Visual
|
|||||||
new OsuModHardRock(),
|
new OsuModHardRock(),
|
||||||
},
|
},
|
||||||
Rank = ScoreRank.XH,
|
Rank = ScoreRank.XH,
|
||||||
|
MaxCombo = 1234,
|
||||||
TotalScore = 1234567890,
|
TotalScore = 1234567890,
|
||||||
Accuracy = 1,
|
Accuracy = 1,
|
||||||
},
|
},
|
||||||
@ -89,6 +88,7 @@ namespace osu.Game.Tests.Visual
|
|||||||
new OsuModFlashlight(),
|
new OsuModFlashlight(),
|
||||||
},
|
},
|
||||||
Rank = ScoreRank.S,
|
Rank = ScoreRank.S,
|
||||||
|
MaxCombo = 1234,
|
||||||
TotalScore = 1234789,
|
TotalScore = 1234789,
|
||||||
Accuracy = 0.9997,
|
Accuracy = 0.9997,
|
||||||
},
|
},
|
||||||
@ -110,6 +110,7 @@ namespace osu.Game.Tests.Visual
|
|||||||
new OsuModHidden(),
|
new OsuModHidden(),
|
||||||
},
|
},
|
||||||
Rank = ScoreRank.B,
|
Rank = ScoreRank.B,
|
||||||
|
MaxCombo = 1234,
|
||||||
TotalScore = 12345678,
|
TotalScore = 12345678,
|
||||||
Accuracy = 0.9854,
|
Accuracy = 0.9854,
|
||||||
},
|
},
|
||||||
@ -130,6 +131,7 @@ namespace osu.Game.Tests.Visual
|
|||||||
new OsuModDoubleTime(),
|
new OsuModDoubleTime(),
|
||||||
},
|
},
|
||||||
Rank = ScoreRank.C,
|
Rank = ScoreRank.C,
|
||||||
|
MaxCombo = 1234,
|
||||||
TotalScore = 1234567,
|
TotalScore = 1234567,
|
||||||
Accuracy = 0.8765,
|
Accuracy = 0.8765,
|
||||||
},
|
},
|
||||||
@ -146,6 +148,7 @@ namespace osu.Game.Tests.Visual
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
Rank = ScoreRank.F,
|
Rank = ScoreRank.F,
|
||||||
|
MaxCombo = 1234,
|
||||||
TotalScore = 123456,
|
TotalScore = 123456,
|
||||||
Accuracy = 0.6543,
|
Accuracy = 0.6543,
|
||||||
},
|
},
|
||||||
@ -159,145 +162,7 @@ namespace osu.Game.Tests.Visual
|
|||||||
s.Statistics.Add(HitResult.Miss, RNG.Next(2000));
|
s.Statistics.Add(HitResult.Miss, RNG.Next(2000));
|
||||||
}
|
}
|
||||||
|
|
||||||
IEnumerable<APIScoreInfo> anotherScores = new[]
|
scoresContainer.Scores = scores;
|
||||||
{
|
|
||||||
new APIScoreInfo
|
|
||||||
{
|
|
||||||
User = new User
|
|
||||||
{
|
|
||||||
Id = 4608074,
|
|
||||||
Username = @"Skycries",
|
|
||||||
Country = new Country
|
|
||||||
{
|
|
||||||
FullName = @"Brazil",
|
|
||||||
FlagName = @"BR",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
Mods = new Mod[]
|
|
||||||
{
|
|
||||||
new OsuModDoubleTime(),
|
|
||||||
new OsuModHidden(),
|
|
||||||
new OsuModFlashlight(),
|
|
||||||
},
|
|
||||||
Rank = ScoreRank.S,
|
|
||||||
TotalScore = 1234789,
|
|
||||||
Accuracy = 0.9997,
|
|
||||||
},
|
|
||||||
new APIScoreInfo
|
|
||||||
{
|
|
||||||
User = new User
|
|
||||||
{
|
|
||||||
Id = 6602580,
|
|
||||||
Username = @"waaiiru",
|
|
||||||
Country = new Country
|
|
||||||
{
|
|
||||||
FullName = @"Spain",
|
|
||||||
FlagName = @"ES",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
Mods = new Mod[]
|
|
||||||
{
|
|
||||||
new OsuModDoubleTime(),
|
|
||||||
new OsuModHidden(),
|
|
||||||
new OsuModFlashlight(),
|
|
||||||
new OsuModHardRock(),
|
|
||||||
},
|
|
||||||
Rank = ScoreRank.XH,
|
|
||||||
TotalScore = 1234567890,
|
|
||||||
Accuracy = 1,
|
|
||||||
},
|
|
||||||
new APIScoreInfo
|
|
||||||
{
|
|
||||||
User = new User
|
|
||||||
{
|
|
||||||
Id = 7151382,
|
|
||||||
Username = @"Mayuri Hana",
|
|
||||||
Country = new Country
|
|
||||||
{
|
|
||||||
FullName = @"Thailand",
|
|
||||||
FlagName = @"TH",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
Rank = ScoreRank.F,
|
|
||||||
TotalScore = 123456,
|
|
||||||
Accuracy = 0.6543,
|
|
||||||
},
|
|
||||||
new APIScoreInfo
|
|
||||||
{
|
|
||||||
User = new User
|
|
||||||
{
|
|
||||||
Id = 1014222,
|
|
||||||
Username = @"eLy",
|
|
||||||
Country = new Country
|
|
||||||
{
|
|
||||||
FullName = @"Japan",
|
|
||||||
FlagName = @"JP",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
Mods = new Mod[]
|
|
||||||
{
|
|
||||||
new OsuModDoubleTime(),
|
|
||||||
new OsuModHidden(),
|
|
||||||
},
|
|
||||||
Rank = ScoreRank.B,
|
|
||||||
TotalScore = 12345678,
|
|
||||||
Accuracy = 0.9854,
|
|
||||||
},
|
|
||||||
new APIScoreInfo
|
|
||||||
{
|
|
||||||
User = new User
|
|
||||||
{
|
|
||||||
Id = 1541390,
|
|
||||||
Username = @"Toukai",
|
|
||||||
Country = new Country
|
|
||||||
{
|
|
||||||
FullName = @"Canada",
|
|
||||||
FlagName = @"CA",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
Mods = new Mod[]
|
|
||||||
{
|
|
||||||
new OsuModDoubleTime(),
|
|
||||||
},
|
|
||||||
Rank = ScoreRank.C,
|
|
||||||
TotalScore = 1234567,
|
|
||||||
Accuracy = 0.8765,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
foreach (var s in anotherScores)
|
|
||||||
{
|
|
||||||
s.Statistics.Add(HitResult.Great, RNG.Next(2000));
|
|
||||||
s.Statistics.Add(HitResult.Good, RNG.Next(2000));
|
|
||||||
s.Statistics.Add(HitResult.Meh, RNG.Next(2000));
|
|
||||||
s.Statistics.Add(HitResult.Miss, RNG.Next(2000));
|
|
||||||
}
|
|
||||||
|
|
||||||
var topScoreInfo = new APIScoreInfo
|
|
||||||
{
|
|
||||||
User = new User
|
|
||||||
{
|
|
||||||
Id = 2705430,
|
|
||||||
Username = @"Mooha",
|
|
||||||
Country = new Country
|
|
||||||
{
|
|
||||||
FullName = @"France",
|
|
||||||
FlagName = @"FR",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
Mods = new Mod[]
|
|
||||||
{
|
|
||||||
new OsuModDoubleTime(),
|
|
||||||
new OsuModFlashlight(),
|
|
||||||
new OsuModHardRock(),
|
|
||||||
},
|
|
||||||
Rank = ScoreRank.B,
|
|
||||||
TotalScore = 987654321,
|
|
||||||
Accuracy = 0.8487,
|
|
||||||
};
|
|
||||||
topScoreInfo.Statistics.Add(HitResult.Great, RNG.Next(2000));
|
|
||||||
topScoreInfo.Statistics.Add(HitResult.Good, RNG.Next(2000));
|
|
||||||
topScoreInfo.Statistics.Add(HitResult.Meh, RNG.Next(2000));
|
|
||||||
topScoreInfo.Statistics.Add(HitResult.Miss, RNG.Next(2000));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
|
Loading…
Reference in New Issue
Block a user