From ce62f3c75b8e2e896053bbf61291bb31404c2775 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 29 Sep 2019 14:35:35 +0800 Subject: [PATCH] Simplify and future-proof random retrieval method Will support future added intros without further code changes. Also uses RNG instead of `new Random`. --- osu.Game/Screens/Loader.cs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/osu.Game/Screens/Loader.cs b/osu.Game/Screens/Loader.cs index fb49c8a574..41ee01be20 100644 --- a/osu.Game/Screens/Loader.cs +++ b/osu.Game/Screens/Loader.cs @@ -1,12 +1,12 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -using System; using System.Collections.Generic; using System.Linq; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Shaders; +using osu.Framework.MathUtils; using osu.Game.Screens.Menu; using osuTK; using osu.Framework.Screens; @@ -60,15 +60,11 @@ namespace osu.Game.Screens private IntroScreen getIntroSequence() { + if (introSequence == IntroSequence.Random) + introSequence = (IntroSequence)RNG.Next(0, (int)IntroSequence.Random); + switch (introSequence) { - case IntroSequence.Random: - var random = new Random(); - if (random.Next(2) == 0) - return new IntroCircles(); - else - return new IntroTriangles(); - case IntroSequence.Circles: return new IntroCircles();