1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-16 17:02:55 +08:00
osu-lazer/osu.Desktop.Tests/Visual/TestCaseLeaderboard.cs

223 lines
7.7 KiB
C#
Raw Normal View History

2017-03-04 15:37:34 +08:00
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
2017-08-17 18:24:22 +08:00
using OpenTK;
2017-03-04 15:37:34 +08:00
using osu.Framework.Graphics;
2017-04-18 15:05:58 +08:00
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Osu.Mods;
using osu.Game.Rulesets.Scoring;
2017-03-14 22:17:06 +08:00
using osu.Game.Screens.Select.Leaderboards;
using osu.Game.Users;
2017-03-04 15:37:34 +08:00
namespace osu.Desktop.Tests.Visual
2017-03-04 15:37:34 +08:00
{
internal class TestCaseLeaderboard : OsuTestCase
2017-03-04 15:37:34 +08:00
{
public override string Description => @"From song select";
2017-07-08 17:17:47 +08:00
private readonly Leaderboard leaderboard;
2017-03-04 16:05:31 +08:00
private void newScores()
{
var scores = new[]
2017-03-04 16:05:31 +08:00
{
new Score
2017-03-04 16:05:31 +08:00
{
Rank = ScoreRank.XH,
2017-08-14 07:16:19 +08:00
Accuracy = 1,
MaxCombo = 244,
TotalScore = 1707827,
Mods = new Mod[] { new OsuModHidden(), new OsuModHardRock(), },
User = new User
{
Id = 6602580,
Username = @"waaiiru",
Country = new Country
{
FullName = @"Spain",
FlagName = @"ES",
},
},
},
new Score
{
Rank = ScoreRank.X,
2017-08-14 07:16:19 +08:00
Accuracy = 1,
MaxCombo = 244,
TotalScore = 1707827,
Mods = new Mod[] { new OsuModHidden(), new OsuModHardRock(), },
User = new User
{
Id = 4608074,
Username = @"Skycries",
Country = new Country
{
FullName = @"Brazil",
FlagName = @"BR",
},
},
},
new Score
{
Rank = ScoreRank.SH,
2017-08-14 07:16:19 +08:00
Accuracy = 1,
MaxCombo = 244,
TotalScore = 1707827,
Mods = new Mod[] { new OsuModHidden(), new OsuModHardRock(), },
User = new User
{
Id = 1014222,
Username = @"eLy",
Country = new Country
{
FullName = @"Japan",
FlagName = @"JP",
},
},
},
new Score
{
2017-03-14 05:34:43 +08:00
Rank = ScoreRank.S,
2017-08-14 07:16:19 +08:00
Accuracy = 1,
MaxCombo = 244,
TotalScore = 1707827,
Mods = new Mod[] { new OsuModHidden(), new OsuModHardRock(), },
User = new User
{
Id = 1541390,
Username = @"Toukai",
Country = new Country
{
FullName = @"Canada",
FlagName = @"CA",
},
},
},
new Score
{
2017-03-14 05:34:43 +08:00
Rank = ScoreRank.A,
2017-08-14 07:16:19 +08:00
Accuracy = 1,
MaxCombo = 244,
TotalScore = 1707827,
Mods = new Mod[] { new OsuModHidden(), new OsuModHardRock(), },
User = new User
{
Id = 2243452,
Username = @"Satoruu",
Country = new Country
{
FullName = @"Venezuela",
FlagName = @"VE",
},
},
},
new Score
{
2017-03-14 05:34:43 +08:00
Rank = ScoreRank.B,
2017-08-14 07:16:19 +08:00
Accuracy = 0.9826,
MaxCombo = 244,
TotalScore = 1707827,
Mods = new Mod[] { new OsuModHidden(), new OsuModHardRock(), },
User = new User
{
Id = 2705430,
Username = @"Mooha",
Country = new Country
{
FullName = @"France",
FlagName = @"FR",
},
},
},
new Score
{
2017-03-14 05:34:43 +08:00
Rank = ScoreRank.C,
2017-08-14 07:16:19 +08:00
Accuracy = 0.9654,
MaxCombo = 244,
TotalScore = 1707827,
Mods = new Mod[] { new OsuModHidden(), new OsuModHardRock(), },
User = new User
{
Id = 7151382,
Username = @"Mayuri Hana",
Country = new Country
{
FullName = @"Thailand",
FlagName = @"TH",
},
},
},
new Score
{
2017-03-14 22:14:27 +08:00
Rank = ScoreRank.F,
2017-08-14 07:16:19 +08:00
Accuracy = 0.6025,
MaxCombo = 244,
TotalScore = 1707827,
Mods = new Mod[] { new OsuModHidden(), new OsuModHardRock(), },
User = new User
{
Id = 2051389,
Username = @"FunOrange",
Country = new Country
{
FullName = @"Canada",
FlagName = @"CA",
},
},
},
new Score
{
2017-03-14 05:34:43 +08:00
Rank = ScoreRank.F,
2017-08-14 07:16:19 +08:00
Accuracy = 0.5140,
MaxCombo = 244,
TotalScore = 1707827,
Mods = new Mod[] { new OsuModHidden(), new OsuModHardRock(), },
User = new User
{
Id = 6169483,
Username = @"-Hebel-",
Country = new Country
{
FullName = @"Mexico",
FlagName = @"MX",
},
},
},
new Score
{
2017-03-14 05:34:43 +08:00
Rank = ScoreRank.F,
2017-08-14 07:16:19 +08:00
Accuracy = 0.4222,
MaxCombo = 244,
TotalScore = 1707827,
Mods = new Mod[] { new OsuModHidden(), new OsuModHardRock(), },
User = new User
{
Id = 6702666,
Username = @"prhtnsm",
Country = new Country
{
FullName = @"Germany",
FlagName = @"DE",
},
},
},
};
2017-03-04 16:05:31 +08:00
leaderboard.Scores = scores;
2017-03-04 16:05:31 +08:00
}
public TestCaseLeaderboard()
2017-03-04 15:37:34 +08:00
{
2017-03-04 16:05:31 +08:00
Add(leaderboard = new Leaderboard
2017-03-04 15:37:34 +08:00
{
Origin = Anchor.Centre,
Anchor = Anchor.Centre,
Size = new Vector2(550f, 450f),
});
2017-03-04 16:05:31 +08:00
2017-03-31 16:55:07 +08:00
AddStep(@"New Scores", newScores);
2017-03-04 16:05:31 +08:00
newScores();
2017-03-04 15:37:34 +08:00
}
}
}