Fix player instantiation

Since ModTestScene.CreatePlayer would apply mods in addition to
instantiating the player, overriding it could lead to mistakenly also
overriding the code that was supposed to set up the test via
currentTestData.

Make ModTestScene.CreatePlayer sealed, which ensures that mod &
autoplay changes are applied, and expose ModTestScene.CreateModPlayer
instead which has the expected semantics.
This commit is contained in:
Bartłomiej Dach
2020-03-08 14:18:45 +01:00
parent cc5cae4db9
commit c803de2b49
2 changed files with 5 additions and 3 deletions

View File

@ -32,7 +32,7 @@ namespace osu.Game.Tests.Visual
PassCondition = () => ((PerfectModTestPlayer)Player).CheckFailed(shouldMiss && testCaseData.FailOnMiss)
});
protected override TestPlayer CreatePlayer(Ruleset ruleset) => new PerfectModTestPlayer();
protected override TestPlayer CreateModPlayer(Ruleset ruleset) => new PerfectModTestPlayer();
private class PerfectModTestPlayer : TestPlayer
{