1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 04:02:59 +08:00

Move BackgroundModes to their own files.

This commit is contained in:
Dean Herbert 2016-10-06 23:32:35 +09:00
parent d6042bd689
commit d1dfa120d1
15 changed files with 70 additions and 32 deletions

View File

@ -8,7 +8,6 @@ using System.Text;
using System.Threading.Tasks;
using osu.Framework.GameModes;
using osu.Framework.Graphics.Transformations;
using osu.Game.Graphics.Background;
using OpenTK;
namespace osu.Game.GameModes
@ -61,35 +60,4 @@ namespace osu.Game.GameModes
base.OnResuming(last);
}
}
public class BackgroundModeDefault : BackgroundMode
{
public override void Load()
{
base.Load();
Add(new Background());
}
}
public class BackgroundModeCustom : BackgroundMode
{
private readonly string textureName;
public BackgroundModeCustom(string textureName)
{
this.textureName = textureName;
}
public override void Load()
{
base.Load();
Add(new Background(textureName));
}
public override bool Equals(BackgroundMode other)
{
return base.Equals(other) && textureName == ((BackgroundModeCustom)other).textureName;
}
}
}

View File

@ -0,0 +1,28 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Game.Graphics.Background;
namespace osu.Game.GameModes.Backgrounds
{
public class BackgroundModeCustom : BackgroundMode
{
private readonly string textureName;
public BackgroundModeCustom(string textureName)
{
this.textureName = textureName;
}
public override void Load()
{
base.Load();
Add(new Background(textureName));
}
public override bool Equals(BackgroundMode other)
{
return base.Equals(other) && textureName == ((BackgroundModeCustom)other).textureName;
}
}
}

View File

@ -0,0 +1,17 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Game.Graphics.Background;
namespace osu.Game.GameModes.Backgrounds
{
public class BackgroundModeDefault : BackgroundMode
{
public override void Load()
{
base.Load();
Add(new Background());
}
}
}

View File

@ -0,0 +1,10 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
namespace osu.Game.GameModes.Backgrounds
{
public class BackgroundModeEmpty : BackgroundMode
{
}
}

View File

@ -3,6 +3,7 @@
using System;
using System.Collections.Generic;
using osu.Game.GameModes.Backgrounds;
namespace osu.Game.GameModes.Edit
{

View File

@ -7,6 +7,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using osu.Framework.GameModes;
using osu.Game.GameModes.Backgrounds;
using OpenTK.Graphics;
namespace osu.Game.GameModes.Edit

View File

@ -10,6 +10,7 @@ using osu.Framework.Graphics.Drawables;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Transformations;
using osu.Framework.Graphics.UserInterface;
using osu.Game.GameModes.Backgrounds;
using OpenTK;
using OpenTK.Graphics;

View File

@ -5,11 +5,14 @@ using System;
using osu.Framework.Audio.Sample;
using osu.Framework.Audio.Track;
using osu.Framework.GameModes;
using osu.Game.GameModes.Backgrounds;
namespace osu.Game.GameModes.Menu
{
class Intro : OsuGameMode
{
protected override BackgroundMode CreateBackground() => new BackgroundModeEmpty();
public override void Load()
{
base.Load();

View File

@ -7,6 +7,7 @@ using osu.Framework.GameModes;
using osu.Framework.GameModes.Testing;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Transformations;
using osu.Game.GameModes.Backgrounds;
using osu.Game.GameModes.Charts;
using osu.Game.GameModes.Direct;
using osu.Game.GameModes.Edit;

View File

@ -7,6 +7,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using osu.Framework.GameModes;
using osu.Game.GameModes.Backgrounds;
using osu.Game.GameModes.Play;
using OpenTK.Graphics;

View File

@ -7,6 +7,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using osu.Framework.GameModes;
using osu.Game.GameModes.Backgrounds;
using OpenTK.Graphics;
namespace osu.Game.GameModes.Multiplayer

View File

@ -8,6 +8,7 @@ using System.Text;
using System.Threading.Tasks;
using OpenTK.Graphics;
using osu.Framework.GameModes;
using osu.Game.GameModes.Backgrounds;
namespace osu.Game.GameModes.Play
{

View File

@ -3,6 +3,7 @@
using System;
using System.Collections.Generic;
using osu.Game.GameModes.Backgrounds;
namespace osu.Game.GameModes.Play
{

View File

@ -7,6 +7,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using osu.Framework.GameModes;
using osu.Game.GameModes.Backgrounds;
using OpenTK.Graphics;
namespace osu.Game.GameModes.Play

View File

@ -70,6 +70,9 @@
<Compile Include="Beatmaps\Timing\TimingChange.cs" />
<Compile Include="Configuration\OsuConfigManager.cs" />
<Compile Include="GameModes\BackgroundMode.cs" />
<Compile Include="GameModes\Backgrounds\BackgroundModeCustom.cs" />
<Compile Include="GameModes\Backgrounds\BackgroundModeDefault.cs" />
<Compile Include="GameModes\Backgrounds\BackgroundModeEmpty.cs" />
<Compile Include="GameModes\Charts\ChartInfo.cs" />
<Compile Include="GameModes\Edit\Editor.cs" />
<Compile Include="GameModes\GameModeWhiteBox.cs" />