1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-15 17:47:18 +08:00

Simplify and future-proof random retrieval method

Will support future added intros without further code changes. Also uses RNG instead of `new Random`.
This commit is contained in:
Dean Herbert 2019-09-29 14:35:35 +08:00
parent 69ac2f90b3
commit ce62f3c75b

View File

@ -1,12 +1,12 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. 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();