From 6ef2f54d9a31da3cbe7d38e359b1d663086dc381 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Wed, 22 Jan 2025 08:43:36 +0100 Subject: [PATCH] Remove redundant setup in template game test scenes --- .../Visual/TestSceneTemplateGameGame.cs | 10 ++-------- .../Visual/TestSceneFlappyDonGame.cs | 9 ++------- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/osu.Framework.Templates/templates/template-empty/TemplateGame.Game.Tests/Visual/TestSceneTemplateGameGame.cs b/osu.Framework.Templates/templates/template-empty/TemplateGame.Game.Tests/Visual/TestSceneTemplateGameGame.cs index bdaac3367..a9f34c629 100644 --- a/osu.Framework.Templates/templates/template-empty/TemplateGame.Game.Tests/Visual/TestSceneTemplateGameGame.cs +++ b/osu.Framework.Templates/templates/template-empty/TemplateGame.Game.Tests/Visual/TestSceneTemplateGameGame.cs @@ -1,5 +1,4 @@ using osu.Framework.Allocation; -using osu.Framework.Platform; using NUnit.Framework; namespace TemplateGame.Game.Tests.Visual @@ -10,15 +9,10 @@ namespace TemplateGame.Game.Tests.Visual // Add visual tests to ensure correct behaviour of your game: https://github.com/ppy/osu-framework/wiki/Development-and-Testing // You can make changes to classes associated with the tests and they will recompile and update immediately. - private TemplateGameGame game; - [BackgroundDependencyLoader] - private void load(GameHost host) + private void load() { - game = new TemplateGameGame(); - game.SetHost(host); - - AddGame(game); + AddGame(new TemplateGameGame()); } } } diff --git a/osu.Framework.Templates/templates/template-flappy/FlappyDon.Game.Tests/Visual/TestSceneFlappyDonGame.cs b/osu.Framework.Templates/templates/template-flappy/FlappyDon.Game.Tests/Visual/TestSceneFlappyDonGame.cs index dfb9bc753..3de074c08 100644 --- a/osu.Framework.Templates/templates/template-flappy/FlappyDon.Game.Tests/Visual/TestSceneFlappyDonGame.cs +++ b/osu.Framework.Templates/templates/template-flappy/FlappyDon.Game.Tests/Visual/TestSceneFlappyDonGame.cs @@ -1,5 +1,4 @@ using osu.Framework.Allocation; -using osu.Framework.Platform; using NUnit.Framework; namespace FlappyDon.Game.Tests.Visual @@ -11,14 +10,10 @@ namespace FlappyDon.Game.Tests.Visual [TestFixture] public partial class TestSceneFlappyDonGame : FlappyDonTestScene { - private FlappyDonGame game; - [BackgroundDependencyLoader] - private void load(GameHost host) + private void load() { - game = new FlappyDonGame(); - game.SetHost(host); - AddGame(game); + AddGame(new FlappyDonGame()); } } }