From 59bfc7abad4c043fcae479017ad46c258e897018 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Sat, 15 Apr 2017 04:53:37 +0900 Subject: [PATCH 01/45] Move statics to RulesetCollection to avoid conflicts later on. --- osu.Desktop.Tests/VisualTests.cs | 8 ++-- osu.Desktop.VisualTests/Program.cs | 8 ++-- osu.Desktop/Program.cs | 8 ++-- .../Beatmaps/Formats/OsuLegacyDecoderTest.cs | 2 +- .../Beatmaps/IO/ImportBeatmapTest.cs | 8 ++-- .../Beatmaps/IO/OszArchiveReaderTest.cs | 2 +- osu.Game/Beatmaps/Beatmap.cs | 2 +- osu.Game/Beatmaps/Drawables/DifficultyIcon.cs | 2 +- osu.Game/Database/ScoreDatabase.cs | 2 +- osu.Game/Modes/Ruleset.cs | 17 -------- osu.Game/Modes/RulesetCollection.cs | 41 +++++++++++++++++++ osu.Game/Overlays/Mods/ModSelectOverlay.cs | 2 +- osu.Game/Overlays/Options/OptionsFooter.cs | 2 +- osu.Game/Screens/Play/Player.cs | 2 +- osu.Game/Screens/Select/BeatmapInfoWedge.cs | 2 +- osu.Game/osu.Game.csproj | 1 + 16 files changed, 67 insertions(+), 42 deletions(-) create mode 100644 osu.Game/Modes/RulesetCollection.cs diff --git a/osu.Desktop.Tests/VisualTests.cs b/osu.Desktop.Tests/VisualTests.cs index 6519dbe917..36dce18b05 100644 --- a/osu.Desktop.Tests/VisualTests.cs +++ b/osu.Desktop.Tests/VisualTests.cs @@ -20,10 +20,10 @@ namespace osu.Desktop.Tests { using (var host = new HeadlessGameHost()) { - Ruleset.Register(new OsuRuleset()); - Ruleset.Register(new TaikoRuleset()); - Ruleset.Register(new ManiaRuleset()); - Ruleset.Register(new CatchRuleset()); + RulesetCollection.Register(typeof(OsuRuleset)); + RulesetCollection.Register(typeof(TaikoRuleset)); + RulesetCollection.Register(typeof(ManiaRuleset)); + RulesetCollection.Register(typeof(CatchRuleset)); host.Run(new AutomatedVisualTestGame()); } diff --git a/osu.Desktop.VisualTests/Program.cs b/osu.Desktop.VisualTests/Program.cs index fe1cdfd7f0..912034a927 100644 --- a/osu.Desktop.VisualTests/Program.cs +++ b/osu.Desktop.VisualTests/Program.cs @@ -21,10 +21,10 @@ namespace osu.Desktop.VisualTests using (GameHost host = Host.GetSuitableHost(@"osu")) { - Ruleset.Register(new OsuRuleset()); - Ruleset.Register(new TaikoRuleset()); - Ruleset.Register(new ManiaRuleset()); - Ruleset.Register(new CatchRuleset()); + RulesetCollection.Register(typeof(OsuRuleset)); + RulesetCollection.Register(typeof(TaikoRuleset)); + RulesetCollection.Register(typeof(ManiaRuleset)); + RulesetCollection.Register(typeof(CatchRuleset)); if (benchmark) host.Run(new AutomatedVisualTestGame()); diff --git a/osu.Desktop/Program.cs b/osu.Desktop/Program.cs index ddf58ac363..e9117cf533 100644 --- a/osu.Desktop/Program.cs +++ b/osu.Desktop/Program.cs @@ -41,10 +41,10 @@ namespace osu.Desktop } else { - Ruleset.Register(new OsuRuleset()); - Ruleset.Register(new TaikoRuleset()); - Ruleset.Register(new ManiaRuleset()); - Ruleset.Register(new CatchRuleset()); + RulesetCollection.Register(typeof(OsuRuleset)); + RulesetCollection.Register(typeof(TaikoRuleset)); + RulesetCollection.Register(typeof(ManiaRuleset)); + RulesetCollection.Register(typeof(CatchRuleset)); host.Run(new OsuGameDesktop(args)); } diff --git a/osu.Game.Tests/Beatmaps/Formats/OsuLegacyDecoderTest.cs b/osu.Game.Tests/Beatmaps/Formats/OsuLegacyDecoderTest.cs index 8183bc952e..59a5790bea 100644 --- a/osu.Game.Tests/Beatmaps/Formats/OsuLegacyDecoderTest.cs +++ b/osu.Game.Tests/Beatmaps/Formats/OsuLegacyDecoderTest.cs @@ -22,7 +22,7 @@ namespace osu.Game.Tests.Beatmaps.Formats public void SetUp() { OsuLegacyDecoder.Register(); - Ruleset.Register(new OsuRuleset()); + RulesetCollection.Register(typeof(OsuRuleset)); } [Test] diff --git a/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs b/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs index 5d15b43761..66ed27adbb 100644 --- a/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs +++ b/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs @@ -28,10 +28,10 @@ namespace osu.Game.Tests.Beatmaps.IO [OneTimeSetUp] public void SetUp() { - Ruleset.Register(new OsuRuleset()); - Ruleset.Register(new TaikoRuleset()); - Ruleset.Register(new ManiaRuleset()); - Ruleset.Register(new CatchRuleset()); + RulesetCollection.Register(typeof(OsuRuleset)); + RulesetCollection.Register(typeof(TaikoRuleset)); + RulesetCollection.Register(typeof(ManiaRuleset)); + RulesetCollection.Register(typeof(CatchRuleset)); } [Test] diff --git a/osu.Game.Tests/Beatmaps/IO/OszArchiveReaderTest.cs b/osu.Game.Tests/Beatmaps/IO/OszArchiveReaderTest.cs index b9c4cf780a..add00d8f4d 100644 --- a/osu.Game.Tests/Beatmaps/IO/OszArchiveReaderTest.cs +++ b/osu.Game.Tests/Beatmaps/IO/OszArchiveReaderTest.cs @@ -19,7 +19,7 @@ namespace osu.Game.Tests.Beatmaps.IO public void SetUp() { OszArchiveReader.Register(); - Ruleset.Register(new OsuRuleset()); + RulesetCollection.Register(typeof(OsuRuleset)); } [Test] diff --git a/osu.Game/Beatmaps/Beatmap.cs b/osu.Game/Beatmaps/Beatmap.cs index 5709bdc8c5..420b23eb62 100644 --- a/osu.Game/Beatmaps/Beatmap.cs +++ b/osu.Game/Beatmaps/Beatmap.cs @@ -54,7 +54,7 @@ namespace osu.Game.Beatmaps /// Calculates the star difficulty for this Beatmap. /// /// The star difficulty. - public double CalculateStarDifficulty() => Ruleset.GetRuleset(BeatmapInfo.Mode).CreateDifficultyCalculator(this).Calculate(); + public double CalculateStarDifficulty() => RulesetCollection.GetRuleset(BeatmapInfo.Mode).CreateDifficultyCalculator(this).Calculate(); /// /// Constructs a new beatmap. diff --git a/osu.Game/Beatmaps/Drawables/DifficultyIcon.cs b/osu.Game/Beatmaps/Drawables/DifficultyIcon.cs index 47ae4d7985..3fb5194382 100644 --- a/osu.Game/Beatmaps/Drawables/DifficultyIcon.cs +++ b/osu.Game/Beatmaps/Drawables/DifficultyIcon.cs @@ -45,7 +45,7 @@ namespace osu.Game.Beatmaps.Drawables Origin = Anchor.Centre, TextSize = Size.X, Colour = Color4.White, - Icon = Ruleset.GetRuleset(beatmap.Mode).Icon + Icon = RulesetCollection.GetRuleset((int)beatmap.Mode).Icon } }; } diff --git a/osu.Game/Database/ScoreDatabase.cs b/osu.Game/Database/ScoreDatabase.cs index 642bb4aff6..e602b2373e 100644 --- a/osu.Game/Database/ScoreDatabase.cs +++ b/osu.Game/Database/ScoreDatabase.cs @@ -39,7 +39,7 @@ namespace osu.Game.Database using (Stream s = storage.GetStream(Path.Combine(replay_folder, replayFilename))) using (SerializationReader sr = new SerializationReader(s)) { - var ruleset = Ruleset.GetRuleset((PlayMode)sr.ReadByte()); + var ruleset = RulesetCollection.GetRuleset((PlayMode)sr.ReadByte()); score = ruleset.CreateScoreProcessor().CreateScore(); /* score.Pass = true;*/ diff --git a/osu.Game/Modes/Ruleset.cs b/osu.Game/Modes/Ruleset.cs index c97420fbe3..42f2fe789f 100644 --- a/osu.Game/Modes/Ruleset.cs +++ b/osu.Game/Modes/Ruleset.cs @@ -22,10 +22,6 @@ namespace osu.Game.Modes public abstract class Ruleset { - private static readonly ConcurrentDictionary available_rulesets = new ConcurrentDictionary(); - - public static IEnumerable PlayModes => available_rulesets.Keys; - public virtual IEnumerable GetBeatmapStatistics(WorkingBeatmap beatmap) => new BeatmapStatistic[] { }; public abstract IEnumerable GetModsFor(ModType type); @@ -36,8 +32,6 @@ namespace osu.Game.Modes public abstract ScoreProcessor CreateScoreProcessor(); - public static void Register(Ruleset ruleset) => available_rulesets.TryAdd(ruleset.PlayMode, ruleset.GetType()); - protected abstract PlayMode PlayMode { get; } public virtual FontAwesome Icon => FontAwesome.fa_question_circle; @@ -45,16 +39,5 @@ namespace osu.Game.Modes public abstract string Description { get; } public abstract IEnumerable CreateGameplayKeys(); - - public static Ruleset GetRuleset(PlayMode mode) - { - Type type; - - if (!available_rulesets.TryGetValue(mode, out type)) - return null; - - return Activator.CreateInstance(type) as Ruleset; - } - } } diff --git a/osu.Game/Modes/RulesetCollection.cs b/osu.Game/Modes/RulesetCollection.cs new file mode 100644 index 0000000000..95d0df4e6a --- /dev/null +++ b/osu.Game/Modes/RulesetCollection.cs @@ -0,0 +1,41 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; + +namespace osu.Game.Modes +{ + public static class RulesetCollection + { + private static readonly ConcurrentDictionary available_rulesets = new ConcurrentDictionary(); + + public static void Register(Type type) + { + Ruleset ruleset = Activator.CreateInstance(type) as Ruleset; + + if (ruleset == null) + return; + + available_rulesets.TryAdd(available_rulesets.Count, ruleset); + } + + public static Ruleset GetRuleset(PlayMode playMode) + { + return GetRuleset((int)playMode); + } + + public static Ruleset GetRuleset(int rulesetId) + { + Ruleset ruleset; + + if (!available_rulesets.TryGetValue(rulesetId, out ruleset)) + throw new InvalidOperationException($"Ruleset id {rulesetId} doesn't exist. How did you trigger this?"); + + return ruleset; + } + + public static IEnumerable AllRulesets => available_rulesets.Values; + } +} diff --git a/osu.Game/Overlays/Mods/ModSelectOverlay.cs b/osu.Game/Overlays/Mods/ModSelectOverlay.cs index 2b9f8e86a9..7a21b36da9 100644 --- a/osu.Game/Overlays/Mods/ModSelectOverlay.cs +++ b/osu.Game/Overlays/Mods/ModSelectOverlay.cs @@ -41,7 +41,7 @@ namespace osu.Game.Overlays.Mods private void modeChanged(PlayMode newMode) { - var ruleset = Ruleset.GetRuleset(newMode); + var ruleset = RulesetCollection.GetRuleset(newMode); foreach (ModSection section in modSectionsContainer.Children) section.Buttons = ruleset.GetModsFor(section.ModType).Select(m => new ModButton(m)).ToArray(); refreshSelectedMods(); diff --git a/osu.Game/Overlays/Options/OptionsFooter.cs b/osu.Game/Overlays/Options/OptionsFooter.cs index c42fe42428..fde4d8a925 100644 --- a/osu.Game/Overlays/Options/OptionsFooter.cs +++ b/osu.Game/Overlays/Options/OptionsFooter.cs @@ -30,7 +30,7 @@ namespace osu.Game.Overlays.Options foreach (PlayMode m in Enum.GetValues(typeof(PlayMode))) modes.Add(new TextAwesome { - Icon = Ruleset.GetRuleset(m).Icon, + Icon = RulesetCollection.GetRuleset(m).Icon, Colour = Color4.Gray, TextSize = 20 }); diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index fa564cdd61..e43eb6cd73 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -109,7 +109,7 @@ namespace osu.Game.Screens.Play sourceClock.Reset(); }); - ruleset = Ruleset.GetRuleset(Beatmap.PlayMode); + ruleset = RulesetCollection.GetRuleset(Beatmap.PlayMode); HitRenderer = ruleset.CreateHitRendererWith(Beatmap); scoreProcessor = HitRenderer.CreateScoreProcessor(); diff --git a/osu.Game/Screens/Select/BeatmapInfoWedge.cs b/osu.Game/Screens/Select/BeatmapInfoWedge.cs index 768cef4645..586100c47d 100644 --- a/osu.Game/Screens/Select/BeatmapInfoWedge.cs +++ b/osu.Game/Screens/Select/BeatmapInfoWedge.cs @@ -100,7 +100,7 @@ namespace osu.Game.Screens.Select })); //get statistics fromt he current ruleset. - labels.AddRange(Ruleset.GetRuleset(beatmap.BeatmapInfo.Mode).GetBeatmapStatistics(beatmap).Select(s => new InfoLabel(s))); + labels.AddRange(RulesetCollection.GetRuleset(beatmap.BeatmapInfo.Mode).GetBeatmapStatistics(beatmap).Select(s => new InfoLabel(s))); } AlwaysPresent = true; diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index f810eeec96..b89f7a3b65 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -131,6 +131,7 @@ + From a89af273be58b7b7388ef34edd9ad999d97e2cea Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Sat, 15 Apr 2017 05:01:36 +0900 Subject: [PATCH 02/45] Make BeatmapInfo expose Ruleset instead of PlayMode. --- osu.Desktop.VisualTests/Tests/TestCasePlaySongSelect.cs | 7 +++---- osu.Desktop.VisualTests/Tests/TestCasePlayer.cs | 4 ++-- osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs | 2 +- osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs | 2 +- osu.Game/Beatmaps/WorkingBeatmap.cs | 2 +- osu.Game/Database/BeatmapInfo.cs | 5 ++++- osu.Game/Screens/Play/Player.cs | 2 +- osu.Game/Screens/Select/FilterCriteria.cs | 2 +- 8 files changed, 14 insertions(+), 12 deletions(-) diff --git a/osu.Desktop.VisualTests/Tests/TestCasePlaySongSelect.cs b/osu.Desktop.VisualTests/Tests/TestCasePlaySongSelect.cs index 1a43425dda..4047c4b95f 100644 --- a/osu.Desktop.VisualTests/Tests/TestCasePlaySongSelect.cs +++ b/osu.Desktop.VisualTests/Tests/TestCasePlaySongSelect.cs @@ -6,7 +6,6 @@ using osu.Desktop.VisualTests.Platform; using osu.Framework.Testing; using osu.Framework.MathUtils; using osu.Game.Database; -using osu.Game.Modes; using osu.Game.Screens.Select; using osu.Game.Screens.Select.Filter; @@ -72,7 +71,7 @@ namespace osu.Desktop.VisualTests.Tests new BeatmapInfo { OnlineBeatmapID = 1234 + i, - Mode = PlayMode.Osu, + Mode = 0, Path = "normal.osu", Version = "Normal", Difficulty = new BeatmapDifficulty @@ -83,7 +82,7 @@ namespace osu.Desktop.VisualTests.Tests new BeatmapInfo { OnlineBeatmapID = 1235 + i, - Mode = PlayMode.Osu, + Mode = 0, Path = "hard.osu", Version = "Hard", Difficulty = new BeatmapDifficulty @@ -94,7 +93,7 @@ namespace osu.Desktop.VisualTests.Tests new BeatmapInfo { OnlineBeatmapID = 1236 + i, - Mode = PlayMode.Osu, + Mode = 0, Path = "insane.osu", Version = "Insane", Difficulty = new BeatmapDifficulty diff --git a/osu.Desktop.VisualTests/Tests/TestCasePlayer.cs b/osu.Desktop.VisualTests/Tests/TestCasePlayer.cs index 624723ed35..2a9c31b2e9 100644 --- a/osu.Desktop.VisualTests/Tests/TestCasePlayer.cs +++ b/osu.Desktop.VisualTests/Tests/TestCasePlayer.cs @@ -9,12 +9,12 @@ using osu.Game.Beatmaps; using OpenTK; using osu.Framework.Graphics.Sprites; using osu.Game.Database; -using osu.Game.Modes; using osu.Game.Modes.Objects; using osu.Game.Modes.Osu.Objects; using osu.Game.Screens.Play; using OpenTK.Graphics; using osu.Desktop.VisualTests.Beatmaps; +using osu.Game.Modes.Osu; namespace osu.Desktop.VisualTests.Tests { @@ -37,7 +37,7 @@ namespace osu.Desktop.VisualTests.Tests WorkingBeatmap beatmap = null; - var beatmapInfo = db.Query().FirstOrDefault(b => b.Mode == PlayMode.Osu); + var beatmapInfo = db.Query().FirstOrDefault(b => b.Ruleset is OsuRuleset); if (beatmapInfo != null) beatmap = db.GetWorkingBeatmap(beatmapInfo); diff --git a/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs b/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs index 66ed27adbb..e110da59b9 100644 --- a/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs +++ b/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs @@ -166,7 +166,7 @@ namespace osu.Game.Tests.Beatmaps.IO Assert.IsTrue(set.Beatmaps.Count > 0); - var beatmap = osu.Dependencies.Get().GetWorkingBeatmap(set.Beatmaps.First(b => b.Mode == PlayMode.Osu))?.Beatmap; + var beatmap = osu.Dependencies.Get().GetWorkingBeatmap(set.Beatmaps.First(b => b.Ruleset is OsuRuleset))?.Beatmap; Assert.IsTrue(beatmap?.HitObjects.Count > 0); } diff --git a/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs b/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs index 35d81311d2..4e39b48f96 100644 --- a/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs +++ b/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs @@ -84,7 +84,7 @@ namespace osu.Game.Beatmaps.Formats beatmap.BeatmapInfo.StackLeniency = float.Parse(val, NumberFormatInfo.InvariantInfo); break; case @"Mode": - beatmap.BeatmapInfo.Mode = (PlayMode)int.Parse(val); + beatmap.BeatmapInfo.Mode = int.Parse(val); break; case @"LetterboxInBreaks": beatmap.BeatmapInfo.LetterboxInBreaks = int.Parse(val) == 1; diff --git a/osu.Game/Beatmaps/WorkingBeatmap.cs b/osu.Game/Beatmaps/WorkingBeatmap.cs index 5bea1d0986..dd0bdef3b7 100644 --- a/osu.Game/Beatmaps/WorkingBeatmap.cs +++ b/osu.Game/Beatmaps/WorkingBeatmap.cs @@ -24,7 +24,7 @@ namespace osu.Game.Beatmaps /// public PlayMode? PreferredPlayMode; - public PlayMode PlayMode => Beatmap?.BeatmapInfo?.Mode > PlayMode.Osu ? Beatmap.BeatmapInfo.Mode : PreferredPlayMode ?? PlayMode.Osu; + public PlayMode PlayMode => Beatmap?.BeatmapInfo?.Mode > (int)PlayMode.Osu ? (PlayMode)Beatmap.BeatmapInfo.Mode : PreferredPlayMode ?? PlayMode.Osu; public readonly Bindable> Mods = new Bindable>(); diff --git a/osu.Game/Database/BeatmapInfo.cs b/osu.Game/Database/BeatmapInfo.cs index 3e84825919..72ff078d9e 100644 --- a/osu.Game/Database/BeatmapInfo.cs +++ b/osu.Game/Database/BeatmapInfo.cs @@ -54,7 +54,10 @@ namespace osu.Game.Database public bool Countdown { get; set; } public float StackLeniency { get; set; } public bool SpecialStyle { get; set; } - public PlayMode Mode { get; set; } + + public int Mode { get; set; } + public Ruleset Ruleset => RulesetCollection.GetRuleset(Mode); + public bool LetterboxInBreaks { get; set; } public bool WidescreenStoryboard { get; set; } diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index e43eb6cd73..134400d531 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -63,7 +63,7 @@ namespace osu.Game.Screens.Play [BackgroundDependencyLoader] private void load(AudioManager audio, BeatmapDatabase beatmaps, OsuConfigManager config) { - if (Beatmap.Beatmap.BeatmapInfo?.Mode > PlayMode.Taiko) + if (Beatmap.Beatmap.BeatmapInfo?.Mode > (int)PlayMode.Taiko) { //we only support osu! mode for now because the hitobject parsing is crappy and needs a refactor. Exit(); diff --git a/osu.Game/Screens/Select/FilterCriteria.cs b/osu.Game/Screens/Select/FilterCriteria.cs index 2654129a44..19d3645e45 100644 --- a/osu.Game/Screens/Select/FilterCriteria.cs +++ b/osu.Game/Screens/Select/FilterCriteria.cs @@ -23,7 +23,7 @@ namespace osu.Game.Screens.Select { var set = g.BeatmapSet; - bool hasCurrentMode = set.Beatmaps.Any(bm => bm.Mode == Mode); + bool hasCurrentMode = set.Beatmaps.Any(bm => bm.Mode == (int)Mode); bool match = hasCurrentMode; From 0a1376c2db4bbdd1a2b667843f4ec0ffaf39537f Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Sat, 15 Apr 2017 05:22:41 +0900 Subject: [PATCH 03/45] Remove PlayMode game-wide. --- .../Tests/TestCaseModSelectOverlay.cs | 7 +++---- osu.Game.Modes.Catch/CatchRuleset.cs | 2 -- osu.Game.Modes.Mania/ManiaRuleset.cs | 2 -- osu.Game.Modes.Osu/OsuRuleset.cs | 2 -- osu.Game.Modes.Taiko/TaikoRuleset.cs | 2 -- .../Beatmaps/Formats/OsuLegacyDecoderTest.cs | 2 +- osu.Game/Beatmaps/WorkingBeatmap.cs | 8 -------- osu.Game/Configuration/OsuConfigManager.cs | 4 +--- osu.Game/Database/ScoreDatabase.cs | 2 +- osu.Game/Modes/PlayMode.cs | 13 ------------- osu.Game/Modes/Ruleset.cs | 2 -- osu.Game/Modes/RulesetCollection.cs | 5 ----- osu.Game/OsuGame.cs | 11 ++++++----- osu.Game/Overlays/Mods/ModSelectOverlay.cs | 13 ++++++------- osu.Game/Overlays/Options/OptionsFooter.cs | 6 ++++-- osu.Game/Overlays/Toolbar/Toolbar.cs | 8 ++++---- osu.Game/Overlays/Toolbar/ToolbarModeButton.cs | 14 +++++++------- osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs | 14 +++++++------- osu.Game/Screens/Play/Player.cs | 9 +-------- osu.Game/Screens/Select/FilterControl.cs | 11 ++++++----- osu.Game/Screens/Select/FilterCriteria.cs | 4 ++-- osu.Game/Screens/Select/SongSelect.cs | 7 +++---- osu.Game/osu.Game.csproj | 1 - 23 files changed, 52 insertions(+), 97 deletions(-) delete mode 100644 osu.Game/Modes/PlayMode.cs diff --git a/osu.Desktop.VisualTests/Tests/TestCaseModSelectOverlay.cs b/osu.Desktop.VisualTests/Tests/TestCaseModSelectOverlay.cs index 7677682ac8..c569f5f64a 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseModSelectOverlay.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseModSelectOverlay.cs @@ -26,10 +26,9 @@ namespace osu.Desktop.VisualTests.Tests }); AddStep("Toggle", modSelect.ToggleVisibility); - AddStep("osu!", () => modSelect.PlayMode.Value = PlayMode.Osu); - AddStep("osu!taiko", () => modSelect.PlayMode.Value = PlayMode.Taiko); - AddStep("osu!catch", () => modSelect.PlayMode.Value = PlayMode.Catch); - AddStep("osu!mania", () => modSelect.PlayMode.Value = PlayMode.Mania); + + foreach (var ruleset in RulesetCollection.AllRulesets) + AddStep(ruleset.Description, () => modSelect.Ruleset.Value = ruleset); } } } diff --git a/osu.Game.Modes.Catch/CatchRuleset.cs b/osu.Game.Modes.Catch/CatchRuleset.cs index 09d8bdb9e5..02c170d0ac 100644 --- a/osu.Game.Modes.Catch/CatchRuleset.cs +++ b/osu.Game.Modes.Catch/CatchRuleset.cs @@ -76,8 +76,6 @@ namespace osu.Game.Modes.Catch } } - protected override PlayMode PlayMode => PlayMode.Catch; - public override string Description => "osu!catch"; public override FontAwesome Icon => FontAwesome.fa_osu_fruits_o; diff --git a/osu.Game.Modes.Mania/ManiaRuleset.cs b/osu.Game.Modes.Mania/ManiaRuleset.cs index bd995d87d6..7d25ea93c9 100644 --- a/osu.Game.Modes.Mania/ManiaRuleset.cs +++ b/osu.Game.Modes.Mania/ManiaRuleset.cs @@ -96,8 +96,6 @@ namespace osu.Game.Modes.Mania } } - protected override PlayMode PlayMode => PlayMode.Mania; - public override string Description => "osu!mania"; public override FontAwesome Icon => FontAwesome.fa_osu_mania_o; diff --git a/osu.Game.Modes.Osu/OsuRuleset.cs b/osu.Game.Modes.Osu/OsuRuleset.cs index 12df7d3f3c..6ca19bb5bb 100644 --- a/osu.Game.Modes.Osu/OsuRuleset.cs +++ b/osu.Game.Modes.Osu/OsuRuleset.cs @@ -99,8 +99,6 @@ namespace osu.Game.Modes.Osu public override DifficultyCalculator CreateDifficultyCalculator(Beatmap beatmap) => new OsuDifficultyCalculator(beatmap); - protected override PlayMode PlayMode => PlayMode.Osu; - public override string Description => "osu!"; public override IEnumerable CreateGameplayKeys() => new KeyCounter[] diff --git a/osu.Game.Modes.Taiko/TaikoRuleset.cs b/osu.Game.Modes.Taiko/TaikoRuleset.cs index 1b3c3fc0eb..e88b50bb95 100644 --- a/osu.Game.Modes.Taiko/TaikoRuleset.cs +++ b/osu.Game.Modes.Taiko/TaikoRuleset.cs @@ -76,8 +76,6 @@ namespace osu.Game.Modes.Taiko } } - protected override PlayMode PlayMode => PlayMode.Taiko; - public override string Description => "osu!taiko"; public override FontAwesome Icon => FontAwesome.fa_osu_taiko_o; diff --git a/osu.Game.Tests/Beatmaps/Formats/OsuLegacyDecoderTest.cs b/osu.Game.Tests/Beatmaps/Formats/OsuLegacyDecoderTest.cs index 59a5790bea..9d783c7e91 100644 --- a/osu.Game.Tests/Beatmaps/Formats/OsuLegacyDecoderTest.cs +++ b/osu.Game.Tests/Beatmaps/Formats/OsuLegacyDecoderTest.cs @@ -58,7 +58,7 @@ namespace osu.Game.Tests.Beatmaps.Formats Assert.AreEqual(false, beatmapInfo.Countdown); Assert.AreEqual(0.7f, beatmapInfo.StackLeniency); Assert.AreEqual(false, beatmapInfo.SpecialStyle); - Assert.AreEqual(PlayMode.Osu, beatmapInfo.Mode); + Assert.IsTrue(beatmapInfo.Ruleset is OsuRuleset); Assert.AreEqual(false, beatmapInfo.LetterboxInBreaks); Assert.AreEqual(false, beatmapInfo.WidescreenStoryboard); } diff --git a/osu.Game/Beatmaps/WorkingBeatmap.cs b/osu.Game/Beatmaps/WorkingBeatmap.cs index dd0bdef3b7..47f31ddffc 100644 --- a/osu.Game/Beatmaps/WorkingBeatmap.cs +++ b/osu.Game/Beatmaps/WorkingBeatmap.cs @@ -18,14 +18,6 @@ namespace osu.Game.Beatmaps public readonly BeatmapSetInfo BeatmapSetInfo; - /// - /// A play mode that is preferred for this beatmap. PlayMode will become this mode where conversion is feasible, - /// or otherwise to the beatmap's default. - /// - public PlayMode? PreferredPlayMode; - - public PlayMode PlayMode => Beatmap?.BeatmapInfo?.Mode > (int)PlayMode.Osu ? (PlayMode)Beatmap.BeatmapInfo.Mode : PreferredPlayMode ?? PlayMode.Osu; - public readonly Bindable> Mods = new Bindable>(); public readonly bool WithStoryboard; diff --git a/osu.Game/Configuration/OsuConfigManager.cs b/osu.Game/Configuration/OsuConfigManager.cs index e2f33479c0..2f37717286 100644 --- a/osu.Game/Configuration/OsuConfigManager.cs +++ b/osu.Game/Configuration/OsuConfigManager.cs @@ -17,8 +17,6 @@ namespace osu.Game.Configuration Set(OsuConfig.Username, string.Empty); Set(OsuConfig.Token, string.Empty); - Set(OsuConfig.PlayMode, PlayMode.Osu); - Set(OsuConfig.AudioDevice, string.Empty); Set(OsuConfig.SavePassword, false); Set(OsuConfig.SaveUsername, true); @@ -196,7 +194,7 @@ namespace osu.Game.Configuration public enum OsuConfig { // New osu: - PlayMode, + Ruleset, Token, // Imported from old osu: BeatmapDirectory, diff --git a/osu.Game/Database/ScoreDatabase.cs b/osu.Game/Database/ScoreDatabase.cs index e602b2373e..3b5c0575d5 100644 --- a/osu.Game/Database/ScoreDatabase.cs +++ b/osu.Game/Database/ScoreDatabase.cs @@ -39,7 +39,7 @@ namespace osu.Game.Database using (Stream s = storage.GetStream(Path.Combine(replay_folder, replayFilename))) using (SerializationReader sr = new SerializationReader(s)) { - var ruleset = RulesetCollection.GetRuleset((PlayMode)sr.ReadByte()); + var ruleset = RulesetCollection.GetRuleset((int)sr.ReadByte()); score = ruleset.CreateScoreProcessor().CreateScore(); /* score.Pass = true;*/ diff --git a/osu.Game/Modes/PlayMode.cs b/osu.Game/Modes/PlayMode.cs deleted file mode 100644 index fa6d94a650..0000000000 --- a/osu.Game/Modes/PlayMode.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - -namespace osu.Game.Modes -{ - public enum PlayMode - { - Osu = 0, - Taiko = 1, - Catch = 2, - Mania = 3 - } -} diff --git a/osu.Game/Modes/Ruleset.cs b/osu.Game/Modes/Ruleset.cs index 42f2fe789f..9a5099c675 100644 --- a/osu.Game/Modes/Ruleset.cs +++ b/osu.Game/Modes/Ruleset.cs @@ -32,8 +32,6 @@ namespace osu.Game.Modes public abstract ScoreProcessor CreateScoreProcessor(); - protected abstract PlayMode PlayMode { get; } - public virtual FontAwesome Icon => FontAwesome.fa_question_circle; public abstract string Description { get; } diff --git a/osu.Game/Modes/RulesetCollection.cs b/osu.Game/Modes/RulesetCollection.cs index 95d0df4e6a..a8cb8f8e26 100644 --- a/osu.Game/Modes/RulesetCollection.cs +++ b/osu.Game/Modes/RulesetCollection.cs @@ -21,11 +21,6 @@ namespace osu.Game.Modes available_rulesets.TryAdd(available_rulesets.Count, ruleset); } - public static Ruleset GetRuleset(PlayMode playMode) - { - return GetRuleset((int)playMode); - } - public static Ruleset GetRuleset(int rulesetId) { Ruleset ruleset; diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index ccea6ef458..44c1188ab3 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -58,7 +58,7 @@ namespace osu.Game private VolumeControl volume; - public Bindable PlayMode; + public Bindable Ruleset; private readonly string[] args; @@ -88,7 +88,8 @@ namespace osu.Game Dependencies.Cache(this); - PlayMode = LocalConfig.GetBindable(OsuConfig.PlayMode); + // Todo: I don't think this'll work, need BindableRuleset + Ruleset = new Bindable(); } private ScheduledDelegate scoreLoad; @@ -199,11 +200,11 @@ namespace osu.Game { Depth = -3, OnHome = delegate { intro?.ChildScreen?.MakeCurrent(); }, - OnPlayModeChange = m => PlayMode.Value = m, + OnRulesetChange = r => Ruleset.Value = r, }, t => { - PlayMode.ValueChanged += delegate { Toolbar.SetGameMode(PlayMode.Value); }; - PlayMode.TriggerChange(); + Ruleset.ValueChanged += delegate { Toolbar.SetGameMode(Ruleset.Value); }; + Ruleset.TriggerChange(); overlayContent.Add(Toolbar); }); diff --git a/osu.Game/Overlays/Mods/ModSelectOverlay.cs b/osu.Game/Overlays/Mods/ModSelectOverlay.cs index 7a21b36da9..5041ab237c 100644 --- a/osu.Game/Overlays/Mods/ModSelectOverlay.cs +++ b/osu.Game/Overlays/Mods/ModSelectOverlay.cs @@ -37,13 +37,12 @@ namespace osu.Game.Overlays.Mods public readonly Bindable> SelectedMods = new Bindable>(); - public readonly Bindable PlayMode = new Bindable(); + public readonly Bindable Ruleset = new Bindable(); - private void modeChanged(PlayMode newMode) + private void rulesetChanged(Ruleset newRuleset) { - var ruleset = RulesetCollection.GetRuleset(newMode); foreach (ModSection section in modSectionsContainer.Children) - section.Buttons = ruleset.GetModsFor(section.ModType).Select(m => new ModButton(m)).ToArray(); + section.Buttons = newRuleset.GetModsFor(section.ModType).Select(m => new ModButton(m)).ToArray(); refreshSelectedMods(); } @@ -54,9 +53,9 @@ namespace osu.Game.Overlays.Mods highMultiplierColour = colours.Green; if (osu != null) - PlayMode.BindTo(osu.PlayMode); - PlayMode.ValueChanged += modeChanged; - PlayMode.TriggerChange(); + Ruleset.BindTo(osu.Ruleset); + Ruleset.ValueChanged += rulesetChanged; + Ruleset.TriggerChange(); } protected override void PopOut() diff --git a/osu.Game/Overlays/Options/OptionsFooter.cs b/osu.Game/Overlays/Options/OptionsFooter.cs index fde4d8a925..d68fe18f36 100644 --- a/osu.Game/Overlays/Options/OptionsFooter.cs +++ b/osu.Game/Overlays/Options/OptionsFooter.cs @@ -27,13 +27,15 @@ namespace osu.Game.Overlays.Options var modes = new List(); - foreach (PlayMode m in Enum.GetValues(typeof(PlayMode))) + foreach (var ruleset in RulesetCollection.AllRulesets) + { modes.Add(new TextAwesome { - Icon = RulesetCollection.GetRuleset(m).Icon, + Icon = ruleset.Icon, Colour = Color4.Gray, TextSize = 20 }); + } Children = new Drawable[] { diff --git a/osu.Game/Overlays/Toolbar/Toolbar.cs b/osu.Game/Overlays/Toolbar/Toolbar.cs index 9e7b4f1519..ec76a37e6e 100644 --- a/osu.Game/Overlays/Toolbar/Toolbar.cs +++ b/osu.Game/Overlays/Toolbar/Toolbar.cs @@ -20,7 +20,7 @@ namespace osu.Game.Overlays.Toolbar public const float TOOLTIP_HEIGHT = 30; public Action OnHome; - public Action OnPlayModeChange; + public Action OnRulesetChange; private readonly ToolbarModeSelector modeSelector; private readonly ToolbarUserArea userArea; @@ -55,9 +55,9 @@ namespace osu.Game.Overlays.Toolbar }, modeSelector = new ToolbarModeSelector { - OnPlayModeChange = mode => + OnRulesetChange = mode => { - OnPlayModeChange?.Invoke(mode); + OnRulesetChange?.Invoke(mode); } } } @@ -129,7 +129,7 @@ namespace osu.Game.Overlays.Toolbar } } - public void SetGameMode(PlayMode mode) => modeSelector.SetGameMode(mode); + public void SetGameMode(Ruleset ruleset) => modeSelector.SetGameMode(ruleset); protected override void PopIn() { diff --git a/osu.Game/Overlays/Toolbar/ToolbarModeButton.cs b/osu.Game/Overlays/Toolbar/ToolbarModeButton.cs index 62359b05ae..6ace90bcb4 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarModeButton.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarModeButton.cs @@ -9,16 +9,16 @@ namespace osu.Game.Overlays.Toolbar { public class ToolbarModeButton : ToolbarButton { - private PlayMode mode; - public PlayMode Mode + private Ruleset ruleset; + public Ruleset Ruleset { - get { return mode; } + get { return ruleset; } set { - mode = value; - TooltipMain = Ruleset.GetRuleset(mode).Description; - TooltipSub = $"Play some {Ruleset.GetRuleset(mode).Description}"; - Icon = Ruleset.GetRuleset(mode).Icon; + ruleset = value; + TooltipMain = ruleset.Description; + TooltipSub = $"Play some {ruleset.Description}"; + Icon = ruleset.Icon; } } diff --git a/osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs b/osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs index e117089166..0d673eb3fe 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs @@ -22,7 +22,7 @@ namespace osu.Game.Overlays.Toolbar private readonly Drawable modeButtonLine; private ToolbarModeButton activeButton; - public Action OnPlayModeChange; + public Action OnRulesetChange; public ToolbarModeSelector() { @@ -63,15 +63,15 @@ namespace osu.Game.Overlays.Toolbar } }; - foreach (PlayMode m in Ruleset.PlayModes) + foreach (var ruleset in RulesetCollection.AllRulesets) { modeButtons.Add(new ToolbarModeButton { - Mode = m, + Ruleset = ruleset, Action = delegate { - SetGameMode(m); - OnPlayModeChange?.Invoke(m); + SetGameMode(ruleset); + OnRulesetChange?.Invoke(ruleset); } }); } @@ -84,11 +84,11 @@ namespace osu.Game.Overlays.Toolbar Size = new Vector2(modeButtons.DrawSize.X, 1); } - public void SetGameMode(PlayMode mode) + public void SetGameMode(Ruleset ruleset) { foreach (ToolbarModeButton m in modeButtons.Children.Cast()) { - bool isActive = m.Mode == mode; + bool isActive = m.Ruleset == ruleset; m.Active = isActive; if (isActive) activeButton = m; diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 134400d531..2887e7fa70 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -63,13 +63,6 @@ namespace osu.Game.Screens.Play [BackgroundDependencyLoader] private void load(AudioManager audio, BeatmapDatabase beatmaps, OsuConfigManager config) { - if (Beatmap.Beatmap.BeatmapInfo?.Mode > (int)PlayMode.Taiko) - { - //we only support osu! mode for now because the hitobject parsing is crappy and needs a refactor. - Exit(); - return; - } - dimLevel = config.GetBindable(OsuConfig.DimLevel); mouseWheelDisabled = config.GetBindable(OsuConfig.MouseDisableWheel); @@ -109,7 +102,7 @@ namespace osu.Game.Screens.Play sourceClock.Reset(); }); - ruleset = RulesetCollection.GetRuleset(Beatmap.PlayMode); + ruleset = Beatmap.BeatmapInfo.Ruleset; HitRenderer = ruleset.CreateHitRendererWith(Beatmap); scoreProcessor = HitRenderer.CreateScoreProcessor(); diff --git a/osu.Game/Screens/Select/FilterControl.cs b/osu.Game/Screens/Select/FilterControl.cs index 7596af1484..b2c53c9126 100644 --- a/osu.Game/Screens/Select/FilterControl.cs +++ b/osu.Game/Screens/Select/FilterControl.cs @@ -61,7 +61,7 @@ namespace osu.Game.Screens.Select Group = group, Sort = sort, SearchText = searchTextBox.Text, - Mode = playMode + Ruleset = ruleset }; public Action Exit; @@ -163,16 +163,17 @@ namespace osu.Game.Screens.Select searchTextBox.HoldFocus = true; } - private readonly Bindable playMode = new Bindable(); + private readonly Bindable ruleset = new Bindable(); [BackgroundDependencyLoader(permitNulls:true)] private void load(OsuColour colours, OsuGame osu) { sortTabs.AccentColour = colours.GreenLight; - if (osu != null) playMode.BindTo(osu.PlayMode); - playMode.ValueChanged += val => FilterChanged?.Invoke(CreateCriteria()); - playMode.TriggerChange(); + if (osu != null) + ruleset.BindTo(osu.Ruleset); + ruleset.ValueChanged += val => FilterChanged?.Invoke(CreateCriteria()); + ruleset.TriggerChange(); } protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) => true; diff --git a/osu.Game/Screens/Select/FilterCriteria.cs b/osu.Game/Screens/Select/FilterCriteria.cs index 19d3645e45..0b750ef8d3 100644 --- a/osu.Game/Screens/Select/FilterCriteria.cs +++ b/osu.Game/Screens/Select/FilterCriteria.cs @@ -15,7 +15,7 @@ namespace osu.Game.Screens.Select public GroupMode Group; public SortMode Sort; public string SearchText; - public PlayMode Mode; + public Ruleset Ruleset; public void Filter(List groups) { @@ -23,7 +23,7 @@ namespace osu.Game.Screens.Select { var set = g.BeatmapSet; - bool hasCurrentMode = set.Beatmaps.Any(bm => bm.Mode == (int)Mode); + bool hasCurrentMode = set.Beatmaps.Any(bm => bm.Ruleset == Ruleset); bool match = hasCurrentMode; diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index 3e8ddc0f64..f25d3d4df9 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -29,7 +29,7 @@ namespace osu.Game.Screens.Select { public abstract class SongSelect : OsuScreen { - private readonly Bindable playMode = new Bindable(); + private readonly Bindable ruleset = new Bindable(); private BeatmapDatabase database; protected override BackgroundScreen CreateBackground() => new BackgroundScreenBeatmap(Beatmap); @@ -170,8 +170,8 @@ namespace osu.Game.Screens.Select if (database == null) database = beatmaps; - playMode.ValueChanged += val => { if (Beatmap != null) Beatmap.PreferredPlayMode = val; }; - if (osu != null) playMode.BindTo(osu.PlayMode); + if (osu != null) + ruleset.BindTo(osu.Ruleset); database.BeatmapSetAdded += onBeatmapSetAdded; database.BeatmapSetRemoved += onBeatmapSetRemoved; @@ -200,7 +200,6 @@ namespace osu.Game.Screens.Select { if (Beatmap == null) return; - Beatmap.PreferredPlayMode = playMode.Value; OnSelected(); } diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index b89f7a3b65..7d20668f26 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -217,7 +217,6 @@ - From 6dbc75283cdc8261812620bf61c3388f358c3490 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Sat, 15 Apr 2017 05:52:46 +0900 Subject: [PATCH 04/45] Re-implement config value. --- osu.Game/Configuration/OsuConfigManager.cs | 2 ++ osu.Game/Modes/RulesetCollection.cs | 3 +++ osu.Game/OsuGame.cs | 8 +++++--- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/osu.Game/Configuration/OsuConfigManager.cs b/osu.Game/Configuration/OsuConfigManager.cs index 2f37717286..8e82406dee 100644 --- a/osu.Game/Configuration/OsuConfigManager.cs +++ b/osu.Game/Configuration/OsuConfigManager.cs @@ -17,6 +17,8 @@ namespace osu.Game.Configuration Set(OsuConfig.Username, string.Empty); Set(OsuConfig.Token, string.Empty); + Set(OsuConfig.Ruleset, 0, 0, int.MaxValue); + Set(OsuConfig.AudioDevice, string.Empty); Set(OsuConfig.SavePassword, false); Set(OsuConfig.SaveUsername, true); diff --git a/osu.Game/Modes/RulesetCollection.cs b/osu.Game/Modes/RulesetCollection.cs index a8cb8f8e26..d699bbfabe 100644 --- a/osu.Game/Modes/RulesetCollection.cs +++ b/osu.Game/Modes/RulesetCollection.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Concurrent; using System.Collections.Generic; +using System.Linq; namespace osu.Game.Modes { @@ -31,6 +32,8 @@ namespace osu.Game.Modes return ruleset; } + public static int GetId(Ruleset ruleset) => available_rulesets.First(kvp => kvp.Value == ruleset).Key; + public static IEnumerable AllRulesets => available_rulesets.Values; } } diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 44c1188ab3..3379787d6d 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -58,7 +58,8 @@ namespace osu.Game private VolumeControl volume; - public Bindable Ruleset; + private Bindable configRuleset; + public Bindable Ruleset = new Bindable(); private readonly string[] args; @@ -88,8 +89,9 @@ namespace osu.Game Dependencies.Cache(this); - // Todo: I don't think this'll work, need BindableRuleset - Ruleset = new Bindable(); + configRuleset = LocalConfig.GetBindable(OsuConfig.Ruleset); + Ruleset.Value = RulesetCollection.GetRuleset(configRuleset.Value); + Ruleset.ValueChanged += r => configRuleset.Value = RulesetCollection.GetId(r); } private ScheduledDelegate scoreLoad; From 3845ab2a72c91247d319c3ea9a366596f1aa5dcd Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Sat, 15 Apr 2017 05:55:38 +0900 Subject: [PATCH 05/45] Add comment. --- osu.Game/Screens/Play/Player.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 2887e7fa70..b59b3bf0c1 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -103,6 +103,9 @@ namespace osu.Game.Screens.Play }); ruleset = Beatmap.BeatmapInfo.Ruleset; + + // Todo: This should be done as early as possible, and should check if the hit renderer + // can actually convert the hit objects... Somehow... HitRenderer = ruleset.CreateHitRendererWith(Beatmap); scoreProcessor = HitRenderer.CreateScoreProcessor(); From 0333e1a05003d2f30ebba3ff288101c0e66b5b47 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Sat, 15 Apr 2017 05:57:18 +0900 Subject: [PATCH 06/45] Remove unused usings. --- osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs | 1 - osu.Game/Beatmaps/WorkingBeatmap.cs | 1 - osu.Game/Configuration/OsuConfigManager.cs | 1 - osu.Game/Modes/Ruleset.cs | 2 -- osu.Game/Overlays/Options/OptionsFooter.cs | 1 - 5 files changed, 6 deletions(-) diff --git a/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs b/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs index 4e39b48f96..36f025d1ff 100644 --- a/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs +++ b/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs @@ -7,7 +7,6 @@ using System.IO; using OpenTK.Graphics; using osu.Game.Beatmaps.Events; using osu.Game.Beatmaps.Timing; -using osu.Game.Modes; using osu.Game.Modes.Objects; using osu.Game.Beatmaps.Legacy; diff --git a/osu.Game/Beatmaps/WorkingBeatmap.cs b/osu.Game/Beatmaps/WorkingBeatmap.cs index 47f31ddffc..8ffec25882 100644 --- a/osu.Game/Beatmaps/WorkingBeatmap.cs +++ b/osu.Game/Beatmaps/WorkingBeatmap.cs @@ -5,7 +5,6 @@ using osu.Framework.Audio.Track; using osu.Framework.Configuration; using osu.Framework.Graphics.Textures; using osu.Game.Database; -using osu.Game.Modes; using osu.Game.Modes.Mods; using System; using System.Collections.Generic; diff --git a/osu.Game/Configuration/OsuConfigManager.cs b/osu.Game/Configuration/OsuConfigManager.cs index 8e82406dee..a31c1f882d 100644 --- a/osu.Game/Configuration/OsuConfigManager.cs +++ b/osu.Game/Configuration/OsuConfigManager.cs @@ -4,7 +4,6 @@ using System; using osu.Framework.Configuration; using osu.Framework.Platform; -using osu.Game.Modes; namespace osu.Game.Configuration { diff --git a/osu.Game/Modes/Ruleset.cs b/osu.Game/Modes/Ruleset.cs index 9a5099c675..284a71d518 100644 --- a/osu.Game/Modes/Ruleset.cs +++ b/osu.Game/Modes/Ruleset.cs @@ -6,8 +6,6 @@ using osu.Game.Graphics; using osu.Game.Modes.Mods; using osu.Game.Modes.UI; using osu.Game.Screens.Play; -using System; -using System.Collections.Concurrent; using System.Collections.Generic; using osu.Game.Modes.Scoring; diff --git a/osu.Game/Overlays/Options/OptionsFooter.cs b/osu.Game/Overlays/Options/OptionsFooter.cs index d68fe18f36..ad184c8838 100644 --- a/osu.Game/Overlays/Options/OptionsFooter.cs +++ b/osu.Game/Overlays/Options/OptionsFooter.cs @@ -1,7 +1,6 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System; using System.Collections.Generic; using osu.Framework.Allocation; using osu.Framework.Graphics; From 4a149c4ab80c0f435543691cf6c80b67315d2391 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Sat, 15 Apr 2017 06:14:31 +0900 Subject: [PATCH 07/45] Better default values + don't set Mode from outside. --- osu.Desktop.VisualTests/Tests/TestCasePlaySongSelect.cs | 7 ++++--- osu.Game/Database/BeatmapInfo.cs | 8 +++++++- osu.Game/Modes/RulesetCollection.cs | 9 ++++++--- osu.Game/Overlays/Mods/ModSelectOverlay.cs | 2 +- osu.Game/Screens/Select/FilterControl.cs | 2 +- osu.Game/Screens/Select/SongSelect.cs | 2 +- 6 files changed, 20 insertions(+), 10 deletions(-) diff --git a/osu.Desktop.VisualTests/Tests/TestCasePlaySongSelect.cs b/osu.Desktop.VisualTests/Tests/TestCasePlaySongSelect.cs index 4047c4b95f..c22726491d 100644 --- a/osu.Desktop.VisualTests/Tests/TestCasePlaySongSelect.cs +++ b/osu.Desktop.VisualTests/Tests/TestCasePlaySongSelect.cs @@ -8,6 +8,7 @@ using osu.Framework.MathUtils; using osu.Game.Database; using osu.Game.Screens.Select; using osu.Game.Screens.Select.Filter; +using osu.Game.Modes; namespace osu.Desktop.VisualTests.Tests { @@ -71,7 +72,7 @@ namespace osu.Desktop.VisualTests.Tests new BeatmapInfo { OnlineBeatmapID = 1234 + i, - Mode = 0, + Ruleset = RulesetCollection.GetRuleset(0), Path = "normal.osu", Version = "Normal", Difficulty = new BeatmapDifficulty @@ -82,7 +83,7 @@ namespace osu.Desktop.VisualTests.Tests new BeatmapInfo { OnlineBeatmapID = 1235 + i, - Mode = 0, + Ruleset = RulesetCollection.GetRuleset(0), Path = "hard.osu", Version = "Hard", Difficulty = new BeatmapDifficulty @@ -93,7 +94,7 @@ namespace osu.Desktop.VisualTests.Tests new BeatmapInfo { OnlineBeatmapID = 1236 + i, - Mode = 0, + Ruleset = RulesetCollection.GetRuleset(0), Path = "insane.osu", Version = "Insane", Difficulty = new BeatmapDifficulty diff --git a/osu.Game/Database/BeatmapInfo.cs b/osu.Game/Database/BeatmapInfo.cs index 72ff078d9e..be4faebde2 100644 --- a/osu.Game/Database/BeatmapInfo.cs +++ b/osu.Game/Database/BeatmapInfo.cs @@ -56,7 +56,13 @@ namespace osu.Game.Database public bool SpecialStyle { get; set; } public int Mode { get; set; } - public Ruleset Ruleset => RulesetCollection.GetRuleset(Mode); + + [Ignore] + public Ruleset Ruleset + { + get { return RulesetCollection.GetRuleset(Mode); } + set { Mode = RulesetCollection.GetId(value); } + } public bool LetterboxInBreaks { get; set; } public bool WidescreenStoryboard { get; set; } diff --git a/osu.Game/Modes/RulesetCollection.cs b/osu.Game/Modes/RulesetCollection.cs index d699bbfabe..221fa6f5ba 100644 --- a/osu.Game/Modes/RulesetCollection.cs +++ b/osu.Game/Modes/RulesetCollection.cs @@ -8,13 +8,16 @@ using System.Linq; namespace osu.Game.Modes { + /// + /// Todo: All of this needs to be moved to a RulesetDatabase. + /// public static class RulesetCollection { private static readonly ConcurrentDictionary available_rulesets = new ConcurrentDictionary(); public static void Register(Type type) { - Ruleset ruleset = Activator.CreateInstance(type) as Ruleset; + var ruleset = Activator.CreateInstance(type) as Ruleset; if (ruleset == null) return; @@ -25,9 +28,9 @@ namespace osu.Game.Modes public static Ruleset GetRuleset(int rulesetId) { Ruleset ruleset; - + if (!available_rulesets.TryGetValue(rulesetId, out ruleset)) - throw new InvalidOperationException($"Ruleset id {rulesetId} doesn't exist. How did you trigger this?"); + return null; return ruleset; } diff --git a/osu.Game/Overlays/Mods/ModSelectOverlay.cs b/osu.Game/Overlays/Mods/ModSelectOverlay.cs index 5041ab237c..02df95ff8a 100644 --- a/osu.Game/Overlays/Mods/ModSelectOverlay.cs +++ b/osu.Game/Overlays/Mods/ModSelectOverlay.cs @@ -37,7 +37,7 @@ namespace osu.Game.Overlays.Mods public readonly Bindable> SelectedMods = new Bindable>(); - public readonly Bindable Ruleset = new Bindable(); + public readonly Bindable Ruleset = new Bindable(RulesetCollection.GetRuleset(0)); private void rulesetChanged(Ruleset newRuleset) { diff --git a/osu.Game/Screens/Select/FilterControl.cs b/osu.Game/Screens/Select/FilterControl.cs index b2c53c9126..1e2f074939 100644 --- a/osu.Game/Screens/Select/FilterControl.cs +++ b/osu.Game/Screens/Select/FilterControl.cs @@ -163,7 +163,7 @@ namespace osu.Game.Screens.Select searchTextBox.HoldFocus = true; } - private readonly Bindable ruleset = new Bindable(); + private readonly Bindable ruleset = new Bindable(RulesetCollection.GetRuleset(0)); [BackgroundDependencyLoader(permitNulls:true)] private void load(OsuColour colours, OsuGame osu) diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index f25d3d4df9..183eb7de32 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -29,7 +29,7 @@ namespace osu.Game.Screens.Select { public abstract class SongSelect : OsuScreen { - private readonly Bindable ruleset = new Bindable(); + private readonly Bindable ruleset = new Bindable(RulesetCollection.GetRuleset(0)); private BeatmapDatabase database; protected override BackgroundScreen CreateBackground() => new BackgroundScreenBeatmap(Beatmap); From ddce3c157f084a80e9f72c702bb9f538f38e7f79 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Sat, 15 Apr 2017 06:15:55 +0900 Subject: [PATCH 08/45] Clean up a few remaining stragglers. --- osu.Game/Beatmaps/Beatmap.cs | 2 +- osu.Game/Beatmaps/Drawables/DifficultyIcon.cs | 2 +- osu.Game/Screens/Select/BeatmapInfoWedge.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game/Beatmaps/Beatmap.cs b/osu.Game/Beatmaps/Beatmap.cs index 420b23eb62..221cd5a37c 100644 --- a/osu.Game/Beatmaps/Beatmap.cs +++ b/osu.Game/Beatmaps/Beatmap.cs @@ -54,7 +54,7 @@ namespace osu.Game.Beatmaps /// Calculates the star difficulty for this Beatmap. /// /// The star difficulty. - public double CalculateStarDifficulty() => RulesetCollection.GetRuleset(BeatmapInfo.Mode).CreateDifficultyCalculator(this).Calculate(); + public double CalculateStarDifficulty() => BeatmapInfo.Ruleset.CreateDifficultyCalculator(this).Calculate(); /// /// Constructs a new beatmap. diff --git a/osu.Game/Beatmaps/Drawables/DifficultyIcon.cs b/osu.Game/Beatmaps/Drawables/DifficultyIcon.cs index 3fb5194382..252965fee5 100644 --- a/osu.Game/Beatmaps/Drawables/DifficultyIcon.cs +++ b/osu.Game/Beatmaps/Drawables/DifficultyIcon.cs @@ -45,7 +45,7 @@ namespace osu.Game.Beatmaps.Drawables Origin = Anchor.Centre, TextSize = Size.X, Colour = Color4.White, - Icon = RulesetCollection.GetRuleset((int)beatmap.Mode).Icon + Icon = beatmap.Ruleset.Icon } }; } diff --git a/osu.Game/Screens/Select/BeatmapInfoWedge.cs b/osu.Game/Screens/Select/BeatmapInfoWedge.cs index 586100c47d..775efd5a40 100644 --- a/osu.Game/Screens/Select/BeatmapInfoWedge.cs +++ b/osu.Game/Screens/Select/BeatmapInfoWedge.cs @@ -100,7 +100,7 @@ namespace osu.Game.Screens.Select })); //get statistics fromt he current ruleset. - labels.AddRange(RulesetCollection.GetRuleset(beatmap.BeatmapInfo.Mode).GetBeatmapStatistics(beatmap).Select(s => new InfoLabel(s))); + labels.AddRange(beatmap.BeatmapInfo.Ruleset.GetBeatmapStatistics(beatmap).Select(s => new InfoLabel(s))); } AlwaysPresent = true; From 83b083ce64c99c5c6e945533b2a8e213169a9017 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 17 Apr 2017 14:37:52 +0900 Subject: [PATCH 09/45] Move SQLite connections out of database classes; make abstract Database. --- .../Tests/TestCasePlaySongSelect.cs | 2 +- osu.Game/Beatmaps/Beatmap.cs | 1 - osu.Game/Beatmaps/Drawables/DifficultyIcon.cs | 1 - osu.Game/Database/BeatmapDatabase.cs | 110 +++++++----------- osu.Game/Database/Database.cs | 44 +++++++ osu.Game/Database/ScoreDatabase.cs | 15 ++- osu.Game/OsuGameBase.cs | 8 +- osu.Game/osu.Game.csproj | 1 + 8 files changed, 105 insertions(+), 77 deletions(-) create mode 100644 osu.Game/Database/Database.cs diff --git a/osu.Desktop.VisualTests/Tests/TestCasePlaySongSelect.cs b/osu.Desktop.VisualTests/Tests/TestCasePlaySongSelect.cs index c22726491d..dd17d62739 100644 --- a/osu.Desktop.VisualTests/Tests/TestCasePlaySongSelect.cs +++ b/osu.Desktop.VisualTests/Tests/TestCasePlaySongSelect.cs @@ -26,7 +26,7 @@ namespace osu.Desktop.VisualTests.Tests if (db == null) { storage = new TestStorage(@"TestCasePlaySongSelect"); - db = new BeatmapDatabase(storage); + db = new BeatmapDatabase(storage, storage.GetDatabase(@"client")); var sets = new List(); diff --git a/osu.Game/Beatmaps/Beatmap.cs b/osu.Game/Beatmaps/Beatmap.cs index 221cd5a37c..6099b1e115 100644 --- a/osu.Game/Beatmaps/Beatmap.cs +++ b/osu.Game/Beatmaps/Beatmap.cs @@ -4,7 +4,6 @@ using OpenTK.Graphics; using osu.Game.Beatmaps.Timing; using osu.Game.Database; -using osu.Game.Modes; using osu.Game.Modes.Objects; using System.Collections.Generic; diff --git a/osu.Game/Beatmaps/Drawables/DifficultyIcon.cs b/osu.Game/Beatmaps/Drawables/DifficultyIcon.cs index 252965fee5..02595df77a 100644 --- a/osu.Game/Beatmaps/Drawables/DifficultyIcon.cs +++ b/osu.Game/Beatmaps/Drawables/DifficultyIcon.cs @@ -6,7 +6,6 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Database; using osu.Game.Graphics; -using osu.Game.Modes; using OpenTK; using OpenTK.Graphics; diff --git a/osu.Game/Database/BeatmapDatabase.cs b/osu.Game/Database/BeatmapDatabase.cs index 41ddd8df39..9695ba8bd0 100644 --- a/osu.Game/Database/BeatmapDatabase.cs +++ b/osu.Game/Database/BeatmapDatabase.cs @@ -18,37 +18,19 @@ using SQLiteNetExtensions.Extensions; namespace osu.Game.Database { - public class BeatmapDatabase + public class BeatmapDatabase : Database { - private SQLiteConnection connection { get; } - private readonly Storage storage; + public event Action BeatmapSetAdded; public event Action BeatmapSetRemoved; // ReSharper disable once NotAccessedField.Local (we should keep a reference to this so it is not finalised) private BeatmapIPCChannel ipc; - public BeatmapDatabase(Storage storage, IIpcHost importHost = null) + public BeatmapDatabase(Storage storage, SQLiteConnection connection, IIpcHost importHost = null) : base(storage, connection) { - this.storage = storage; - if (importHost != null) ipc = new BeatmapIPCChannel(importHost, this); - - if (connection == null) - { - try - { - connection = prepareConnection(); - deletePending(); - } - catch (Exception e) - { - Logger.Error(e, @"Failed to initialise the beatmap database! Trying again with a clean database..."); - storage.DeleteDatabase(@"beatmaps"); - connection = prepareConnection(); - } - } } private void deletePending() @@ -57,20 +39,20 @@ namespace osu.Game.Database { try { - storage.Delete(b.Path); + Storage.Delete(b.Path); GetChildren(b, true); foreach (var i in b.Beatmaps) { - if (i.Metadata != null) connection.Delete(i.Metadata); - if (i.Difficulty != null) connection.Delete(i.Difficulty); + if (i.Metadata != null) Connection.Delete(i.Metadata); + if (i.Difficulty != null) Connection.Delete(i.Difficulty); - connection.Delete(i); + Connection.Delete(i); } - if (b.Metadata != null) connection.Delete(b.Metadata); - connection.Delete(b); + if (b.Metadata != null) Connection.Delete(b.Metadata); + Connection.Delete(b); } catch (Exception e) { @@ -80,41 +62,31 @@ namespace osu.Game.Database //this is required because sqlite migrations don't work, initially inserting nulls into this field. //see https://github.com/praeclarum/sqlite-net/issues/326 - connection.Query("UPDATE BeatmapSetInfo SET DeletePending = 0 WHERE DeletePending IS NULL"); + Connection.Query("UPDATE BeatmapSetInfo SET DeletePending = 0 WHERE DeletePending IS NULL"); } - private SQLiteConnection prepareConnection() + protected override void Prepare() { - var conn = storage.GetDatabase(@"beatmaps"); + Connection.CreateTable(); + Connection.CreateTable(); + Connection.CreateTable(); + Connection.CreateTable(); - try - { - conn.CreateTable(); - conn.CreateTable(); - conn.CreateTable(); - conn.CreateTable(); - } - catch - { - conn.Close(); - throw; - } - - return conn; + deletePending(); } - public void Reset() + public override void Reset() { foreach (var setInfo in Query()) { - if (storage.Exists(setInfo.Path)) - storage.Delete(setInfo.Path); + if (Storage.Exists(setInfo.Path)) + Storage.Delete(setInfo.Path); } - connection.DeleteAll(); - connection.DeleteAll(); - connection.DeleteAll(); - connection.DeleteAll(); + Connection.DeleteAll(); + Connection.DeleteAll(); + Connection.DeleteAll(); + Connection.DeleteAll(); } /// @@ -174,7 +146,7 @@ namespace osu.Game.Database BeatmapMetadata metadata; - using (var reader = ArchiveReader.GetReader(storage, path)) + using (var reader = ArchiveReader.GetReader(Storage, path)) { using (var stream = new StreamReader(reader.GetStream(reader.BeatmapFilenames[0]))) metadata = BeatmapDecoder.GetDecoder(stream).Decode(stream).Metadata; @@ -182,18 +154,18 @@ namespace osu.Game.Database if (File.Exists(path)) // Not always the case, i.e. for LegacyFilesystemReader { - using (var input = storage.GetStream(path)) + using (var input = Storage.GetStream(path)) { hash = input.GetMd5Hash(); input.Seek(0, SeekOrigin.Begin); path = Path.Combine(@"beatmaps", hash.Remove(1), hash.Remove(2), hash); - if (!storage.Exists(path)) - using (var output = storage.GetStream(path, FileAccess.Write)) + if (!Storage.Exists(path)) + using (var output = Storage.GetStream(path, FileAccess.Write)) input.CopyTo(output); } } - var existing = connection.Table().FirstOrDefault(b => b.Hash == hash); + var existing = Connection.Table().FirstOrDefault(b => b.Hash == hash); if (existing != null) { @@ -216,7 +188,7 @@ namespace osu.Game.Database Metadata = metadata }; - using (var archive = ArchiveReader.GetReader(storage, path)) + using (var archive = ArchiveReader.GetReader(Storage, path)) { string[] mapNames = archive.BeatmapFilenames; foreach (var name in mapNames) @@ -248,17 +220,17 @@ namespace osu.Game.Database public void Import(IEnumerable beatmapSets) { - lock (connection) + lock (Connection) { - connection.BeginTransaction(); + Connection.BeginTransaction(); foreach (var s in beatmapSets) { - connection.InsertWithChildren(s, true); + Connection.InsertWithChildren(s, true); BeatmapSetAdded?.Invoke(s); } - connection.Commit(); + Connection.Commit(); } } @@ -275,7 +247,7 @@ namespace osu.Game.Database if (string.IsNullOrEmpty(beatmapSet.Path)) return null; - return ArchiveReader.GetReader(storage, beatmapSet.Path); + return ArchiveReader.GetReader(Storage, beatmapSet.Path); } public BeatmapSetInfo GetBeatmapSet(int id) @@ -305,25 +277,25 @@ namespace osu.Game.Database public TableQuery Query() where T : class { - return connection.Table(); + return Connection.Table(); } public T GetWithChildren(object id) where T : class { - return connection.GetWithChildren(id); + return Connection.GetWithChildren(id); } public List GetAllWithChildren(Expression> filter = null, bool recursive = true) where T : class { - return connection.GetAllWithChildren(filter, recursive); + return Connection.GetAllWithChildren(filter, recursive); } public T GetChildren(T item, bool recursive = false) { if (item == null) return default(T); - connection.GetChildren(item, recursive); + Connection.GetChildren(item, recursive); return item; } @@ -339,11 +311,11 @@ namespace osu.Game.Database if (validTypes.All(t => t != typeof(T))) throw new ArgumentException("Must be a type managed by BeatmapDatabase", nameof(T)); if (cascade) - connection.UpdateWithChildren(record); + Connection.UpdateWithChildren(record); else - connection.Update(record); + Connection.Update(record); } - public bool Exists(BeatmapSetInfo beatmapSet) => storage.Exists(beatmapSet.Path); + public bool Exists(BeatmapSetInfo beatmapSet) => Storage.Exists(beatmapSet.Path); } } diff --git a/osu.Game/Database/Database.cs b/osu.Game/Database/Database.cs new file mode 100644 index 0000000000..6f8e902663 --- /dev/null +++ b/osu.Game/Database/Database.cs @@ -0,0 +1,44 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; +using osu.Framework.Logging; +using osu.Framework.Platform; +using SQLite.Net; + +namespace osu.Game.Database +{ + public abstract class Database + { + protected SQLiteConnection Connection { get; } + protected Storage Storage { get; } + + protected Database(Storage storage, SQLiteConnection connection) + { + Storage = storage; + Connection = connection; + + try + { + Prepare(); + } + catch (Exception e) + { + Logger.Error(e, @"Failed to initialise the beatmap database! Trying again with a clean database..."); + storage.DeleteDatabase(@"beatmaps"); + Reset(); + Prepare(); + } + } + + /// + /// Prepare this database for use. + /// + protected abstract void Prepare(); + + /// + /// Reset this database to a default state. Undo all changes to database and storage backings. + /// + public abstract void Reset(); + } +} \ No newline at end of file diff --git a/osu.Game/Database/ScoreDatabase.cs b/osu.Game/Database/ScoreDatabase.cs index 3b5c0575d5..240b4fa8e6 100644 --- a/osu.Game/Database/ScoreDatabase.cs +++ b/osu.Game/Database/ScoreDatabase.cs @@ -10,10 +10,11 @@ using osu.Game.IPC; using osu.Game.Modes; using osu.Game.Modes.Scoring; using SharpCompress.Compressors.LZMA; +using SQLite.Net; namespace osu.Game.Database { - public class ScoreDatabase + public class ScoreDatabase : Database { private readonly Storage storage; private readonly BeatmapDatabase beatmaps; @@ -23,7 +24,7 @@ namespace osu.Game.Database // ReSharper disable once NotAccessedField.Local (we should keep a reference to this so it is not finalised) private ScoreIPCChannel ipc; - public ScoreDatabase(Storage storage, IIpcHost importHost = null, BeatmapDatabase beatmaps = null) + public ScoreDatabase(Storage storage, SQLiteConnection connection, IIpcHost importHost = null, BeatmapDatabase beatmaps = null) : base(storage, connection) { this.storage = storage; this.beatmaps = beatmaps; @@ -39,7 +40,7 @@ namespace osu.Game.Database using (Stream s = storage.GetStream(Path.Combine(replay_folder, replayFilename))) using (SerializationReader sr = new SerializationReader(s)) { - var ruleset = RulesetCollection.GetRuleset((int)sr.ReadByte()); + var ruleset = RulesetCollection.GetRuleset(sr.ReadByte()); score = ruleset.CreateScoreProcessor().CreateScore(); /* score.Pass = true;*/ @@ -107,5 +108,13 @@ namespace osu.Game.Database return score; } + + protected override void Prepare() + { + } + + public override void Reset() + { + } } } diff --git a/osu.Game/OsuGameBase.cs b/osu.Game/OsuGameBase.cs index f95e8c3ac6..c37d2b83eb 100644 --- a/osu.Game/OsuGameBase.cs +++ b/osu.Game/OsuGameBase.cs @@ -18,6 +18,7 @@ using osu.Game.Graphics; using osu.Game.Graphics.Cursor; using osu.Game.Graphics.Processing; using osu.Game.Online.API; +using SQLite.Net; namespace osu.Game { @@ -80,8 +81,11 @@ namespace osu.Game { Dependencies.Cache(this); Dependencies.Cache(LocalConfig); - Dependencies.Cache(BeatmapDatabase = new BeatmapDatabase(Host.Storage, Host)); - Dependencies.Cache(ScoreDatabase = new ScoreDatabase(Host.Storage, Host, BeatmapDatabase)); + + SQLiteConnection connection = Host.Storage.GetDatabase(@"client"); + + Dependencies.Cache(BeatmapDatabase = new BeatmapDatabase(Host.Storage, connection, Host)); + Dependencies.Cache(ScoreDatabase = new ScoreDatabase(Host.Storage, connection, Host, BeatmapDatabase)); Dependencies.Cache(new OsuColour()); //this completely overrides the framework default. will need to change once we make a proper FontStore. diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 866d3ddacb..a450125e48 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -78,6 +78,7 @@ + From a4e2f34ee73ecca2d19cd2b37d52faa631698b47 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 17 Apr 2017 17:43:48 +0900 Subject: [PATCH 10/45] Make a RulesetDatabase. --- osu.Desktop.Tests/VisualTests.cs | 10 -- osu.Desktop.VisualTests/Program.cs | 10 -- .../Tests/TestCaseModSelectOverlay.cs | 14 ++- .../Tests/TestCasePlaySongSelect.cs | 16 ++- .../Tests/TestCasePlayer.cs | 2 +- osu.Desktop/Program.cs | 10 -- osu.Game.Modes.Catch/CatchRuleset.cs | 2 + osu.Game.Modes.Mania/ManiaRuleset.cs | 2 + osu.Game.Modes.Osu/OsuRuleset.cs | 2 + osu.Game.Modes.Taiko/TaikoRuleset.cs | 2 + .../Beatmaps/Formats/OsuLegacyDecoderTest.cs | 4 +- .../Beatmaps/IO/ImportBeatmapTest.cs | 15 +-- .../Beatmaps/IO/OszArchiveReaderTest.cs | 3 - osu.Game/Beatmaps/Beatmap.cs | 2 +- osu.Game/Beatmaps/Drawables/DifficultyIcon.cs | 2 +- osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs | 2 +- osu.Game/Database/BeatmapDatabase.cs | 51 ++------- osu.Game/Database/BeatmapInfo.cs | 14 +-- osu.Game/Database/Database.cs | 43 ++++++- osu.Game/Database/RulesetDatabase.cs | 107 ++++++++++++++++++ osu.Game/Database/RulesetInfo.cs | 24 ++++ osu.Game/Database/ScoreDatabase.cs | 10 +- osu.Game/Modes/BeatmapStatistic.cs | 14 +++ osu.Game/Modes/Ruleset.cs | 12 +- osu.Game/Modes/RulesetCollection.cs | 42 ------- osu.Game/OsuGame.cs | 8 +- osu.Game/OsuGameBase.cs | 3 + osu.Game/Overlays/Mods/ModSelectOverlay.cs | 10 +- osu.Game/Overlays/Options/OptionsFooter.cs | 8 +- osu.Game/Overlays/Toolbar/Toolbar.cs | 6 +- .../Overlays/Toolbar/ToolbarModeButton.cs | 15 ++- .../Overlays/Toolbar/ToolbarModeSelector.cs | 15 ++- osu.Game/Screens/Play/Player.cs | 2 +- osu.Game/Screens/Select/BeatmapInfoWedge.cs | 2 +- osu.Game/Screens/Select/FilterControl.cs | 4 +- osu.Game/Screens/Select/FilterCriteria.cs | 4 +- osu.Game/Screens/Select/SongSelect.cs | 3 +- osu.Game/osu.Game.csproj | 4 +- 38 files changed, 298 insertions(+), 201 deletions(-) create mode 100644 osu.Game/Database/RulesetDatabase.cs create mode 100644 osu.Game/Database/RulesetInfo.cs create mode 100644 osu.Game/Modes/BeatmapStatistic.cs delete mode 100644 osu.Game/Modes/RulesetCollection.cs diff --git a/osu.Desktop.Tests/VisualTests.cs b/osu.Desktop.Tests/VisualTests.cs index 36dce18b05..6ef924e873 100644 --- a/osu.Desktop.Tests/VisualTests.cs +++ b/osu.Desktop.Tests/VisualTests.cs @@ -4,11 +4,6 @@ using NUnit.Framework; using osu.Desktop.VisualTests; using osu.Framework.Desktop.Platform; -using osu.Game.Modes; -using osu.Game.Modes.Catch; -using osu.Game.Modes.Mania; -using osu.Game.Modes.Osu; -using osu.Game.Modes.Taiko; namespace osu.Desktop.Tests { @@ -20,11 +15,6 @@ namespace osu.Desktop.Tests { using (var host = new HeadlessGameHost()) { - RulesetCollection.Register(typeof(OsuRuleset)); - RulesetCollection.Register(typeof(TaikoRuleset)); - RulesetCollection.Register(typeof(ManiaRuleset)); - RulesetCollection.Register(typeof(CatchRuleset)); - host.Run(new AutomatedVisualTestGame()); } } diff --git a/osu.Desktop.VisualTests/Program.cs b/osu.Desktop.VisualTests/Program.cs index 912034a927..03d1588b78 100644 --- a/osu.Desktop.VisualTests/Program.cs +++ b/osu.Desktop.VisualTests/Program.cs @@ -4,11 +4,6 @@ using System; using osu.Framework.Desktop; using osu.Framework.Platform; -using osu.Game.Modes; -using osu.Game.Modes.Catch; -using osu.Game.Modes.Mania; -using osu.Game.Modes.Osu; -using osu.Game.Modes.Taiko; namespace osu.Desktop.VisualTests { @@ -21,11 +16,6 @@ namespace osu.Desktop.VisualTests using (GameHost host = Host.GetSuitableHost(@"osu")) { - RulesetCollection.Register(typeof(OsuRuleset)); - RulesetCollection.Register(typeof(TaikoRuleset)); - RulesetCollection.Register(typeof(ManiaRuleset)); - RulesetCollection.Register(typeof(CatchRuleset)); - if (benchmark) host.Run(new AutomatedVisualTestGame()); else diff --git a/osu.Desktop.VisualTests/Tests/TestCaseModSelectOverlay.cs b/osu.Desktop.VisualTests/Tests/TestCaseModSelectOverlay.cs index c569f5f64a..d1c137191f 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseModSelectOverlay.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseModSelectOverlay.cs @@ -1,10 +1,11 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Game.Overlays.Mods; using osu.Framework.Testing; -using osu.Game.Modes; +using osu.Game.Database; namespace osu.Desktop.VisualTests.Tests { @@ -13,6 +14,13 @@ namespace osu.Desktop.VisualTests.Tests public override string Description => @"Tests the mod select overlay"; private ModSelectOverlay modSelect; + private RulesetDatabase rulesets; + + [BackgroundDependencyLoader] + private void load(RulesetDatabase rulesets) + { + this.rulesets = rulesets; + } public override void Reset() { @@ -27,8 +35,8 @@ namespace osu.Desktop.VisualTests.Tests AddStep("Toggle", modSelect.ToggleVisibility); - foreach (var ruleset in RulesetCollection.AllRulesets) - AddStep(ruleset.Description, () => modSelect.Ruleset.Value = ruleset); + foreach (var ruleset in rulesets.AllRulesets) + AddStep(ruleset.CreateInstance().Description, () => modSelect.Ruleset.Value = ruleset); } } } diff --git a/osu.Desktop.VisualTests/Tests/TestCasePlaySongSelect.cs b/osu.Desktop.VisualTests/Tests/TestCasePlaySongSelect.cs index dd17d62739..85ccebef77 100644 --- a/osu.Desktop.VisualTests/Tests/TestCasePlaySongSelect.cs +++ b/osu.Desktop.VisualTests/Tests/TestCasePlaySongSelect.cs @@ -3,12 +3,12 @@ using System.Collections.Generic; using osu.Desktop.VisualTests.Platform; +using osu.Framework.Allocation; using osu.Framework.Testing; using osu.Framework.MathUtils; using osu.Game.Database; using osu.Game.Screens.Select; using osu.Game.Screens.Select.Filter; -using osu.Game.Modes; namespace osu.Desktop.VisualTests.Tests { @@ -20,6 +20,14 @@ namespace osu.Desktop.VisualTests.Tests public override string Description => @"with fake data"; + private RulesetDatabase rulesets; + + [BackgroundDependencyLoader] + private void load(RulesetDatabase rulesets) + { + this.rulesets = rulesets; + } + public override void Reset() { base.Reset(); @@ -72,7 +80,7 @@ namespace osu.Desktop.VisualTests.Tests new BeatmapInfo { OnlineBeatmapID = 1234 + i, - Ruleset = RulesetCollection.GetRuleset(0), + Ruleset = rulesets.Query().First(), Path = "normal.osu", Version = "Normal", Difficulty = new BeatmapDifficulty @@ -83,7 +91,7 @@ namespace osu.Desktop.VisualTests.Tests new BeatmapInfo { OnlineBeatmapID = 1235 + i, - Ruleset = RulesetCollection.GetRuleset(0), + Ruleset = rulesets.Query().First(), Path = "hard.osu", Version = "Hard", Difficulty = new BeatmapDifficulty @@ -94,7 +102,7 @@ namespace osu.Desktop.VisualTests.Tests new BeatmapInfo { OnlineBeatmapID = 1236 + i, - Ruleset = RulesetCollection.GetRuleset(0), + Ruleset = rulesets.Query().First(), Path = "insane.osu", Version = "Insane", Difficulty = new BeatmapDifficulty diff --git a/osu.Desktop.VisualTests/Tests/TestCasePlayer.cs b/osu.Desktop.VisualTests/Tests/TestCasePlayer.cs index 2a9c31b2e9..924e753e2d 100644 --- a/osu.Desktop.VisualTests/Tests/TestCasePlayer.cs +++ b/osu.Desktop.VisualTests/Tests/TestCasePlayer.cs @@ -37,7 +37,7 @@ namespace osu.Desktop.VisualTests.Tests WorkingBeatmap beatmap = null; - var beatmapInfo = db.Query().FirstOrDefault(b => b.Ruleset is OsuRuleset); + var beatmapInfo = db.Query().FirstOrDefault(b => b.Ruleset.CreateInstance() is OsuRuleset); if (beatmapInfo != null) beatmap = db.GetWorkingBeatmap(beatmapInfo); diff --git a/osu.Desktop/Program.cs b/osu.Desktop/Program.cs index e9117cf533..210f780078 100644 --- a/osu.Desktop/Program.cs +++ b/osu.Desktop/Program.cs @@ -7,11 +7,6 @@ using osu.Desktop.Beatmaps.IO; using osu.Framework.Desktop; using osu.Framework.Desktop.Platform; using osu.Game.IPC; -using osu.Game.Modes; -using osu.Game.Modes.Catch; -using osu.Game.Modes.Mania; -using osu.Game.Modes.Osu; -using osu.Game.Modes.Taiko; namespace osu.Desktop { @@ -41,11 +36,6 @@ namespace osu.Desktop } else { - RulesetCollection.Register(typeof(OsuRuleset)); - RulesetCollection.Register(typeof(TaikoRuleset)); - RulesetCollection.Register(typeof(ManiaRuleset)); - RulesetCollection.Register(typeof(CatchRuleset)); - host.Run(new OsuGameDesktop(args)); } return 0; diff --git a/osu.Game.Modes.Catch/CatchRuleset.cs b/osu.Game.Modes.Catch/CatchRuleset.cs index 02c170d0ac..6aafb2a3c6 100644 --- a/osu.Game.Modes.Catch/CatchRuleset.cs +++ b/osu.Game.Modes.Catch/CatchRuleset.cs @@ -90,5 +90,7 @@ namespace osu.Game.Modes.Catch public override DifficultyCalculator CreateDifficultyCalculator(Beatmap beatmap) => new CatchDifficultyCalculator(beatmap); public override ScoreProcessor CreateScoreProcessor() => new CatchScoreProcessor(); + + public override int LegacyID => 2; } } diff --git a/osu.Game.Modes.Mania/ManiaRuleset.cs b/osu.Game.Modes.Mania/ManiaRuleset.cs index 7d25ea93c9..030cea7344 100644 --- a/osu.Game.Modes.Mania/ManiaRuleset.cs +++ b/osu.Game.Modes.Mania/ManiaRuleset.cs @@ -105,5 +105,7 @@ namespace osu.Game.Modes.Mania public override DifficultyCalculator CreateDifficultyCalculator(Beatmap beatmap) => new ManiaDifficultyCalculator(beatmap); public override ScoreProcessor CreateScoreProcessor() => new ManiaScoreProcessor(); + + public override int LegacyID => 3; } } diff --git a/osu.Game.Modes.Osu/OsuRuleset.cs b/osu.Game.Modes.Osu/OsuRuleset.cs index 6ca19bb5bb..4de890ac5f 100644 --- a/osu.Game.Modes.Osu/OsuRuleset.cs +++ b/osu.Game.Modes.Osu/OsuRuleset.cs @@ -110,5 +110,7 @@ namespace osu.Game.Modes.Osu }; public override ScoreProcessor CreateScoreProcessor() => new OsuScoreProcessor(); + + public override int LegacyID => 0; } } diff --git a/osu.Game.Modes.Taiko/TaikoRuleset.cs b/osu.Game.Modes.Taiko/TaikoRuleset.cs index e88b50bb95..b93c25c55d 100644 --- a/osu.Game.Modes.Taiko/TaikoRuleset.cs +++ b/osu.Game.Modes.Taiko/TaikoRuleset.cs @@ -91,5 +91,7 @@ namespace osu.Game.Modes.Taiko public override DifficultyCalculator CreateDifficultyCalculator(Beatmap beatmap) => new TaikoDifficultyCalculator(beatmap); public override ScoreProcessor CreateScoreProcessor() => new TaikoScoreProcessor(); + + public override int LegacyID => 1; } } diff --git a/osu.Game.Tests/Beatmaps/Formats/OsuLegacyDecoderTest.cs b/osu.Game.Tests/Beatmaps/Formats/OsuLegacyDecoderTest.cs index 9d783c7e91..91b673dc4c 100644 --- a/osu.Game.Tests/Beatmaps/Formats/OsuLegacyDecoderTest.cs +++ b/osu.Game.Tests/Beatmaps/Formats/OsuLegacyDecoderTest.cs @@ -6,7 +6,6 @@ using NUnit.Framework; using OpenTK; using OpenTK.Graphics; using osu.Game.Beatmaps.Formats; -using osu.Game.Modes; using osu.Game.Tests.Resources; using osu.Game.Modes.Osu; using osu.Game.Modes.Objects.Legacy; @@ -22,7 +21,6 @@ namespace osu.Game.Tests.Beatmaps.Formats public void SetUp() { OsuLegacyDecoder.Register(); - RulesetCollection.Register(typeof(OsuRuleset)); } [Test] @@ -58,7 +56,7 @@ namespace osu.Game.Tests.Beatmaps.Formats Assert.AreEqual(false, beatmapInfo.Countdown); Assert.AreEqual(0.7f, beatmapInfo.StackLeniency); Assert.AreEqual(false, beatmapInfo.SpecialStyle); - Assert.IsTrue(beatmapInfo.Ruleset is OsuRuleset); + Assert.IsTrue(beatmapInfo.Ruleset.CreateInstance() is OsuRuleset); Assert.AreEqual(false, beatmapInfo.LetterboxInBreaks); Assert.AreEqual(false, beatmapInfo.WidescreenStoryboard); } diff --git a/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs b/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs index e110da59b9..0d27a6a650 100644 --- a/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs +++ b/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs @@ -12,11 +12,7 @@ using osu.Framework.Desktop.Platform; using osu.Framework.Platform; using osu.Game.Database; using osu.Game.IPC; -using osu.Game.Modes; -using osu.Game.Modes.Catch; -using osu.Game.Modes.Mania; using osu.Game.Modes.Osu; -using osu.Game.Modes.Taiko; namespace osu.Game.Tests.Beatmaps.IO { @@ -25,15 +21,6 @@ namespace osu.Game.Tests.Beatmaps.IO { private const string osz_path = @"../../../osu-resources/osu.Game.Resources/Beatmaps/241526 Soleily - Renatus.osz"; - [OneTimeSetUp] - public void SetUp() - { - RulesetCollection.Register(typeof(OsuRuleset)); - RulesetCollection.Register(typeof(TaikoRuleset)); - RulesetCollection.Register(typeof(ManiaRuleset)); - RulesetCollection.Register(typeof(CatchRuleset)); - } - [Test] public void TestImportWhenClosed() { @@ -166,7 +153,7 @@ namespace osu.Game.Tests.Beatmaps.IO Assert.IsTrue(set.Beatmaps.Count > 0); - var beatmap = osu.Dependencies.Get().GetWorkingBeatmap(set.Beatmaps.First(b => b.Ruleset is OsuRuleset))?.Beatmap; + var beatmap = osu.Dependencies.Get().GetWorkingBeatmap(set.Beatmaps.First(b => b.Ruleset.CreateInstance() is OsuRuleset))?.Beatmap; Assert.IsTrue(beatmap?.HitObjects.Count > 0); } diff --git a/osu.Game.Tests/Beatmaps/IO/OszArchiveReaderTest.cs b/osu.Game.Tests/Beatmaps/IO/OszArchiveReaderTest.cs index add00d8f4d..03d09e24e0 100644 --- a/osu.Game.Tests/Beatmaps/IO/OszArchiveReaderTest.cs +++ b/osu.Game.Tests/Beatmaps/IO/OszArchiveReaderTest.cs @@ -4,8 +4,6 @@ using System.IO; using NUnit.Framework; using osu.Game.Beatmaps.IO; -using osu.Game.Modes; -using osu.Game.Modes.Osu; using osu.Game.Tests.Resources; using osu.Game.Beatmaps.Formats; using osu.Game.Database; @@ -19,7 +17,6 @@ namespace osu.Game.Tests.Beatmaps.IO public void SetUp() { OszArchiveReader.Register(); - RulesetCollection.Register(typeof(OsuRuleset)); } [Test] diff --git a/osu.Game/Beatmaps/Beatmap.cs b/osu.Game/Beatmaps/Beatmap.cs index 6099b1e115..3b57d4e7fe 100644 --- a/osu.Game/Beatmaps/Beatmap.cs +++ b/osu.Game/Beatmaps/Beatmap.cs @@ -53,7 +53,7 @@ namespace osu.Game.Beatmaps /// Calculates the star difficulty for this Beatmap. /// /// The star difficulty. - public double CalculateStarDifficulty() => BeatmapInfo.Ruleset.CreateDifficultyCalculator(this).Calculate(); + public double CalculateStarDifficulty() => BeatmapInfo.Ruleset.CreateInstance().CreateDifficultyCalculator(this).Calculate(); /// /// Constructs a new beatmap. diff --git a/osu.Game/Beatmaps/Drawables/DifficultyIcon.cs b/osu.Game/Beatmaps/Drawables/DifficultyIcon.cs index 02595df77a..8a9183819c 100644 --- a/osu.Game/Beatmaps/Drawables/DifficultyIcon.cs +++ b/osu.Game/Beatmaps/Drawables/DifficultyIcon.cs @@ -44,7 +44,7 @@ namespace osu.Game.Beatmaps.Drawables Origin = Anchor.Centre, TextSize = Size.X, Colour = Color4.White, - Icon = beatmap.Ruleset.Icon + Icon = beatmap.Ruleset.CreateInstance().Icon } }; } diff --git a/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs b/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs index 36f025d1ff..8ad5f8e7c0 100644 --- a/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs +++ b/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs @@ -83,7 +83,7 @@ namespace osu.Game.Beatmaps.Formats beatmap.BeatmapInfo.StackLeniency = float.Parse(val, NumberFormatInfo.InvariantInfo); break; case @"Mode": - beatmap.BeatmapInfo.Mode = int.Parse(val); + beatmap.BeatmapInfo.RulesetID = int.Parse(val); break; case @"LetterboxInBreaks": beatmap.BeatmapInfo.LetterboxInBreaks = int.Parse(val) == 1; diff --git a/osu.Game/Database/BeatmapDatabase.cs b/osu.Game/Database/BeatmapDatabase.cs index 9695ba8bd0..f3f58ce8b0 100644 --- a/osu.Game/Database/BeatmapDatabase.cs +++ b/osu.Game/Database/BeatmapDatabase.cs @@ -5,7 +5,6 @@ using System; using System.Collections.Generic; using System.IO; using System.Linq; -using System.Linq.Expressions; using osu.Framework.Extensions; using osu.Framework.Logging; using osu.Framework.Platform; @@ -77,6 +76,8 @@ namespace osu.Game.Database public override void Reset() { + Storage.DeleteDatabase(@"beatmaps"); + foreach (var setInfo in Query()) { if (Storage.Exists(setInfo.Path)) @@ -89,6 +90,13 @@ namespace osu.Game.Database Connection.DeleteAll(); } + protected override Type[] ValidTypes => new[] { + typeof(BeatmapSetInfo), + typeof(BeatmapInfo), + typeof(BeatmapMetadata), + typeof(BeatmapDifficulty), + }; + /// /// Import multiple from . /// @@ -275,47 +283,6 @@ namespace osu.Game.Database return working; } - public TableQuery Query() where T : class - { - return Connection.Table(); - } - - public T GetWithChildren(object id) where T : class - { - return Connection.GetWithChildren(id); - } - - public List GetAllWithChildren(Expression> filter = null, bool recursive = true) - where T : class - { - return Connection.GetAllWithChildren(filter, recursive); - } - - public T GetChildren(T item, bool recursive = false) - { - if (item == null) return default(T); - - Connection.GetChildren(item, recursive); - return item; - } - - private readonly Type[] validTypes = { - typeof(BeatmapSetInfo), - typeof(BeatmapInfo), - typeof(BeatmapMetadata), - typeof(BeatmapDifficulty), - }; - - public void Update(T record, bool cascade = true) where T : class - { - if (validTypes.All(t => t != typeof(T))) - throw new ArgumentException("Must be a type managed by BeatmapDatabase", nameof(T)); - if (cascade) - Connection.UpdateWithChildren(record); - else - Connection.Update(record); - } - public bool Exists(BeatmapSetInfo beatmapSet) => Storage.Exists(beatmapSet.Path); } } diff --git a/osu.Game/Database/BeatmapInfo.cs b/osu.Game/Database/BeatmapInfo.cs index be4faebde2..5097622deb 100644 --- a/osu.Game/Database/BeatmapInfo.cs +++ b/osu.Game/Database/BeatmapInfo.cs @@ -3,7 +3,6 @@ using Newtonsoft.Json; using osu.Game.IO.Serialization; -using osu.Game.Modes; using SQLite.Net.Attributes; using SQLiteNetExtensions.Attributes; using System; @@ -55,15 +54,12 @@ namespace osu.Game.Database public float StackLeniency { get; set; } public bool SpecialStyle { get; set; } - public int Mode { get; set; } + [ForeignKey(typeof(RulesetInfo))] + public int RulesetID { get; set; } + + [OneToOne(CascadeOperations = CascadeOperation.All)] + public RulesetInfo Ruleset { get; set; } - [Ignore] - public Ruleset Ruleset - { - get { return RulesetCollection.GetRuleset(Mode); } - set { Mode = RulesetCollection.GetId(value); } - } - public bool LetterboxInBreaks { get; set; } public bool WidescreenStoryboard { get; set; } diff --git a/osu.Game/Database/Database.cs b/osu.Game/Database/Database.cs index 6f8e902663..19bd78b39c 100644 --- a/osu.Game/Database/Database.cs +++ b/osu.Game/Database/Database.cs @@ -2,9 +2,13 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; +using System.Collections.Generic; +using System.Linq; +using System.Linq.Expressions; using osu.Framework.Logging; using osu.Framework.Platform; using SQLite.Net; +using SQLiteNetExtensions.Extensions; namespace osu.Game.Database { @@ -24,8 +28,7 @@ namespace osu.Game.Database } catch (Exception e) { - Logger.Error(e, @"Failed to initialise the beatmap database! Trying again with a clean database..."); - storage.DeleteDatabase(@"beatmaps"); + Logger.Error(e, $@"Failed to initialise the {GetType()}! Trying again with a clean database..."); Reset(); Prepare(); } @@ -40,5 +43,41 @@ namespace osu.Game.Database /// Reset this database to a default state. Undo all changes to database and storage backings. /// public abstract void Reset(); + + public TableQuery Query() where T : class + { + return Connection.Table(); + } + + public T GetWithChildren(object id) where T : class + { + return Connection.GetWithChildren(id); + } + + public List GetAllWithChildren(Expression> filter = null, bool recursive = true) + where T : class + { + return Connection.GetAllWithChildren(filter, recursive); + } + + public T GetChildren(T item, bool recursive = false) + { + if (item == null) return default(T); + + Connection.GetChildren(item, recursive); + return item; + } + + protected abstract Type[] ValidTypes { get; } + + public void Update(T record, bool cascade = true) where T : class + { + if (ValidTypes.All(t => t != typeof(T))) + throw new ArgumentException("Must be a type managed by BeatmapDatabase", nameof(T)); + if (cascade) + Connection.UpdateWithChildren(record); + else + Connection.Update(record); + } } } \ No newline at end of file diff --git a/osu.Game/Database/RulesetDatabase.cs b/osu.Game/Database/RulesetDatabase.cs new file mode 100644 index 0000000000..45db5df26f --- /dev/null +++ b/osu.Game/Database/RulesetDatabase.cs @@ -0,0 +1,107 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Reflection; +using osu.Framework.Platform; +using osu.Game.Modes; +using SQLite.Net; + +namespace osu.Game.Database +{ + /// + /// Todo: All of this needs to be moved to a RulesetDatabase. + /// + public class RulesetDatabase : Database + { + public IEnumerable AllRulesets => Query().Where(r => r.Available); + + public RulesetDatabase(Storage storage, SQLiteConnection connection) + : base(storage, connection) + { + } + + protected override void Prepare() + { + Connection.CreateTable(); + + List instances = new List(); + + foreach (string file in Directory.GetFiles(Environment.CurrentDirectory, @"osu.Game.Modes.*.dll")) + { + try + { + var assembly = Assembly.LoadFile(file); + var rulesets = assembly.GetTypes().Where(t => t.IsSubclassOf(typeof(Ruleset))); + + if (rulesets.Count() != 1) + continue; + + Assembly.LoadFile(file); + + foreach (Type rulesetType in rulesets) + instances.Add((Ruleset)Activator.CreateInstance(rulesetType)); + } + catch (Exception) { } + } + + Connection.BeginTransaction(); + + //add all legacy modes in correct order + foreach (var r in instances.Where(r => r.LegacyID >= 0).OrderBy(r => r.LegacyID)) + { + Connection.InsertOrReplace(createRulesetInfo(r)); + } + + //add any other modes + foreach (var r in instances.Where(r => r.LegacyID < 0)) + { + var us = createRulesetInfo(r); + + var existing = Query().FirstOrDefault(ri => ri.InstantiationInfo == us.InstantiationInfo); + + if (existing == null) + Connection.Insert(us); + } + + //perform a consistency check + foreach (var r in Query()) + { + try + { + r.CreateInstance(); + r.Available = true; + } + catch + { + r.Available = false; + } + + Connection.Update(r); + } + + Connection.Commit(); + + + } + + private RulesetInfo createRulesetInfo(Ruleset ruleset) => new RulesetInfo + { + Name = ruleset.Description, + InstantiationInfo = ruleset.GetType().AssemblyQualifiedName, + ID = ruleset.LegacyID + }; + + public override void Reset() + { + Connection.DeleteAll(); + } + + protected override Type[] ValidTypes => new[] { typeof(RulesetInfo) }; + + public RulesetInfo GetRuleset(int id) => Query().First(r => r.ID == id); + } +} diff --git a/osu.Game/Database/RulesetInfo.cs b/osu.Game/Database/RulesetInfo.cs new file mode 100644 index 0000000000..6a0ee13e41 --- /dev/null +++ b/osu.Game/Database/RulesetInfo.cs @@ -0,0 +1,24 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; +using osu.Game.Modes; +using SQLite.Net.Attributes; + +namespace osu.Game.Database +{ + public class RulesetInfo + { + [PrimaryKey, AutoIncrement] + public int ID { get; set; } + + public string Name { get; set; } + + public string InstantiationInfo { get; set; } + + [Indexed] + public bool Available { get; set; } + + public Ruleset CreateInstance() => (Ruleset)Activator.CreateInstance(Type.GetType(InstantiationInfo)); + } +} \ No newline at end of file diff --git a/osu.Game/Database/ScoreDatabase.cs b/osu.Game/Database/ScoreDatabase.cs index 240b4fa8e6..91a52fba4a 100644 --- a/osu.Game/Database/ScoreDatabase.cs +++ b/osu.Game/Database/ScoreDatabase.cs @@ -7,7 +7,6 @@ using System.Linq; using osu.Framework.Platform; using osu.Game.IO.Legacy; using osu.Game.IPC; -using osu.Game.Modes; using osu.Game.Modes.Scoring; using SharpCompress.Compressors.LZMA; using SQLite.Net; @@ -17,17 +16,20 @@ namespace osu.Game.Database public class ScoreDatabase : Database { private readonly Storage storage; + private readonly BeatmapDatabase beatmaps; + private readonly RulesetDatabase rulesets; private const string replay_folder = @"replays"; // ReSharper disable once NotAccessedField.Local (we should keep a reference to this so it is not finalised) private ScoreIPCChannel ipc; - public ScoreDatabase(Storage storage, SQLiteConnection connection, IIpcHost importHost = null, BeatmapDatabase beatmaps = null) : base(storage, connection) + public ScoreDatabase(Storage storage, SQLiteConnection connection, IIpcHost importHost = null, BeatmapDatabase beatmaps = null, RulesetDatabase rulesets = null) : base(storage, connection) { this.storage = storage; this.beatmaps = beatmaps; + this.rulesets = rulesets; if (importHost != null) ipc = new ScoreIPCChannel(importHost, this); @@ -40,7 +42,7 @@ namespace osu.Game.Database using (Stream s = storage.GetStream(Path.Combine(replay_folder, replayFilename))) using (SerializationReader sr = new SerializationReader(s)) { - var ruleset = RulesetCollection.GetRuleset(sr.ReadByte()); + var ruleset = rulesets.GetRuleset(sr.ReadByte()).CreateInstance(); score = ruleset.CreateScoreProcessor().CreateScore(); /* score.Pass = true;*/ @@ -116,5 +118,7 @@ namespace osu.Game.Database public override void Reset() { } + + protected override Type[] ValidTypes => new[] { typeof(Score) }; } } diff --git a/osu.Game/Modes/BeatmapStatistic.cs b/osu.Game/Modes/BeatmapStatistic.cs new file mode 100644 index 0000000000..d598b81ff4 --- /dev/null +++ b/osu.Game/Modes/BeatmapStatistic.cs @@ -0,0 +1,14 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Graphics; + +namespace osu.Game.Modes +{ + public class BeatmapStatistic + { + public FontAwesome Icon; + public string Content; + public string Name; + } +} \ No newline at end of file diff --git a/osu.Game/Modes/Ruleset.cs b/osu.Game/Modes/Ruleset.cs index 284a71d518..cf0fbe5b6a 100644 --- a/osu.Game/Modes/Ruleset.cs +++ b/osu.Game/Modes/Ruleset.cs @@ -11,13 +11,6 @@ using osu.Game.Modes.Scoring; namespace osu.Game.Modes { - public class BeatmapStatistic - { - public FontAwesome Icon; - public string Content; - public string Name; - } - public abstract class Ruleset { public virtual IEnumerable GetBeatmapStatistics(WorkingBeatmap beatmap) => new BeatmapStatistic[] { }; @@ -35,5 +28,10 @@ namespace osu.Game.Modes public abstract string Description { get; } public abstract IEnumerable CreateGameplayKeys(); + + /// + /// Do not override this unless you are a legacy mode. + /// + public virtual int LegacyID => -1; } } diff --git a/osu.Game/Modes/RulesetCollection.cs b/osu.Game/Modes/RulesetCollection.cs deleted file mode 100644 index 221fa6f5ba..0000000000 --- a/osu.Game/Modes/RulesetCollection.cs +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - -using System; -using System.Collections.Concurrent; -using System.Collections.Generic; -using System.Linq; - -namespace osu.Game.Modes -{ - /// - /// Todo: All of this needs to be moved to a RulesetDatabase. - /// - public static class RulesetCollection - { - private static readonly ConcurrentDictionary available_rulesets = new ConcurrentDictionary(); - - public static void Register(Type type) - { - var ruleset = Activator.CreateInstance(type) as Ruleset; - - if (ruleset == null) - return; - - available_rulesets.TryAdd(available_rulesets.Count, ruleset); - } - - public static Ruleset GetRuleset(int rulesetId) - { - Ruleset ruleset; - - if (!available_rulesets.TryGetValue(rulesetId, out ruleset)) - return null; - - return ruleset; - } - - public static int GetId(Ruleset ruleset) => available_rulesets.First(kvp => kvp.Value == ruleset).Key; - - public static IEnumerable AllRulesets => available_rulesets.Values; - } -} diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 3379787d6d..6062f3fd59 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -15,7 +15,6 @@ using osu.Framework.Logging; using osu.Game.Graphics.UserInterface.Volume; using osu.Framework.Allocation; using osu.Framework.Timing; -using osu.Game.Modes; using osu.Game.Overlays.Toolbar; using osu.Game.Screens; using osu.Game.Screens.Menu; @@ -24,6 +23,7 @@ using System.Linq; using osu.Framework.Graphics.Primitives; using System.Threading.Tasks; using osu.Framework.Threading; +using osu.Game.Database; using osu.Game.Graphics; using osu.Game.Modes.Scoring; using osu.Game.Overlays.Notifications; @@ -59,7 +59,7 @@ namespace osu.Game private VolumeControl volume; private Bindable configRuleset; - public Bindable Ruleset = new Bindable(); + public Bindable Ruleset = new Bindable(); private readonly string[] args; @@ -90,8 +90,8 @@ namespace osu.Game Dependencies.Cache(this); configRuleset = LocalConfig.GetBindable(OsuConfig.Ruleset); - Ruleset.Value = RulesetCollection.GetRuleset(configRuleset.Value); - Ruleset.ValueChanged += r => configRuleset.Value = RulesetCollection.GetId(r); + Ruleset.Value = RulesetDatabase.GetRuleset(configRuleset.Value); + Ruleset.ValueChanged += r => configRuleset.Value = r.ID; } private ScheduledDelegate scoreLoad; diff --git a/osu.Game/OsuGameBase.cs b/osu.Game/OsuGameBase.cs index c37d2b83eb..c6a5cbef1b 100644 --- a/osu.Game/OsuGameBase.cs +++ b/osu.Game/OsuGameBase.cs @@ -28,6 +28,8 @@ namespace osu.Game protected BeatmapDatabase BeatmapDatabase; + protected RulesetDatabase RulesetDatabase; + protected ScoreDatabase ScoreDatabase; protected override string MainResourceFile => @"osu.Game.Resources.dll"; @@ -85,6 +87,7 @@ namespace osu.Game SQLiteConnection connection = Host.Storage.GetDatabase(@"client"); Dependencies.Cache(BeatmapDatabase = new BeatmapDatabase(Host.Storage, connection, Host)); + Dependencies.Cache(RulesetDatabase = new RulesetDatabase(Host.Storage, connection)); Dependencies.Cache(ScoreDatabase = new ScoreDatabase(Host.Storage, connection, Host, BeatmapDatabase)); Dependencies.Cache(new OsuColour()); diff --git a/osu.Game/Overlays/Mods/ModSelectOverlay.cs b/osu.Game/Overlays/Mods/ModSelectOverlay.cs index 02df95ff8a..30ccb2d005 100644 --- a/osu.Game/Overlays/Mods/ModSelectOverlay.cs +++ b/osu.Game/Overlays/Mods/ModSelectOverlay.cs @@ -13,11 +13,11 @@ using osu.Framework.Graphics.Sprites; using osu.Game.Graphics; using osu.Game.Graphics.Backgrounds; using osu.Game.Graphics.Sprites; -using osu.Game.Modes; using osu.Game.Modes.Mods; using System; using System.Collections.Generic; using System.Linq; +using osu.Game.Database; namespace osu.Game.Overlays.Mods { @@ -37,12 +37,14 @@ namespace osu.Game.Overlays.Mods public readonly Bindable> SelectedMods = new Bindable>(); - public readonly Bindable Ruleset = new Bindable(RulesetCollection.GetRuleset(0)); + public readonly Bindable Ruleset = new Bindable(); - private void rulesetChanged(Ruleset newRuleset) + private void rulesetChanged(RulesetInfo newRuleset) { + var instance = newRuleset.CreateInstance(); + foreach (ModSection section in modSectionsContainer.Children) - section.Buttons = newRuleset.GetModsFor(section.ModType).Select(m => new ModButton(m)).ToArray(); + section.Buttons = instance.GetModsFor(section.ModType).Select(m => new ModButton(m)).ToArray(); refreshSelectedMods(); } diff --git a/osu.Game/Overlays/Options/OptionsFooter.cs b/osu.Game/Overlays/Options/OptionsFooter.cs index ad184c8838..c785f2d0c0 100644 --- a/osu.Game/Overlays/Options/OptionsFooter.cs +++ b/osu.Game/Overlays/Options/OptionsFooter.cs @@ -6,9 +6,9 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Primitives; +using osu.Game.Database; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; -using osu.Game.Modes; using OpenTK; using OpenTK.Graphics; @@ -17,7 +17,7 @@ namespace osu.Game.Overlays.Options public class OptionsFooter : FillFlowContainer { [BackgroundDependencyLoader] - private void load(OsuGameBase game, OsuColour colours) + private void load(OsuGameBase game, OsuColour colours, RulesetDatabase rulesets) { RelativeSizeAxes = Axes.X; AutoSizeAxes = Axes.Y; @@ -26,11 +26,11 @@ namespace osu.Game.Overlays.Options var modes = new List(); - foreach (var ruleset in RulesetCollection.AllRulesets) + foreach (var ruleset in rulesets.AllRulesets) { modes.Add(new TextAwesome { - Icon = ruleset.Icon, + Icon = ruleset.CreateInstance().Icon, Colour = Color4.Gray, TextSize = 20 }); diff --git a/osu.Game/Overlays/Toolbar/Toolbar.cs b/osu.Game/Overlays/Toolbar/Toolbar.cs index ec76a37e6e..4632b55775 100644 --- a/osu.Game/Overlays/Toolbar/Toolbar.cs +++ b/osu.Game/Overlays/Toolbar/Toolbar.cs @@ -8,8 +8,8 @@ using osu.Framework.Graphics.Colour; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; using osu.Framework.Input; +using osu.Game.Database; using osu.Game.Graphics; -using osu.Game.Modes; using OpenTK; namespace osu.Game.Overlays.Toolbar @@ -20,7 +20,7 @@ namespace osu.Game.Overlays.Toolbar public const float TOOLTIP_HEIGHT = 30; public Action OnHome; - public Action OnRulesetChange; + public Action OnRulesetChange; private readonly ToolbarModeSelector modeSelector; private readonly ToolbarUserArea userArea; @@ -129,7 +129,7 @@ namespace osu.Game.Overlays.Toolbar } } - public void SetGameMode(Ruleset ruleset) => modeSelector.SetGameMode(ruleset); + public void SetGameMode(RulesetInfo ruleset) => modeSelector.SetGameMode(ruleset); protected override void PopIn() { diff --git a/osu.Game/Overlays/Toolbar/ToolbarModeButton.cs b/osu.Game/Overlays/Toolbar/ToolbarModeButton.cs index 6ace90bcb4..dd70289f7d 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarModeButton.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarModeButton.cs @@ -2,23 +2,26 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics.Containers; -using osu.Game.Modes; +using osu.Game.Database; using OpenTK.Graphics; namespace osu.Game.Overlays.Toolbar { public class ToolbarModeButton : ToolbarButton { - private Ruleset ruleset; - public Ruleset Ruleset + private RulesetInfo ruleset; + public RulesetInfo Ruleset { get { return ruleset; } set { ruleset = value; - TooltipMain = ruleset.Description; - TooltipSub = $"Play some {ruleset.Description}"; - Icon = ruleset.Icon; + + var rInstance = ruleset.CreateInstance(); + + TooltipMain = rInstance.Description; + TooltipSub = $"Play some {rInstance.Description}"; + Icon = rInstance.Icon; } } diff --git a/osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs b/osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs index 0d673eb3fe..e4c9db7c5d 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs @@ -3,12 +3,13 @@ using System; using System.Linq; +using osu.Framework.Allocation; using osu.Framework.Caching; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Sprites; -using osu.Game.Modes; +using osu.Game.Database; using OpenTK; using OpenTK.Graphics; @@ -22,7 +23,7 @@ namespace osu.Game.Overlays.Toolbar private readonly Drawable modeButtonLine; private ToolbarModeButton activeButton; - public Action OnRulesetChange; + public Action OnRulesetChange; public ToolbarModeSelector() { @@ -62,8 +63,12 @@ namespace osu.Game.Overlays.Toolbar } } }; + } - foreach (var ruleset in RulesetCollection.AllRulesets) + [BackgroundDependencyLoader] + private void load(RulesetDatabase rulesets) + { + foreach (var ruleset in rulesets.AllRulesets) { modeButtons.Add(new ToolbarModeButton { @@ -84,11 +89,11 @@ namespace osu.Game.Overlays.Toolbar Size = new Vector2(modeButtons.DrawSize.X, 1); } - public void SetGameMode(Ruleset ruleset) + public void SetGameMode(RulesetInfo ruleset) { foreach (ToolbarModeButton m in modeButtons.Children.Cast()) { - bool isActive = m.Ruleset == ruleset; + bool isActive = m.Ruleset.ID == ruleset.ID; m.Active = isActive; if (isActive) activeButton = m; diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index b59b3bf0c1..b32548c31a 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -102,7 +102,7 @@ namespace osu.Game.Screens.Play sourceClock.Reset(); }); - ruleset = Beatmap.BeatmapInfo.Ruleset; + ruleset = Beatmap.BeatmapInfo.Ruleset.CreateInstance(); // Todo: This should be done as early as possible, and should check if the hit renderer // can actually convert the hit objects... Somehow... diff --git a/osu.Game/Screens/Select/BeatmapInfoWedge.cs b/osu.Game/Screens/Select/BeatmapInfoWedge.cs index 775efd5a40..2d873d10ab 100644 --- a/osu.Game/Screens/Select/BeatmapInfoWedge.cs +++ b/osu.Game/Screens/Select/BeatmapInfoWedge.cs @@ -100,7 +100,7 @@ namespace osu.Game.Screens.Select })); //get statistics fromt he current ruleset. - labels.AddRange(beatmap.BeatmapInfo.Ruleset.GetBeatmapStatistics(beatmap).Select(s => new InfoLabel(s))); + labels.AddRange(beatmap.BeatmapInfo.Ruleset.CreateInstance().GetBeatmapStatistics(beatmap).Select(s => new InfoLabel(s))); } AlwaysPresent = true; diff --git a/osu.Game/Screens/Select/FilterControl.cs b/osu.Game/Screens/Select/FilterControl.cs index 1e2f074939..e0b197e9ca 100644 --- a/osu.Game/Screens/Select/FilterControl.cs +++ b/osu.Game/Screens/Select/FilterControl.cs @@ -16,7 +16,7 @@ using osu.Game.Graphics.UserInterface; using osu.Game.Screens.Select.Filter; using Container = osu.Framework.Graphics.Containers.Container; using osu.Framework.Input; -using osu.Game.Modes; +using osu.Game.Database; namespace osu.Game.Screens.Select { @@ -163,7 +163,7 @@ namespace osu.Game.Screens.Select searchTextBox.HoldFocus = true; } - private readonly Bindable ruleset = new Bindable(RulesetCollection.GetRuleset(0)); + private readonly Bindable ruleset = new Bindable(); [BackgroundDependencyLoader(permitNulls:true)] private void load(OsuColour colours, OsuGame osu) diff --git a/osu.Game/Screens/Select/FilterCriteria.cs b/osu.Game/Screens/Select/FilterCriteria.cs index 0b750ef8d3..1a32244deb 100644 --- a/osu.Game/Screens/Select/FilterCriteria.cs +++ b/osu.Game/Screens/Select/FilterCriteria.cs @@ -5,7 +5,7 @@ using System; using System.Collections.Generic; using System.Linq; using osu.Game.Beatmaps.Drawables; -using osu.Game.Modes; +using osu.Game.Database; using osu.Game.Screens.Select.Filter; namespace osu.Game.Screens.Select @@ -15,7 +15,7 @@ namespace osu.Game.Screens.Select public GroupMode Group; public SortMode Sort; public string SearchText; - public Ruleset Ruleset; + public RulesetInfo Ruleset; public void Filter(List groups) { diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index 183eb7de32..182158fa5d 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -20,7 +20,6 @@ using osu.Game.Beatmaps.Drawables; using osu.Game.Database; using osu.Game.Graphics; using osu.Game.Graphics.Containers; -using osu.Game.Modes; using osu.Game.Overlays; using osu.Game.Screens.Backgrounds; using osu.Game.Screens.Select.Options; @@ -29,7 +28,7 @@ namespace osu.Game.Screens.Select { public abstract class SongSelect : OsuScreen { - private readonly Bindable ruleset = new Bindable(RulesetCollection.GetRuleset(0)); + private readonly Bindable ruleset = new Bindable(); private BeatmapDatabase database; protected override BackgroundScreen CreateBackground() => new BackgroundScreenBeatmap(Beatmap); diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index a450125e48..193c2c1179 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -79,6 +79,7 @@ + @@ -102,6 +103,7 @@ + @@ -133,7 +135,7 @@ - + From db6556a0f9459e71513e65b51b1113d0b0a556d7 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 17 Apr 2017 17:44:02 +0900 Subject: [PATCH 11/45] Index DeletePending for better performance. --- osu.Game/Database/BeatmapSetInfo.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game/Database/BeatmapSetInfo.cs b/osu.Game/Database/BeatmapSetInfo.cs index 0ef0ba4c63..0875d3c01f 100644 --- a/osu.Game/Database/BeatmapSetInfo.cs +++ b/osu.Game/Database/BeatmapSetInfo.cs @@ -26,6 +26,7 @@ namespace osu.Game.Database public double MaxStarDifficulty => Beatmaps.Max(b => b.StarDifficulty); + [Indexed] public bool DeletePending { get; set; } public string Hash { get; set; } From c235a14e3e11f8f2daec4a7c9499714ae8364456 Mon Sep 17 00:00:00 2001 From: Huo Yaoyuan Date: Mon, 17 Apr 2017 17:08:01 +0800 Subject: [PATCH 12/45] Don't block input in BeatmapInfoWedge. --- osu.Game/Screens/Select/BeatmapInfoWedge.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osu.Game/Screens/Select/BeatmapInfoWedge.cs b/osu.Game/Screens/Select/BeatmapInfoWedge.cs index 768cef4645..ac1f1837b7 100644 --- a/osu.Game/Screens/Select/BeatmapInfoWedge.cs +++ b/osu.Game/Screens/Select/BeatmapInfoWedge.cs @@ -47,6 +47,8 @@ namespace osu.Game.Screens.Select protected override bool HideOnEscape => false; + protected override bool BlockPassThroughInput => false; + protected override void PopIn() { MoveToX(0, 800, EasingTypes.OutQuint); From af13f97435f94be809de44031fbe0faa9a033332 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 17 Apr 2017 19:44:03 +0900 Subject: [PATCH 13/45] Fix regressions and test cases. --- .../Tests/TestCaseGamefield.cs | 10 +++++ .../Tests/TestCaseModSelectOverlay.cs | 1 + .../Tests/TestCasePlaySongSelect.cs | 12 +++--- .../Tests/TestCasePlayer.cs | 5 ++- .../Beatmaps/Formats/OsuLegacyDecoderTest.cs | 3 +- .../Beatmaps/IO/ImportBeatmapTest.cs | 6 +-- osu.Game/Beatmaps/Beatmap.cs | 6 --- osu.Game/Database/BeatmapDatabase.cs | 39 +++++++++++-------- osu.Game/Database/Database.cs | 7 ++-- osu.Game/Database/RulesetDatabase.cs | 16 +++----- osu.Game/Database/RulesetInfo.cs | 2 +- osu.Game/Database/ScoreDatabase.cs | 6 +-- osu.Game/OsuGame.cs | 2 +- osu.Game/OsuGameBase.cs | 2 +- osu.Game/Overlays/Mods/ModSelectOverlay.cs | 5 ++- 15 files changed, 63 insertions(+), 59 deletions(-) diff --git a/osu.Desktop.VisualTests/Tests/TestCaseGamefield.cs b/osu.Desktop.VisualTests/Tests/TestCaseGamefield.cs index 3129cade63..d1519d0404 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseGamefield.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseGamefield.cs @@ -17,13 +17,22 @@ using osu.Game.Modes.Osu.UI; using osu.Game.Modes.Taiko.UI; using System.Collections.Generic; using osu.Desktop.VisualTests.Beatmaps; +using osu.Framework.Allocation; namespace osu.Desktop.VisualTests.Tests { internal class TestCaseGamefield : TestCase { + private RulesetDatabase rulesets; + public override string Description => @"Showing hitobjects and what not."; + [BackgroundDependencyLoader] + private void load(RulesetDatabase rulesets) + { + this.rulesets = rulesets; + } + public override void Reset() { base.Reset(); @@ -49,6 +58,7 @@ namespace osu.Desktop.VisualTests.Tests BeatmapInfo = new BeatmapInfo { Difficulty = new BeatmapDifficulty(), + Ruleset = rulesets.Query().First(), Metadata = new BeatmapMetadata { Artist = @"Unknown", diff --git a/osu.Desktop.VisualTests/Tests/TestCaseModSelectOverlay.cs b/osu.Desktop.VisualTests/Tests/TestCaseModSelectOverlay.cs index d1c137191f..a2d7b3ad99 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseModSelectOverlay.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseModSelectOverlay.cs @@ -1,6 +1,7 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System.Linq; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Game.Overlays.Mods; diff --git a/osu.Desktop.VisualTests/Tests/TestCasePlaySongSelect.cs b/osu.Desktop.VisualTests/Tests/TestCasePlaySongSelect.cs index 85ccebef77..db21556cda 100644 --- a/osu.Desktop.VisualTests/Tests/TestCasePlaySongSelect.cs +++ b/osu.Desktop.VisualTests/Tests/TestCasePlaySongSelect.cs @@ -22,19 +22,17 @@ namespace osu.Desktop.VisualTests.Tests private RulesetDatabase rulesets; - [BackgroundDependencyLoader] - private void load(RulesetDatabase rulesets) - { - this.rulesets = rulesets; - } - public override void Reset() { base.Reset(); if (db == null) { storage = new TestStorage(@"TestCasePlaySongSelect"); - db = new BeatmapDatabase(storage, storage.GetDatabase(@"client")); + + var backingDatabase = storage.GetDatabase(@"client"); + + rulesets = new RulesetDatabase(storage, backingDatabase); + db = new BeatmapDatabase(storage, backingDatabase, rulesets); var sets = new List(); diff --git a/osu.Desktop.VisualTests/Tests/TestCasePlayer.cs b/osu.Desktop.VisualTests/Tests/TestCasePlayer.cs index 924e753e2d..a21c09a9d0 100644 --- a/osu.Desktop.VisualTests/Tests/TestCasePlayer.cs +++ b/osu.Desktop.VisualTests/Tests/TestCasePlayer.cs @@ -22,12 +22,14 @@ namespace osu.Desktop.VisualTests.Tests { protected Player Player; private BeatmapDatabase db; + private RulesetDatabase rulesets; public override string Description => @"Showing everything to play the game."; [BackgroundDependencyLoader] - private void load(BeatmapDatabase db) + private void load(BeatmapDatabase db, RulesetDatabase rulesets) { + this.rulesets = rulesets; this.db = db; } @@ -65,6 +67,7 @@ namespace osu.Desktop.VisualTests.Tests BeatmapInfo = new BeatmapInfo { Difficulty = new BeatmapDifficulty(), + Ruleset = rulesets.Query().First(), Metadata = new BeatmapMetadata { Artist = @"Unknown", diff --git a/osu.Game.Tests/Beatmaps/Formats/OsuLegacyDecoderTest.cs b/osu.Game.Tests/Beatmaps/Formats/OsuLegacyDecoderTest.cs index 91b673dc4c..5e94a4dd77 100644 --- a/osu.Game.Tests/Beatmaps/Formats/OsuLegacyDecoderTest.cs +++ b/osu.Game.Tests/Beatmaps/Formats/OsuLegacyDecoderTest.cs @@ -7,7 +7,6 @@ using OpenTK; using OpenTK.Graphics; using osu.Game.Beatmaps.Formats; using osu.Game.Tests.Resources; -using osu.Game.Modes.Osu; using osu.Game.Modes.Objects.Legacy; using System.Linq; using osu.Game.Audio; @@ -56,7 +55,7 @@ namespace osu.Game.Tests.Beatmaps.Formats Assert.AreEqual(false, beatmapInfo.Countdown); Assert.AreEqual(0.7f, beatmapInfo.StackLeniency); Assert.AreEqual(false, beatmapInfo.SpecialStyle); - Assert.IsTrue(beatmapInfo.Ruleset.CreateInstance() is OsuRuleset); + Assert.IsTrue(beatmapInfo.RulesetID == 0); Assert.AreEqual(false, beatmapInfo.LetterboxInBreaks); Assert.AreEqual(false, beatmapInfo.WidescreenStoryboard); } diff --git a/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs b/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs index 0d27a6a650..0e03a443cc 100644 --- a/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs +++ b/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs @@ -12,7 +12,6 @@ using osu.Framework.Desktop.Platform; using osu.Framework.Platform; using osu.Game.Database; using osu.Game.IPC; -using osu.Game.Modes.Osu; namespace osu.Game.Tests.Beatmaps.IO { @@ -106,6 +105,7 @@ namespace osu.Game.Tests.Beatmaps.IO Thread.Sleep(1); //reset beatmap database (sqlite and storage backing) + osu.Dependencies.Get().Reset(); osu.Dependencies.Get().Reset(); return osu; @@ -122,7 +122,7 @@ namespace osu.Game.Tests.Beatmaps.IO Thread.Sleep(50); }; - Assert.IsTrue(waitAction.BeginInvoke(null, null).AsyncWaitHandle.WaitOne(timeout), + Assert.IsTrue(waitAction.BeginInvoke(null, null).AsyncWaitHandle.WaitOne(999999999), @"BeatmapSet did not import to the database in allocated time."); //ensure we were stored to beatmap database backing... @@ -153,7 +153,7 @@ namespace osu.Game.Tests.Beatmaps.IO Assert.IsTrue(set.Beatmaps.Count > 0); - var beatmap = osu.Dependencies.Get().GetWorkingBeatmap(set.Beatmaps.First(b => b.Ruleset.CreateInstance() is OsuRuleset))?.Beatmap; + var beatmap = osu.Dependencies.Get().GetWorkingBeatmap(set.Beatmaps.First(b => b.RulesetID == 0))?.Beatmap; Assert.IsTrue(beatmap?.HitObjects.Count > 0); } diff --git a/osu.Game/Beatmaps/Beatmap.cs b/osu.Game/Beatmaps/Beatmap.cs index 3b57d4e7fe..e3a7a81d0d 100644 --- a/osu.Game/Beatmaps/Beatmap.cs +++ b/osu.Game/Beatmaps/Beatmap.cs @@ -49,12 +49,6 @@ namespace osu.Game.Beatmaps /// public class Beatmap : Beatmap { - /// - /// Calculates the star difficulty for this Beatmap. - /// - /// The star difficulty. - public double CalculateStarDifficulty() => BeatmapInfo.Ruleset.CreateInstance().CreateDifficultyCalculator(this).Calculate(); - /// /// Constructs a new beatmap. /// diff --git a/osu.Game/Database/BeatmapDatabase.cs b/osu.Game/Database/BeatmapDatabase.cs index f3f58ce8b0..7789096067 100644 --- a/osu.Game/Database/BeatmapDatabase.cs +++ b/osu.Game/Database/BeatmapDatabase.cs @@ -19,6 +19,7 @@ namespace osu.Game.Database { public class BeatmapDatabase : Database { + private readonly RulesetDatabase rulesets; public event Action BeatmapSetAdded; public event Action BeatmapSetRemoved; @@ -26,8 +27,9 @@ namespace osu.Game.Database // ReSharper disable once NotAccessedField.Local (we should keep a reference to this so it is not finalised) private BeatmapIPCChannel ipc; - public BeatmapDatabase(Storage storage, SQLiteConnection connection, IIpcHost importHost = null) : base(storage, connection) + public BeatmapDatabase(Storage storage, SQLiteConnection connection, RulesetDatabase rulesets, IIpcHost importHost = null) : base(storage, connection) { + this.rulesets = rulesets; if (importHost != null) ipc = new BeatmapIPCChannel(importHost, this); } @@ -64,30 +66,30 @@ namespace osu.Game.Database Connection.Query("UPDATE BeatmapSetInfo SET DeletePending = 0 WHERE DeletePending IS NULL"); } - protected override void Prepare() + protected override void Prepare(bool reset = false) { Connection.CreateTable(); Connection.CreateTable(); Connection.CreateTable(); Connection.CreateTable(); - deletePending(); - } - - public override void Reset() - { - Storage.DeleteDatabase(@"beatmaps"); - - foreach (var setInfo in Query()) + if (reset) { - if (Storage.Exists(setInfo.Path)) - Storage.Delete(setInfo.Path); + Storage.DeleteDatabase(@"beatmaps"); + + foreach (var setInfo in Query()) + { + if (Storage.Exists(setInfo.Path)) + Storage.Delete(setInfo.Path); + } + + Connection.DeleteAll(); + Connection.DeleteAll(); + Connection.DeleteAll(); + Connection.DeleteAll(); } - Connection.DeleteAll(); - Connection.DeleteAll(); - Connection.DeleteAll(); - Connection.DeleteAll(); + deletePending(); } protected override Type[] ValidTypes => new[] { @@ -216,7 +218,10 @@ namespace osu.Game.Database // TODO: Diff beatmap metadata with set metadata and leave it here if necessary beatmap.BeatmapInfo.Metadata = null; - beatmap.BeatmapInfo.StarDifficulty = beatmap.CalculateStarDifficulty(); + // TODO: this should be done in a better place once we actually need to dynamically update it. + beatmap.BeatmapInfo.StarDifficulty = rulesets.Query().FirstOrDefault(r => r.ID == beatmap.BeatmapInfo.RulesetID)?.CreateInstance()?.CreateDifficultyCalculator(beatmap).Calculate() ?? 0; + + beatmap.BeatmapInfo.Ruleset = null; beatmapSet.Beatmaps.Add(beatmap.BeatmapInfo); } diff --git a/osu.Game/Database/Database.cs b/osu.Game/Database/Database.cs index 19bd78b39c..23851b3b2e 100644 --- a/osu.Game/Database/Database.cs +++ b/osu.Game/Database/Database.cs @@ -29,20 +29,19 @@ namespace osu.Game.Database catch (Exception e) { Logger.Error(e, $@"Failed to initialise the {GetType()}! Trying again with a clean database..."); - Reset(); - Prepare(); + Prepare(true); } } /// /// Prepare this database for use. /// - protected abstract void Prepare(); + protected abstract void Prepare(bool reset = false); /// /// Reset this database to a default state. Undo all changes to database and storage backings. /// - public abstract void Reset(); + public void Reset() => Prepare(true); public TableQuery Query() where T : class { diff --git a/osu.Game/Database/RulesetDatabase.cs b/osu.Game/Database/RulesetDatabase.cs index 45db5df26f..d19fe56345 100644 --- a/osu.Game/Database/RulesetDatabase.cs +++ b/osu.Game/Database/RulesetDatabase.cs @@ -24,10 +24,15 @@ namespace osu.Game.Database { } - protected override void Prepare() + protected override void Prepare(bool reset = false) { Connection.CreateTable(); + if (reset) + { + Connection.DeleteAll(); + } + List instances = new List(); foreach (string file in Directory.GetFiles(Environment.CurrentDirectory, @"osu.Game.Modes.*.dll")) @@ -40,8 +45,6 @@ namespace osu.Game.Database if (rulesets.Count() != 1) continue; - Assembly.LoadFile(file); - foreach (Type rulesetType in rulesets) instances.Add((Ruleset)Activator.CreateInstance(rulesetType)); } @@ -84,8 +87,6 @@ namespace osu.Game.Database } Connection.Commit(); - - } private RulesetInfo createRulesetInfo(Ruleset ruleset) => new RulesetInfo @@ -95,11 +96,6 @@ namespace osu.Game.Database ID = ruleset.LegacyID }; - public override void Reset() - { - Connection.DeleteAll(); - } - protected override Type[] ValidTypes => new[] { typeof(RulesetInfo) }; public RulesetInfo GetRuleset(int id) => Query().First(r => r.ID == id); diff --git a/osu.Game/Database/RulesetInfo.cs b/osu.Game/Database/RulesetInfo.cs index 6a0ee13e41..d7bab39b97 100644 --- a/osu.Game/Database/RulesetInfo.cs +++ b/osu.Game/Database/RulesetInfo.cs @@ -10,7 +10,7 @@ namespace osu.Game.Database public class RulesetInfo { [PrimaryKey, AutoIncrement] - public int ID { get; set; } + public int? ID { get; set; } public string Name { get; set; } diff --git a/osu.Game/Database/ScoreDatabase.cs b/osu.Game/Database/ScoreDatabase.cs index 91a52fba4a..a2fff7f795 100644 --- a/osu.Game/Database/ScoreDatabase.cs +++ b/osu.Game/Database/ScoreDatabase.cs @@ -111,11 +111,7 @@ namespace osu.Game.Database return score; } - protected override void Prepare() - { - } - - public override void Reset() + protected override void Prepare(bool reset = false) { } diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 6062f3fd59..1006008afc 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -91,7 +91,7 @@ namespace osu.Game configRuleset = LocalConfig.GetBindable(OsuConfig.Ruleset); Ruleset.Value = RulesetDatabase.GetRuleset(configRuleset.Value); - Ruleset.ValueChanged += r => configRuleset.Value = r.ID; + Ruleset.ValueChanged += r => configRuleset.Value = r.ID ?? 0; } private ScheduledDelegate scoreLoad; diff --git a/osu.Game/OsuGameBase.cs b/osu.Game/OsuGameBase.cs index c6a5cbef1b..371699eab3 100644 --- a/osu.Game/OsuGameBase.cs +++ b/osu.Game/OsuGameBase.cs @@ -86,8 +86,8 @@ namespace osu.Game SQLiteConnection connection = Host.Storage.GetDatabase(@"client"); - Dependencies.Cache(BeatmapDatabase = new BeatmapDatabase(Host.Storage, connection, Host)); Dependencies.Cache(RulesetDatabase = new RulesetDatabase(Host.Storage, connection)); + Dependencies.Cache(BeatmapDatabase = new BeatmapDatabase(Host.Storage, connection, RulesetDatabase, Host)); Dependencies.Cache(ScoreDatabase = new ScoreDatabase(Host.Storage, connection, Host, BeatmapDatabase)); Dependencies.Cache(new OsuColour()); diff --git a/osu.Game/Overlays/Mods/ModSelectOverlay.cs b/osu.Game/Overlays/Mods/ModSelectOverlay.cs index 30ccb2d005..bf7117edf1 100644 --- a/osu.Game/Overlays/Mods/ModSelectOverlay.cs +++ b/osu.Game/Overlays/Mods/ModSelectOverlay.cs @@ -49,13 +49,16 @@ namespace osu.Game.Overlays.Mods } [BackgroundDependencyLoader(permitNulls: true)] - private void load(OsuColour colours, OsuGame osu) + private void load(OsuColour colours, OsuGame osu, RulesetDatabase rulesets) { lowMultiplierColour = colours.Red; highMultiplierColour = colours.Green; if (osu != null) Ruleset.BindTo(osu.Ruleset); + else + Ruleset.Value = rulesets.AllRulesets.First(); + Ruleset.ValueChanged += rulesetChanged; Ruleset.TriggerChange(); } From fe0d18777e3c5e4db82908e87efc01ed14eaf31f Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 17 Apr 2017 19:52:07 +0900 Subject: [PATCH 14/45] Fix appveyor issues. --- osu.Desktop.VisualTests/Tests/TestCaseModSelectOverlay.cs | 1 - osu.Desktop.VisualTests/Tests/TestCasePlaySongSelect.cs | 1 - 2 files changed, 2 deletions(-) diff --git a/osu.Desktop.VisualTests/Tests/TestCaseModSelectOverlay.cs b/osu.Desktop.VisualTests/Tests/TestCaseModSelectOverlay.cs index a2d7b3ad99..d1c137191f 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseModSelectOverlay.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseModSelectOverlay.cs @@ -1,7 +1,6 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System.Linq; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Game.Overlays.Mods; diff --git a/osu.Desktop.VisualTests/Tests/TestCasePlaySongSelect.cs b/osu.Desktop.VisualTests/Tests/TestCasePlaySongSelect.cs index db21556cda..35eb6d0ff9 100644 --- a/osu.Desktop.VisualTests/Tests/TestCasePlaySongSelect.cs +++ b/osu.Desktop.VisualTests/Tests/TestCasePlaySongSelect.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using osu.Desktop.VisualTests.Platform; -using osu.Framework.Allocation; using osu.Framework.Testing; using osu.Framework.MathUtils; using osu.Game.Database; From 4b6ba565f861b5ccef15916c70d0c372fd00ef3d Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 17 Apr 2017 20:10:51 +0900 Subject: [PATCH 15/45] Fix forgotten revert. --- osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs b/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs index 0e03a443cc..0c64c47a63 100644 --- a/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs +++ b/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs @@ -122,7 +122,7 @@ namespace osu.Game.Tests.Beatmaps.IO Thread.Sleep(50); }; - Assert.IsTrue(waitAction.BeginInvoke(null, null).AsyncWaitHandle.WaitOne(999999999), + Assert.IsTrue(waitAction.BeginInvoke(null, null).AsyncWaitHandle.WaitOne(timeout), @"BeatmapSet did not import to the database in allocated time."); //ensure we were stored to beatmap database backing... From 2767fbd81a41014311ff8c38d8e1e0d940da4d86 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Mon, 17 Apr 2017 15:44:46 +0900 Subject: [PATCH 16/45] Implement Beatmap conversion testing. --- .../Beatmaps/CatchBeatmapConverter.cs | 4 ++++ .../Beatmaps/ManiaBeatmapConverter.cs | 4 ++++ .../Beatmaps/OsuBeatmapConverter.cs | 8 +++++-- .../Beatmaps/TaikoBeatmapConverter.cs | 2 ++ osu.Game/Beatmaps/IBeatmapConverter.cs | 21 +++++++++++++++++ .../Modes/Objects/Legacy/LegacySpinner.cs | 7 ++++-- .../Modes/Objects/LegacyHitObjectParser.cs | 1 + osu.Game/Modes/UI/HitRenderer.cs | 13 ++++++++++- osu.Game/Screens/Play/Player.cs | 23 ++++++++++++------- 9 files changed, 70 insertions(+), 13 deletions(-) diff --git a/osu.Game.Modes.Catch/Beatmaps/CatchBeatmapConverter.cs b/osu.Game.Modes.Catch/Beatmaps/CatchBeatmapConverter.cs index 9791554f02..c2e77d60ed 100644 --- a/osu.Game.Modes.Catch/Beatmaps/CatchBeatmapConverter.cs +++ b/osu.Game.Modes.Catch/Beatmaps/CatchBeatmapConverter.cs @@ -4,11 +4,15 @@ using osu.Game.Beatmaps; using osu.Game.Modes.Catch.Objects; using System.Collections.Generic; +using System; +using osu.Game.Modes.Objects; namespace osu.Game.Modes.Catch.Beatmaps { internal class CatchBeatmapConverter : IBeatmapConverter { + public IEnumerable ValidConversionTypes { get; } = new[] { typeof(HitObject) }; + public Beatmap Convert(Beatmap original) { return new Beatmap(original) diff --git a/osu.Game.Modes.Mania/Beatmaps/ManiaBeatmapConverter.cs b/osu.Game.Modes.Mania/Beatmaps/ManiaBeatmapConverter.cs index 3ff210c1cc..21a324fc1c 100644 --- a/osu.Game.Modes.Mania/Beatmaps/ManiaBeatmapConverter.cs +++ b/osu.Game.Modes.Mania/Beatmaps/ManiaBeatmapConverter.cs @@ -4,11 +4,15 @@ using osu.Game.Beatmaps; using osu.Game.Modes.Mania.Objects; using System.Collections.Generic; +using System; +using osu.Game.Modes.Objects; namespace osu.Game.Modes.Mania.Beatmaps { internal class ManiaBeatmapConverter : IBeatmapConverter { + public IEnumerable ValidConversionTypes { get; } = new[] { typeof(HitObject) }; + public Beatmap Convert(Beatmap original) { return new Beatmap(original) diff --git a/osu.Game.Modes.Osu/Beatmaps/OsuBeatmapConverter.cs b/osu.Game.Modes.Osu/Beatmaps/OsuBeatmapConverter.cs index bae12a98e3..20ebebd521 100644 --- a/osu.Game.Modes.Osu/Beatmaps/OsuBeatmapConverter.cs +++ b/osu.Game.Modes.Osu/Beatmaps/OsuBeatmapConverter.cs @@ -9,11 +9,14 @@ using osu.Game.Modes.Osu.Objects.Drawables; using System.Collections.Generic; using osu.Game.Modes.Objects.Types; using System.Linq; +using System; namespace osu.Game.Modes.Osu.Beatmaps { internal class OsuBeatmapConverter : IBeatmapConverter { + public IEnumerable ValidConversionTypes { get; } = new[] { typeof(IHasPosition) }; + public Beatmap Convert(Beatmap original) { return new Beatmap(original) @@ -56,8 +59,9 @@ namespace osu.Game.Modes.Osu.Beatmaps { StartTime = original.StartTime, Samples = original.Samples, - Position = new Vector2(512, 384) / 2, - EndTime = endTimeData.EndTime + EndTime = endTimeData.EndTime, + + Position = positionData?.Position ?? new Vector2(512, 384) / 2, }; } diff --git a/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapConverter.cs b/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapConverter.cs index aee06ad796..a56ca43805 100644 --- a/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapConverter.cs +++ b/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapConverter.cs @@ -38,6 +38,8 @@ namespace osu.Game.Modes.Taiko.Beatmaps /// private const float taiko_base_distance = 100; + public IEnumerable ValidConversionTypes { get; } = new[] { typeof(HitObject) }; + public Beatmap Convert(Beatmap original) { BeatmapInfo info = original.BeatmapInfo.DeepClone(); diff --git a/osu.Game/Beatmaps/IBeatmapConverter.cs b/osu.Game/Beatmaps/IBeatmapConverter.cs index 72b248cfba..fbd6a60327 100644 --- a/osu.Game/Beatmaps/IBeatmapConverter.cs +++ b/osu.Game/Beatmaps/IBeatmapConverter.cs @@ -1,6 +1,9 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System; +using System.Collections.Generic; +using System.Linq; using osu.Game.Modes.Objects; namespace osu.Game.Beatmaps @@ -11,6 +14,12 @@ namespace osu.Game.Beatmaps /// The type of HitObject stored in the Beatmap. public interface IBeatmapConverter where T : HitObject { + /// + /// The type of HitObjects that can be converted to be used for this Beatmap. + /// + /// + IEnumerable ValidConversionTypes { get; } + /// /// Converts a Beatmap to another mode. /// @@ -18,4 +27,16 @@ namespace osu.Game.Beatmaps /// The converted Beatmap. Beatmap Convert(Beatmap original); } + + public static class BeatmapConverterExtensions + { + /// + /// Checks if a Beatmap can be converted using a Beatmap Converter. + /// + /// The Converter to use. + /// The Beatmap to check. + /// Whether the Beatmap can be converted using . + public static bool CanConvert(this IBeatmapConverter converter, Beatmap beatmap) where TObject : HitObject + => converter.ValidConversionTypes.All(t => beatmap.HitObjects.Any(h => t.IsAssignableFrom(h.GetType()))); + } } diff --git a/osu.Game/Modes/Objects/Legacy/LegacySpinner.cs b/osu.Game/Modes/Objects/Legacy/LegacySpinner.cs index 8f65d5e8a1..196706f157 100644 --- a/osu.Game/Modes/Objects/Legacy/LegacySpinner.cs +++ b/osu.Game/Modes/Objects/Legacy/LegacySpinner.cs @@ -1,4 +1,5 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +using OpenTK; +// Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Modes.Objects.Types; @@ -8,10 +9,12 @@ namespace osu.Game.Modes.Objects.Legacy /// /// Legacy Spinner-type, used for parsing Beatmaps. /// - internal class LegacySpinner : HitObject, IHasEndTime + internal class LegacySpinner : HitObject, IHasEndTime, IHasPosition { public double EndTime { get; set; } public double Duration => EndTime - StartTime; + + public Vector2 Position { get; set; } } } diff --git a/osu.Game/Modes/Objects/LegacyHitObjectParser.cs b/osu.Game/Modes/Objects/LegacyHitObjectParser.cs index 2316e5dc5d..580c09c646 100644 --- a/osu.Game/Modes/Objects/LegacyHitObjectParser.cs +++ b/osu.Game/Modes/Objects/LegacyHitObjectParser.cs @@ -100,6 +100,7 @@ namespace osu.Game.Modes.Objects { result = new LegacySpinner { + Position = new Vector2(512, 384) / 2, EndTime = Convert.ToDouble(split[5], CultureInfo.InvariantCulture) }; diff --git a/osu.Game/Modes/UI/HitRenderer.cs b/osu.Game/Modes/UI/HitRenderer.cs index 6962c80d87..98a6c35135 100644 --- a/osu.Game/Modes/UI/HitRenderer.cs +++ b/osu.Game/Modes/UI/HitRenderer.cs @@ -122,6 +122,10 @@ namespace osu.Game.Modes.UI IBeatmapConverter converter = CreateBeatmapConverter(); IBeatmapProcessor processor = CreateBeatmapProcessor(); + // Check if the beatmap can be converted + if (!converter.CanConvert(beatmap.Beatmap)) + throw new BeatmapInvalidForModeException($"{nameof(Beatmap)} can't be converted to the current mode."); + // Convert the beatmap Beatmap = converter.Convert(beatmap.Beatmap); @@ -136,7 +140,6 @@ namespace osu.Game.Modes.UI applyMods(beatmap.Mods.Value); } - /// /// Applies the active mods to this HitRenderer. /// @@ -268,4 +271,12 @@ namespace osu.Game.Modes.UI /// The Playfield. protected abstract Playfield CreatePlayfield(); } + + public class BeatmapInvalidForModeException : Exception + { + public BeatmapInvalidForModeException(string text) + : base(text) + { + } + } } diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index b32548c31a..7c95a09e31 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -60,8 +60,8 @@ namespace osu.Game.Screens.Play private PauseOverlay pauseOverlay; private FailOverlay failOverlay; - [BackgroundDependencyLoader] - private void load(AudioManager audio, BeatmapDatabase beatmaps, OsuConfigManager config) + [BackgroundDependencyLoader(permitNulls: true)] + private void load(AudioManager audio, BeatmapDatabase beatmaps, OsuConfigManager config, OsuGame osu) { dimLevel = config.GetBindable(OsuConfig.DimLevel); mouseWheelDisabled = config.GetBindable(OsuConfig.MouseDisableWheel); @@ -76,6 +76,19 @@ namespace osu.Game.Screens.Play if (Beatmap == null) throw new Exception("Beatmap was not loaded"); + + try + { + // Try using the preferred user ruleset + ruleset = osu == null ? Beatmap.BeatmapInfo.Ruleset : osu.Ruleset; + HitRenderer = ruleset.CreateHitRendererWith(Beatmap); + } + catch (BeatmapInvalidForModeException) + { + // Default to the beatmap ruleset + ruleset = Beatmap.BeatmapInfo.Ruleset; + HitRenderer = ruleset.CreateHitRendererWith(Beatmap); + } } catch (Exception e) { @@ -102,12 +115,6 @@ namespace osu.Game.Screens.Play sourceClock.Reset(); }); - ruleset = Beatmap.BeatmapInfo.Ruleset.CreateInstance(); - - // Todo: This should be done as early as possible, and should check if the hit renderer - // can actually convert the hit objects... Somehow... - HitRenderer = ruleset.CreateHitRendererWith(Beatmap); - scoreProcessor = HitRenderer.CreateScoreProcessor(); hudOverlay = new StandardHudOverlay() From 09208adf81543c9635bc95a82ee5a0da9b2ccc35 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Mon, 17 Apr 2017 17:23:11 +0900 Subject: [PATCH 17/45] Re-implement legacy hit object conversion. --- .../Beatmaps/OsuBeatmapConverter.cs | 4 ++ osu.Game.Modes.Osu/Objects/OsuHitObject.cs | 3 + .../Beatmaps/Formats/OsuLegacyDecoderTest.cs | 28 ++++++---- osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs | 22 +++++++- osu.Game/Modes/Objects/Legacy/Catch/Hit.cs | 17 ++++++ .../Objects/Legacy/Catch/HitObjectParser.cs | 42 ++++++++++++++ osu.Game/Modes/Objects/Legacy/Catch/Slider.cs | 17 ++++++ .../Modes/Objects/Legacy/Catch/Spinner.cs | 17 ++++++ .../HitObjectParser.cs} | 55 +++++++------------ ...egacyHitObjectType.cs => HitObjectType.cs} | 2 +- .../Objects/Legacy/{LegacyHold.cs => Hold.cs} | 6 +- osu.Game/Modes/Objects/Legacy/Mania/Hit.cs | 17 ++++++ .../Objects/Legacy/Mania/HitObjectParser.cs | 40 ++++++++++++++ osu.Game/Modes/Objects/Legacy/Mania/Slider.cs | 17 ++++++ .../{LegacySpinner.cs => Mania/Spinner.cs} | 9 ++- .../Legacy/{LegacyHit.cs => Osu/Hit.cs} | 8 ++- .../Objects/Legacy/Osu/HitObjectParser.cs | 43 +++++++++++++++ .../Legacy/{LegacySlider.cs => Osu/Slider.cs} | 8 ++- osu.Game/Modes/Objects/Legacy/Osu/Spinner.cs | 24 ++++++++ osu.Game/Modes/Objects/Legacy/Taiko/Hit.cs | 15 +++++ .../Objects/Legacy/Taiko/HitObjectParser.cs | 40 ++++++++++++++ osu.Game/Modes/Objects/Legacy/Taiko/Slider.cs | 15 +++++ .../Modes/Objects/Legacy/Taiko/Spinner.cs | 17 ++++++ osu.Game/Modes/Objects/Types/IHasColumn.cs | 10 ++++ osu.Game/Modes/Objects/Types/IHasPosition.cs | 2 +- osu.Game/Modes/Objects/Types/IHasXPosition.cs | 14 +++++ osu.Game/Modes/Objects/Types/IHasYPosition.cs | 14 +++++ osu.Game/osu.Game.csproj | 28 ++++++++-- 28 files changed, 467 insertions(+), 67 deletions(-) create mode 100644 osu.Game/Modes/Objects/Legacy/Catch/Hit.cs create mode 100644 osu.Game/Modes/Objects/Legacy/Catch/HitObjectParser.cs create mode 100644 osu.Game/Modes/Objects/Legacy/Catch/Slider.cs create mode 100644 osu.Game/Modes/Objects/Legacy/Catch/Spinner.cs rename osu.Game/Modes/Objects/{LegacyHitObjectParser.cs => Legacy/HitObjectParser.cs} (73%) rename osu.Game/Modes/Objects/Legacy/{LegacyHitObjectType.cs => HitObjectType.cs} (87%) rename osu.Game/Modes/Objects/Legacy/{LegacyHold.cs => Hold.cs} (71%) create mode 100644 osu.Game/Modes/Objects/Legacy/Mania/Hit.cs create mode 100644 osu.Game/Modes/Objects/Legacy/Mania/HitObjectParser.cs create mode 100644 osu.Game/Modes/Objects/Legacy/Mania/Slider.cs rename osu.Game/Modes/Objects/Legacy/{LegacySpinner.cs => Mania/Spinner.cs} (57%) rename osu.Game/Modes/Objects/Legacy/{LegacyHit.cs => Osu/Hit.cs} (65%) create mode 100644 osu.Game/Modes/Objects/Legacy/Osu/HitObjectParser.cs rename osu.Game/Modes/Objects/Legacy/{LegacySlider.cs => Osu/Slider.cs} (64%) create mode 100644 osu.Game/Modes/Objects/Legacy/Osu/Spinner.cs create mode 100644 osu.Game/Modes/Objects/Legacy/Taiko/Hit.cs create mode 100644 osu.Game/Modes/Objects/Legacy/Taiko/HitObjectParser.cs create mode 100644 osu.Game/Modes/Objects/Legacy/Taiko/Slider.cs create mode 100644 osu.Game/Modes/Objects/Legacy/Taiko/Spinner.cs create mode 100644 osu.Game/Modes/Objects/Types/IHasColumn.cs create mode 100644 osu.Game/Modes/Objects/Types/IHasXPosition.cs create mode 100644 osu.Game/Modes/Objects/Types/IHasYPosition.cs diff --git a/osu.Game.Modes.Osu/Beatmaps/OsuBeatmapConverter.cs b/osu.Game.Modes.Osu/Beatmaps/OsuBeatmapConverter.cs index 20ebebd521..d5d02f9eda 100644 --- a/osu.Game.Modes.Osu/Beatmaps/OsuBeatmapConverter.cs +++ b/osu.Game.Modes.Osu/Beatmaps/OsuBeatmapConverter.cs @@ -36,6 +36,10 @@ namespace osu.Game.Modes.Osu.Beatmaps private OsuHitObject convertHitObject(HitObject original) { + OsuHitObject originalOsu = original as OsuHitObject; + if (originalOsu != null) + return originalOsu; + IHasCurve curveData = original as IHasCurve; IHasEndTime endTimeData = original as IHasEndTime; IHasPosition positionData = original as IHasPosition; diff --git a/osu.Game.Modes.Osu/Objects/OsuHitObject.cs b/osu.Game.Modes.Osu/Objects/OsuHitObject.cs index fa422834db..5e45d04390 100644 --- a/osu.Game.Modes.Osu/Objects/OsuHitObject.cs +++ b/osu.Game.Modes.Osu/Objects/OsuHitObject.cs @@ -8,6 +8,7 @@ using osu.Game.Modes.Objects.Types; using OpenTK.Graphics; using osu.Game.Beatmaps.Timing; using osu.Game.Database; +using System; namespace osu.Game.Modes.Osu.Objects { @@ -21,6 +22,8 @@ namespace osu.Game.Modes.Osu.Objects private const double hit_window_300 = 30; public Vector2 Position { get; set; } + public float X => Position.X; + public float Y => Position.Y; public Vector2 StackedPosition => Position + StackOffset; diff --git a/osu.Game.Tests/Beatmaps/Formats/OsuLegacyDecoderTest.cs b/osu.Game.Tests/Beatmaps/Formats/OsuLegacyDecoderTest.cs index 5e94a4dd77..873f3f8559 100644 --- a/osu.Game.Tests/Beatmaps/Formats/OsuLegacyDecoderTest.cs +++ b/osu.Game.Tests/Beatmaps/Formats/OsuLegacyDecoderTest.cs @@ -10,6 +10,8 @@ using osu.Game.Tests.Resources; using osu.Game.Modes.Objects.Legacy; using System.Linq; using osu.Game.Audio; +using osu.Game.Modes.Objects; +using osu.Game.Modes.Objects.Types; namespace osu.Game.Tests.Beatmaps.Formats { @@ -130,16 +132,22 @@ namespace osu.Game.Tests.Beatmaps.Formats using (var stream = Resource.OpenResource("Soleily - Renatus (Gamu) [Insane].osu")) { var beatmap = decoder.Decode(new StreamReader(stream)); - var slider = beatmap.HitObjects[0] as LegacySlider; - Assert.IsNotNull(slider); - Assert.AreEqual(new Vector2(192, 168), slider.Position); - Assert.AreEqual(956, slider.StartTime); - Assert.IsTrue(slider.Samples.Any(s => s.Name == SampleInfo.HIT_NORMAL)); - var hit = beatmap.HitObjects[1] as LegacyHit; - Assert.IsNotNull(hit); - Assert.AreEqual(new Vector2(304, 56), hit.Position); - Assert.AreEqual(1285, hit.StartTime); - Assert.IsTrue(hit.Samples.Any(s => s.Name == SampleInfo.HIT_CLAP)); + + var curveData = beatmap.HitObjects[0] as IHasCurve; + var positionData = beatmap.HitObjects[0] as IHasPosition; + + Assert.IsNotNull(positionData); + Assert.IsNotNull(curveData); + Assert.AreEqual(new Vector2(192, 168), positionData.Position); + Assert.AreEqual(956, beatmap.HitObjects[0].StartTime); + Assert.IsTrue(beatmap.HitObjects[0].Samples.Any(s => s.Name == SampleInfo.HIT_NORMAL)); + + positionData = beatmap.HitObjects[1] as IHasPosition; + + Assert.IsNotNull(positionData); + Assert.AreEqual(new Vector2(304, 56), positionData.Position); + Assert.AreEqual(1285, beatmap.HitObjects[1].StartTime); + Assert.IsTrue(beatmap.HitObjects[1].Samples.Any(s => s.Name == SampleInfo.HIT_CLAP)); } } } diff --git a/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs b/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs index 8ad5f8e7c0..11fa4825d2 100644 --- a/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs +++ b/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs @@ -7,8 +7,8 @@ using System.IO; using OpenTK.Graphics; using osu.Game.Beatmaps.Events; using osu.Game.Beatmaps.Timing; -using osu.Game.Modes.Objects; using osu.Game.Beatmaps.Legacy; +using osu.Game.Modes.Objects.Legacy; namespace osu.Game.Beatmaps.Formats { @@ -29,6 +29,8 @@ namespace osu.Game.Beatmaps.Formats // TODO: Not sure how far back to go, or differences between versions } + private HitObjectParser parser; + private LegacySampleBank defaultSampleBank; private int defaultSampleVolume = 100; @@ -84,6 +86,22 @@ namespace osu.Game.Beatmaps.Formats break; case @"Mode": beatmap.BeatmapInfo.RulesetID = int.Parse(val); + + switch (beatmap.BeatmapInfo.Mode) + { + case 0: + parser = new Modes.Objects.Legacy.Osu.HitObjectParser(); + break; + case 1: + parser = new Modes.Objects.Legacy.Taiko.HitObjectParser(); + break; + case 2: + parser = new Modes.Objects.Legacy.Catch.HitObjectParser(); + break; + case 3: + parser = new Modes.Objects.Legacy.Mania.HitObjectParser(); + break; + } break; case @"LetterboxInBreaks": beatmap.BeatmapInfo.LetterboxInBreaks = int.Parse(val) == 1; @@ -303,8 +321,6 @@ namespace osu.Game.Beatmaps.Formats { beatmap.BeatmapInfo.BeatmapVersion = beatmapVersion; - HitObjectParser parser = new LegacyHitObjectParser(); - Section section = Section.None; bool hasCustomColours = false; diff --git a/osu.Game/Modes/Objects/Legacy/Catch/Hit.cs b/osu.Game/Modes/Objects/Legacy/Catch/Hit.cs new file mode 100644 index 0000000000..1b44675c37 --- /dev/null +++ b/osu.Game/Modes/Objects/Legacy/Catch/Hit.cs @@ -0,0 +1,17 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Modes.Objects.Types; + +namespace osu.Game.Modes.Objects.Legacy.Catch +{ + /// + /// Legacy Hit-type, used for parsing Beatmaps. + /// + internal sealed class Hit : HitObject, IHasCombo, IHasXPosition + { + public float X { get; set; } + + public bool NewCombo { get; set; } + } +} diff --git a/osu.Game/Modes/Objects/Legacy/Catch/HitObjectParser.cs b/osu.Game/Modes/Objects/Legacy/Catch/HitObjectParser.cs new file mode 100644 index 0000000000..f84b333d97 --- /dev/null +++ b/osu.Game/Modes/Objects/Legacy/Catch/HitObjectParser.cs @@ -0,0 +1,42 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System.Collections.Generic; +using OpenTK; +using osu.Game.Modes.Objects.Types; + +namespace osu.Game.Modes.Objects.Legacy.Catch +{ + internal class HitObjectParser : Legacy.HitObjectParser + { + protected override HitObject CreateHit(Vector2 position, bool newCombo) + { + return new Hit + { + X = position.X, + NewCombo = newCombo, + }; + } + + protected override HitObject CreateSlider(Vector2 position, bool newCombo, List controlPoints, double length, CurveType curveType, int repeatCount) + { + return new Slider + { + X = position.X, + NewCombo = newCombo, + ControlPoints = controlPoints, + Distance = length, + CurveType = curveType, + RepeatCount = repeatCount + }; + } + + protected override HitObject CreateSpinner(Vector2 position, double endTime) + { + return new Spinner + { + EndTime = endTime + }; + } + } +} diff --git a/osu.Game/Modes/Objects/Legacy/Catch/Slider.cs b/osu.Game/Modes/Objects/Legacy/Catch/Slider.cs new file mode 100644 index 0000000000..9216abd18a --- /dev/null +++ b/osu.Game/Modes/Objects/Legacy/Catch/Slider.cs @@ -0,0 +1,17 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Modes.Objects.Types; + +namespace osu.Game.Modes.Objects.Legacy.Catch +{ + /// + /// Legacy Slider-type, used for parsing Beatmaps. + /// + internal sealed class Slider : CurvedHitObject, IHasXPosition, IHasCombo + { + public float X { get; set; } + + public bool NewCombo { get; set; } + } +} diff --git a/osu.Game/Modes/Objects/Legacy/Catch/Spinner.cs b/osu.Game/Modes/Objects/Legacy/Catch/Spinner.cs new file mode 100644 index 0000000000..c5e8f396c1 --- /dev/null +++ b/osu.Game/Modes/Objects/Legacy/Catch/Spinner.cs @@ -0,0 +1,17 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Modes.Objects.Types; + +namespace osu.Game.Modes.Objects.Legacy.Catch +{ + /// + /// Legacy Spinner-type, used for parsing Beatmaps. + /// + internal class Spinner : HitObject, IHasEndTime + { + public double EndTime { get; set; } + + public double Duration => EndTime - StartTime; + } +} diff --git a/osu.Game/Modes/Objects/LegacyHitObjectParser.cs b/osu.Game/Modes/Objects/Legacy/HitObjectParser.cs similarity index 73% rename from osu.Game/Modes/Objects/LegacyHitObjectParser.cs rename to osu.Game/Modes/Objects/Legacy/HitObjectParser.cs index 580c09c646..6db7caeb3e 100644 --- a/osu.Game/Modes/Objects/LegacyHitObjectParser.cs +++ b/osu.Game/Modes/Objects/Legacy/HitObjectParser.cs @@ -6,20 +6,19 @@ using osu.Game.Modes.Objects.Types; using System; using System.Collections.Generic; using System.Globalization; -using osu.Game.Modes.Objects.Legacy; using osu.Game.Beatmaps.Formats; using osu.Game.Audio; -namespace osu.Game.Modes.Objects +namespace osu.Game.Modes.Objects.Legacy { - internal class LegacyHitObjectParser : HitObjectParser + internal abstract class HitObjectParser : Objects.HitObjectParser { public override HitObject Parse(string text) { string[] split = text.Split(','); - var type = (LegacyHitObjectType)int.Parse(split[3]) & ~LegacyHitObjectType.ColourHax; - bool combo = type.HasFlag(LegacyHitObjectType.NewCombo); - type &= ~LegacyHitObjectType.NewCombo; + var type = (HitObjectType)int.Parse(split[3]) & ~HitObjectType.ColourHax; + bool combo = type.HasFlag(HitObjectType.NewCombo); + type &= ~HitObjectType.NewCombo; int sampleVolume = 0; string normalSampleBank = null; @@ -27,22 +26,18 @@ namespace osu.Game.Modes.Objects HitObject result; - if ((type & LegacyHitObjectType.Circle) > 0) + if ((type & HitObjectType.Circle) > 0) { - result = new LegacyHit - { - Position = new Vector2(int.Parse(split[0]), int.Parse(split[1])), - NewCombo = combo - }; + result = CreateHit(new Vector2(int.Parse(split[0]), int.Parse(split[1])), combo); if (split.Length > 5) readCustomSampleBanks(split[5], ref normalSampleBank, ref addSampleBank, ref sampleVolume); } - else if ((type & LegacyHitObjectType.Slider) > 0) + else if ((type & HitObjectType.Slider) > 0) { CurveType curveType = CurveType.Catmull; double length = 0; - List points = new List { new Vector2(int.Parse(split[0]), int.Parse(split[1])) }; + var points = new List { new Vector2(int.Parse(split[0]), int.Parse(split[1])) }; string[] pointsplit = split[5].Split('|'); foreach (string t in pointsplit) @@ -68,11 +63,7 @@ namespace osu.Game.Modes.Objects } string[] temp = t.Split(':'); - Vector2 v = new Vector2( - (int)Convert.ToDouble(temp[0], CultureInfo.InvariantCulture), - (int)Convert.ToDouble(temp[1], CultureInfo.InvariantCulture) - ); - points.Add(v); + points.Add(new Vector2((int)Convert.ToDouble(temp[0], CultureInfo.InvariantCulture), (int)Convert.ToDouble(temp[1], CultureInfo.InvariantCulture))); } int repeatCount = Convert.ToInt32(split[6], CultureInfo.InvariantCulture); @@ -83,38 +74,26 @@ namespace osu.Game.Modes.Objects if (split.Length > 7) length = Convert.ToDouble(split[7], CultureInfo.InvariantCulture); - result = new LegacySlider - { - ControlPoints = points, - Distance = length, - CurveType = curveType, - RepeatCount = repeatCount, - Position = new Vector2(int.Parse(split[0]), int.Parse(split[1])), - NewCombo = combo - }; + result = CreateSlider(new Vector2(int.Parse(split[0]), int.Parse(split[1])), combo, points, length, curveType, repeatCount); if (split.Length > 10) readCustomSampleBanks(split[10], ref normalSampleBank, ref addSampleBank, ref sampleVolume); } - else if ((type & LegacyHitObjectType.Spinner) > 0) + else if ((type & HitObjectType.Spinner) > 0) { - result = new LegacySpinner - { - Position = new Vector2(512, 384) / 2, - EndTime = Convert.ToDouble(split[5], CultureInfo.InvariantCulture) - }; + result = CreateSpinner(new Vector2(512, 384) / 2, Convert.ToDouble(split[5], CultureInfo.InvariantCulture)); if (split.Length > 6) readCustomSampleBanks(split[6], ref normalSampleBank, ref addSampleBank, ref sampleVolume); } - else if ((type & LegacyHitObjectType.Hold) > 0) + else if ((type & HitObjectType.Hold) > 0) { // Note: Hold is generated by BMS converts // Todo: Apparently end time is determined by samples?? // Shouldn't need implementation until mania - result = new LegacyHold + result = new Hold { Position = new Vector2(int.Parse(split[0]), int.Parse(split[1])), NewCombo = combo @@ -167,6 +146,10 @@ namespace osu.Game.Modes.Objects return result; } + protected abstract HitObject CreateHit(Vector2 position, bool newCombo); + protected abstract HitObject CreateSlider(Vector2 position, bool newCombo, List controlPoints, double length, CurveType curveType, int repeatCount); + protected abstract HitObject CreateSpinner(Vector2 position, double endTime); + private void readCustomSampleBanks(string str, ref string normalSampleBank, ref string addSampleBank, ref int sampleVolume) { if (string.IsNullOrEmpty(str)) diff --git a/osu.Game/Modes/Objects/Legacy/LegacyHitObjectType.cs b/osu.Game/Modes/Objects/Legacy/HitObjectType.cs similarity index 87% rename from osu.Game/Modes/Objects/Legacy/LegacyHitObjectType.cs rename to osu.Game/Modes/Objects/Legacy/HitObjectType.cs index 416e1abe76..e203b57c62 100644 --- a/osu.Game/Modes/Objects/Legacy/LegacyHitObjectType.cs +++ b/osu.Game/Modes/Objects/Legacy/HitObjectType.cs @@ -6,7 +6,7 @@ using System; namespace osu.Game.Modes.Objects.Legacy { [Flags] - public enum LegacyHitObjectType + public enum HitObjectType { Circle = 1 << 0, Slider = 1 << 1, diff --git a/osu.Game/Modes/Objects/Legacy/LegacyHold.cs b/osu.Game/Modes/Objects/Legacy/Hold.cs similarity index 71% rename from osu.Game/Modes/Objects/Legacy/LegacyHold.cs rename to osu.Game/Modes/Objects/Legacy/Hold.cs index 4f858c16f1..6014bf7201 100644 --- a/osu.Game/Modes/Objects/Legacy/LegacyHold.cs +++ b/osu.Game/Modes/Objects/Legacy/Hold.cs @@ -9,10 +9,14 @@ namespace osu.Game.Modes.Objects.Legacy /// /// Legacy Hold-type, used for parsing "specials" in beatmaps. /// - public sealed class LegacyHold : HitObject, IHasPosition, IHasCombo, IHasHold + internal sealed class Hold : HitObject, IHasPosition, IHasCombo, IHasHold { public Vector2 Position { get; set; } + public float X => Position.X; + + public float Y => Position.Y; + public bool NewCombo { get; set; } } } diff --git a/osu.Game/Modes/Objects/Legacy/Mania/Hit.cs b/osu.Game/Modes/Objects/Legacy/Mania/Hit.cs new file mode 100644 index 0000000000..b892434151 --- /dev/null +++ b/osu.Game/Modes/Objects/Legacy/Mania/Hit.cs @@ -0,0 +1,17 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Modes.Objects.Types; + +namespace osu.Game.Modes.Objects.Legacy.Mania +{ + /// + /// Legacy Hit-type, used for parsing Beatmaps. + /// + internal sealed class Hit : HitObject, IHasColumn, IHasCombo + { + public int Column { get; set; } + + public bool NewCombo { get; set; } + } +} diff --git a/osu.Game/Modes/Objects/Legacy/Mania/HitObjectParser.cs b/osu.Game/Modes/Objects/Legacy/Mania/HitObjectParser.cs new file mode 100644 index 0000000000..572657fe9b --- /dev/null +++ b/osu.Game/Modes/Objects/Legacy/Mania/HitObjectParser.cs @@ -0,0 +1,40 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System.Collections.Generic; +using OpenTK; +using osu.Game.Modes.Objects.Types; + +namespace osu.Game.Modes.Objects.Legacy.Mania +{ + internal class HitObjectParser : Legacy.HitObjectParser + { + protected override HitObject CreateHit(Vector2 position, bool newCombo) + { + return new Hit + { + NewCombo = newCombo, + }; + } + + protected override HitObject CreateSlider(Vector2 position, bool newCombo, List controlPoints, double length, CurveType curveType, int repeatCount) + { + return new Slider + { + NewCombo = newCombo, + ControlPoints = controlPoints, + Distance = length, + CurveType = curveType, + RepeatCount = repeatCount + }; + } + + protected override HitObject CreateSpinner(Vector2 position, double endTime) + { + return new Spinner + { + EndTime = endTime + }; + } + } +} diff --git a/osu.Game/Modes/Objects/Legacy/Mania/Slider.cs b/osu.Game/Modes/Objects/Legacy/Mania/Slider.cs new file mode 100644 index 0000000000..cd0f4e95cb --- /dev/null +++ b/osu.Game/Modes/Objects/Legacy/Mania/Slider.cs @@ -0,0 +1,17 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Modes.Objects.Types; + +namespace osu.Game.Modes.Objects.Legacy.Mania +{ + /// + /// Legacy Slider-type, used for parsing Beatmaps. + /// + internal sealed class Slider : CurvedHitObject, IHasColumn, IHasCombo + { + public int Column { get; set; } + + public bool NewCombo { get; set; } + } +} diff --git a/osu.Game/Modes/Objects/Legacy/LegacySpinner.cs b/osu.Game/Modes/Objects/Legacy/Mania/Spinner.cs similarity index 57% rename from osu.Game/Modes/Objects/Legacy/LegacySpinner.cs rename to osu.Game/Modes/Objects/Legacy/Mania/Spinner.cs index 196706f157..7234ebc711 100644 --- a/osu.Game/Modes/Objects/Legacy/LegacySpinner.cs +++ b/osu.Game/Modes/Objects/Legacy/Mania/Spinner.cs @@ -1,20 +1,19 @@ -using OpenTK; -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Modes.Objects.Types; -namespace osu.Game.Modes.Objects.Legacy +namespace osu.Game.Modes.Objects.Legacy.Mania { /// /// Legacy Spinner-type, used for parsing Beatmaps. /// - internal class LegacySpinner : HitObject, IHasEndTime, IHasPosition + internal class Spinner : HitObject, IHasEndTime, IHasColumn { public double EndTime { get; set; } public double Duration => EndTime - StartTime; - public Vector2 Position { get; set; } + public int Column { get; set; } } } diff --git a/osu.Game/Modes/Objects/Legacy/LegacyHit.cs b/osu.Game/Modes/Objects/Legacy/Osu/Hit.cs similarity index 65% rename from osu.Game/Modes/Objects/Legacy/LegacyHit.cs rename to osu.Game/Modes/Objects/Legacy/Osu/Hit.cs index 239c8982da..2b59497a0a 100644 --- a/osu.Game/Modes/Objects/Legacy/LegacyHit.cs +++ b/osu.Game/Modes/Objects/Legacy/Osu/Hit.cs @@ -4,15 +4,19 @@ using osu.Game.Modes.Objects.Types; using OpenTK; -namespace osu.Game.Modes.Objects.Legacy +namespace osu.Game.Modes.Objects.Legacy.Osu { /// /// Legacy Hit-type, used for parsing Beatmaps. /// - public sealed class LegacyHit : HitObject, IHasPosition, IHasCombo + internal sealed class Hit : HitObject, IHasPosition, IHasCombo { public Vector2 Position { get; set; } + public float X => Position.X; + + public float Y => Position.Y; + public bool NewCombo { get; set; } } } diff --git a/osu.Game/Modes/Objects/Legacy/Osu/HitObjectParser.cs b/osu.Game/Modes/Objects/Legacy/Osu/HitObjectParser.cs new file mode 100644 index 0000000000..362339ffd9 --- /dev/null +++ b/osu.Game/Modes/Objects/Legacy/Osu/HitObjectParser.cs @@ -0,0 +1,43 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using OpenTK; +using osu.Game.Modes.Objects.Types; +using System.Collections.Generic; + +namespace osu.Game.Modes.Objects.Legacy.Osu +{ + internal class HitObjectParser : Legacy.HitObjectParser + { + protected override HitObject CreateHit(Vector2 position, bool newCombo) + { + return new Hit + { + Position = position, + NewCombo = newCombo, + }; + } + + protected override HitObject CreateSlider(Vector2 position, bool newCombo, List controlPoints, double length, CurveType curveType, int repeatCount) + { + return new Slider + { + Position = position, + NewCombo = newCombo, + ControlPoints = controlPoints, + Distance = length, + CurveType = curveType, + RepeatCount = repeatCount + }; + } + + protected override HitObject CreateSpinner(Vector2 position, double endTime) + { + return new Spinner + { + Position = position, + EndTime = endTime + }; + } + } +} diff --git a/osu.Game/Modes/Objects/Legacy/LegacySlider.cs b/osu.Game/Modes/Objects/Legacy/Osu/Slider.cs similarity index 64% rename from osu.Game/Modes/Objects/Legacy/LegacySlider.cs rename to osu.Game/Modes/Objects/Legacy/Osu/Slider.cs index bdfebb1983..5f7b5306ab 100644 --- a/osu.Game/Modes/Objects/Legacy/LegacySlider.cs +++ b/osu.Game/Modes/Objects/Legacy/Osu/Slider.cs @@ -4,15 +4,19 @@ using osu.Game.Modes.Objects.Types; using OpenTK; -namespace osu.Game.Modes.Objects.Legacy +namespace osu.Game.Modes.Objects.Legacy.Osu { /// /// Legacy Slider-type, used for parsing Beatmaps. /// - public sealed class LegacySlider : CurvedHitObject, IHasPosition, IHasCombo + internal sealed class Slider : CurvedHitObject, IHasPosition, IHasCombo { public Vector2 Position { get; set; } + public float X => Position.X; + + public float Y => Position.Y; + public bool NewCombo { get; set; } } } diff --git a/osu.Game/Modes/Objects/Legacy/Osu/Spinner.cs b/osu.Game/Modes/Objects/Legacy/Osu/Spinner.cs new file mode 100644 index 0000000000..8da93428c4 --- /dev/null +++ b/osu.Game/Modes/Objects/Legacy/Osu/Spinner.cs @@ -0,0 +1,24 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Modes.Objects.Types; +using OpenTK; + +namespace osu.Game.Modes.Objects.Legacy.Osu +{ + /// + /// Legacy Spinner-type, used for parsing Beatmaps. + /// + internal class Spinner : HitObject, IHasEndTime, IHasPosition + { + public double EndTime { get; set; } + + public double Duration => EndTime - StartTime; + + public Vector2 Position { get; set; } + + public float X => Position.X; + + public float Y => Position.Y; + } +} diff --git a/osu.Game/Modes/Objects/Legacy/Taiko/Hit.cs b/osu.Game/Modes/Objects/Legacy/Taiko/Hit.cs new file mode 100644 index 0000000000..7d0f7d88ee --- /dev/null +++ b/osu.Game/Modes/Objects/Legacy/Taiko/Hit.cs @@ -0,0 +1,15 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Modes.Objects.Types; + +namespace osu.Game.Modes.Objects.Legacy.Taiko +{ + /// + /// Legacy Hit-type, used for parsing Beatmaps. + /// + internal sealed class Hit : HitObject, IHasCombo + { + public bool NewCombo { get; set; } + } +} diff --git a/osu.Game/Modes/Objects/Legacy/Taiko/HitObjectParser.cs b/osu.Game/Modes/Objects/Legacy/Taiko/HitObjectParser.cs new file mode 100644 index 0000000000..6f98dad58d --- /dev/null +++ b/osu.Game/Modes/Objects/Legacy/Taiko/HitObjectParser.cs @@ -0,0 +1,40 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using OpenTK; +using osu.Game.Modes.Objects.Types; +using System.Collections.Generic; + +namespace osu.Game.Modes.Objects.Legacy.Taiko +{ + internal class HitObjectParser : Legacy.HitObjectParser + { + protected override HitObject CreateHit(Vector2 position, bool newCombo) + { + return new Hit + { + NewCombo = newCombo, + }; + } + + protected override HitObject CreateSlider(Vector2 position, bool newCombo, List controlPoints, double length, CurveType curveType, int repeatCount) + { + return new Slider + { + NewCombo = newCombo, + ControlPoints = controlPoints, + Distance = length, + CurveType = curveType, + RepeatCount = repeatCount + }; + } + + protected override HitObject CreateSpinner(Vector2 position, double endTime) + { + return new Spinner + { + EndTime = endTime + }; + } + } +} diff --git a/osu.Game/Modes/Objects/Legacy/Taiko/Slider.cs b/osu.Game/Modes/Objects/Legacy/Taiko/Slider.cs new file mode 100644 index 0000000000..ac7c7cb89e --- /dev/null +++ b/osu.Game/Modes/Objects/Legacy/Taiko/Slider.cs @@ -0,0 +1,15 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Modes.Objects.Types; + +namespace osu.Game.Modes.Objects.Legacy.Taiko +{ + /// + /// Legacy Slider-type, used for parsing Beatmaps. + /// + internal sealed class Slider : CurvedHitObject, IHasCombo + { + public bool NewCombo { get; set; } + } +} diff --git a/osu.Game/Modes/Objects/Legacy/Taiko/Spinner.cs b/osu.Game/Modes/Objects/Legacy/Taiko/Spinner.cs new file mode 100644 index 0000000000..62d827c435 --- /dev/null +++ b/osu.Game/Modes/Objects/Legacy/Taiko/Spinner.cs @@ -0,0 +1,17 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Modes.Objects.Types; + +namespace osu.Game.Modes.Objects.Legacy.Taiko +{ + /// + /// Legacy Spinner-type, used for parsing Beatmaps. + /// + internal class Spinner : HitObject, IHasEndTime + { + public double EndTime { get; set; } + + public double Duration => EndTime - StartTime; + } +} diff --git a/osu.Game/Modes/Objects/Types/IHasColumn.cs b/osu.Game/Modes/Objects/Types/IHasColumn.cs new file mode 100644 index 0000000000..b446d9db53 --- /dev/null +++ b/osu.Game/Modes/Objects/Types/IHasColumn.cs @@ -0,0 +1,10 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +namespace osu.Game.Modes.Objects.Types +{ + public interface IHasColumn + { + int Column { get; } + } +} diff --git a/osu.Game/Modes/Objects/Types/IHasPosition.cs b/osu.Game/Modes/Objects/Types/IHasPosition.cs index 8138bf6662..094370a090 100644 --- a/osu.Game/Modes/Objects/Types/IHasPosition.cs +++ b/osu.Game/Modes/Objects/Types/IHasPosition.cs @@ -8,7 +8,7 @@ namespace osu.Game.Modes.Objects.Types /// /// A HitObject that has a starting position. /// - public interface IHasPosition + public interface IHasPosition : IHasXPosition, IHasYPosition { /// /// The starting position of the HitObject. diff --git a/osu.Game/Modes/Objects/Types/IHasXPosition.cs b/osu.Game/Modes/Objects/Types/IHasXPosition.cs new file mode 100644 index 0000000000..03a562c8b7 --- /dev/null +++ b/osu.Game/Modes/Objects/Types/IHasXPosition.cs @@ -0,0 +1,14 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + + +namespace osu.Game.Modes.Objects.Types +{ + /// + /// A HitObject that has a starting X-position. + /// + public interface IHasXPosition + { + float X { get; } + } +} diff --git a/osu.Game/Modes/Objects/Types/IHasYPosition.cs b/osu.Game/Modes/Objects/Types/IHasYPosition.cs new file mode 100644 index 0000000000..38ddd3bdf5 --- /dev/null +++ b/osu.Game/Modes/Objects/Types/IHasYPosition.cs @@ -0,0 +1,14 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + + +namespace osu.Game.Modes.Objects.Types +{ + /// + /// A HitObject that has a starting Y-position. + /// + public interface IHasYPosition + { + float Y { get; } + } +} diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 193c2c1179..f259a37bb0 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -104,6 +104,22 @@ + + + + + + + + + + + + + + + + @@ -115,11 +131,11 @@ - - - - - + + + + + @@ -132,7 +148,7 @@ - + From 04973ae65e26b9d0cc2fac113daa83712cfe093a Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Mon, 17 Apr 2017 17:25:29 +0900 Subject: [PATCH 18/45] Fix conversion types for Catch and Mania. --- osu.Game.Modes.Catch/Beatmaps/CatchBeatmapConverter.cs | 4 ++-- osu.Game.Modes.Mania/Beatmaps/ManiaBeatmapConverter.cs | 4 ++-- osu.Game/Beatmaps/IBeatmapConverter.cs | 5 ++--- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/osu.Game.Modes.Catch/Beatmaps/CatchBeatmapConverter.cs b/osu.Game.Modes.Catch/Beatmaps/CatchBeatmapConverter.cs index c2e77d60ed..59991af3ce 100644 --- a/osu.Game.Modes.Catch/Beatmaps/CatchBeatmapConverter.cs +++ b/osu.Game.Modes.Catch/Beatmaps/CatchBeatmapConverter.cs @@ -5,13 +5,13 @@ using osu.Game.Beatmaps; using osu.Game.Modes.Catch.Objects; using System.Collections.Generic; using System; -using osu.Game.Modes.Objects; +using osu.Game.Modes.Objects.Types; namespace osu.Game.Modes.Catch.Beatmaps { internal class CatchBeatmapConverter : IBeatmapConverter { - public IEnumerable ValidConversionTypes { get; } = new[] { typeof(HitObject) }; + public IEnumerable ValidConversionTypes { get; } = new[] { typeof(IHasXPosition) }; public Beatmap Convert(Beatmap original) { diff --git a/osu.Game.Modes.Mania/Beatmaps/ManiaBeatmapConverter.cs b/osu.Game.Modes.Mania/Beatmaps/ManiaBeatmapConverter.cs index 21a324fc1c..bbe39e6772 100644 --- a/osu.Game.Modes.Mania/Beatmaps/ManiaBeatmapConverter.cs +++ b/osu.Game.Modes.Mania/Beatmaps/ManiaBeatmapConverter.cs @@ -5,13 +5,13 @@ using osu.Game.Beatmaps; using osu.Game.Modes.Mania.Objects; using System.Collections.Generic; using System; -using osu.Game.Modes.Objects; +using osu.Game.Modes.Objects.Types; namespace osu.Game.Modes.Mania.Beatmaps { internal class ManiaBeatmapConverter : IBeatmapConverter { - public IEnumerable ValidConversionTypes { get; } = new[] { typeof(HitObject) }; + public IEnumerable ValidConversionTypes { get; } = new[] { typeof(IHasColumn) }; public Beatmap Convert(Beatmap original) { diff --git a/osu.Game/Beatmaps/IBeatmapConverter.cs b/osu.Game/Beatmaps/IBeatmapConverter.cs index fbd6a60327..815eab9c71 100644 --- a/osu.Game/Beatmaps/IBeatmapConverter.cs +++ b/osu.Game/Beatmaps/IBeatmapConverter.cs @@ -15,9 +15,8 @@ namespace osu.Game.Beatmaps public interface IBeatmapConverter where T : HitObject { /// - /// The type of HitObjects that can be converted to be used for this Beatmap. + /// The types of HitObjects that can be converted to be used for this Beatmap. /// - /// IEnumerable ValidConversionTypes { get; } /// @@ -35,7 +34,7 @@ namespace osu.Game.Beatmaps /// /// The Converter to use. /// The Beatmap to check. - /// Whether the Beatmap can be converted using . + /// Whether the Beatmap can be converted using . public static bool CanConvert(this IBeatmapConverter converter, Beatmap beatmap) where TObject : HitObject => converter.ValidConversionTypes.All(t => beatmap.HitObjects.Any(h => t.IsAssignableFrom(h.GetType()))); } From 786446354ea5640a1d58d4f8ffda32dba2bc44ee Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Tue, 18 Apr 2017 09:00:53 +0900 Subject: [PATCH 19/45] Fix post-rebase errors. --- osu.Game.Tests/Beatmaps/Formats/OsuLegacyDecoderTest.cs | 2 -- osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs | 2 +- osu.Game/Screens/Play/Player.cs | 4 ++-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/osu.Game.Tests/Beatmaps/Formats/OsuLegacyDecoderTest.cs b/osu.Game.Tests/Beatmaps/Formats/OsuLegacyDecoderTest.cs index 873f3f8559..f7a62fe999 100644 --- a/osu.Game.Tests/Beatmaps/Formats/OsuLegacyDecoderTest.cs +++ b/osu.Game.Tests/Beatmaps/Formats/OsuLegacyDecoderTest.cs @@ -7,10 +7,8 @@ using OpenTK; using OpenTK.Graphics; using osu.Game.Beatmaps.Formats; using osu.Game.Tests.Resources; -using osu.Game.Modes.Objects.Legacy; using System.Linq; using osu.Game.Audio; -using osu.Game.Modes.Objects; using osu.Game.Modes.Objects.Types; namespace osu.Game.Tests.Beatmaps.Formats diff --git a/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs b/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs index 11fa4825d2..758d2205ac 100644 --- a/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs +++ b/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs @@ -87,7 +87,7 @@ namespace osu.Game.Beatmaps.Formats case @"Mode": beatmap.BeatmapInfo.RulesetID = int.Parse(val); - switch (beatmap.BeatmapInfo.Mode) + switch (beatmap.BeatmapInfo.RulesetID) { case 0: parser = new Modes.Objects.Legacy.Osu.HitObjectParser(); diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 7c95a09e31..eea6775063 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -80,13 +80,13 @@ namespace osu.Game.Screens.Play try { // Try using the preferred user ruleset - ruleset = osu == null ? Beatmap.BeatmapInfo.Ruleset : osu.Ruleset; + ruleset = osu == null ? Beatmap.BeatmapInfo.Ruleset.CreateInstance() : osu.Ruleset.Value.CreateInstance(); HitRenderer = ruleset.CreateHitRendererWith(Beatmap); } catch (BeatmapInvalidForModeException) { // Default to the beatmap ruleset - ruleset = Beatmap.BeatmapInfo.Ruleset; + ruleset = Beatmap.BeatmapInfo.Ruleset.CreateInstance(); HitRenderer = ruleset.CreateHitRendererWith(Beatmap); } } From c61e3265bbc2e7aea740f3b8a136843422136c8c Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Tue, 18 Apr 2017 09:13:36 +0900 Subject: [PATCH 20/45] A few xmldoc additions/fixes. --- osu.Game/Beatmaps/IBeatmapConverter.cs | 4 +-- osu.Game/Modes/Objects/Legacy/Catch/Hit.cs | 2 +- .../Objects/Legacy/Catch/HitObjectParser.cs | 5 ++- osu.Game/Modes/Objects/Legacy/Catch/Slider.cs | 2 +- .../Modes/Objects/Legacy/Catch/Spinner.cs | 4 +-- .../Modes/Objects/Legacy/HitObjectParser.cs | 35 ++++++++++++++++--- osu.Game/Modes/Objects/Legacy/Mania/Hit.cs | 2 +- .../Objects/Legacy/Mania/HitObjectParser.cs | 5 ++- osu.Game/Modes/Objects/Legacy/Mania/Slider.cs | 2 +- .../Modes/Objects/Legacy/Mania/Spinner.cs | 4 +-- osu.Game/Modes/Objects/Legacy/Osu/Hit.cs | 2 +- .../Objects/Legacy/Osu/HitObjectParser.cs | 3 ++ osu.Game/Modes/Objects/Legacy/Osu/Slider.cs | 2 +- osu.Game/Modes/Objects/Legacy/Osu/Spinner.cs | 4 +-- osu.Game/Modes/Objects/Legacy/Taiko/Hit.cs | 2 +- .../Objects/Legacy/Taiko/HitObjectParser.cs | 3 ++ osu.Game/Modes/Objects/Legacy/Taiko/Slider.cs | 2 +- .../Modes/Objects/Legacy/Taiko/Spinner.cs | 4 +-- osu.Game/Modes/Objects/Types/IHasColumn.cs | 6 ++++ osu.Game/Modes/Objects/Types/IHasXPosition.cs | 3 ++ osu.Game/Modes/Objects/Types/IHasYPosition.cs | 3 ++ 21 files changed, 75 insertions(+), 24 deletions(-) diff --git a/osu.Game/Beatmaps/IBeatmapConverter.cs b/osu.Game/Beatmaps/IBeatmapConverter.cs index 815eab9c71..948e55967e 100644 --- a/osu.Game/Beatmaps/IBeatmapConverter.cs +++ b/osu.Game/Beatmaps/IBeatmapConverter.cs @@ -30,9 +30,9 @@ namespace osu.Game.Beatmaps public static class BeatmapConverterExtensions { /// - /// Checks if a Beatmap can be converted using a Beatmap Converter. + /// Checks if a Beatmap can be converted using this Beatmap Converter. /// - /// The Converter to use. + /// The Beatmap Converter. /// The Beatmap to check. /// Whether the Beatmap can be converted using . public static bool CanConvert(this IBeatmapConverter converter, Beatmap beatmap) where TObject : HitObject diff --git a/osu.Game/Modes/Objects/Legacy/Catch/Hit.cs b/osu.Game/Modes/Objects/Legacy/Catch/Hit.cs index 1b44675c37..dba7926a79 100644 --- a/osu.Game/Modes/Objects/Legacy/Catch/Hit.cs +++ b/osu.Game/Modes/Objects/Legacy/Catch/Hit.cs @@ -6,7 +6,7 @@ using osu.Game.Modes.Objects.Types; namespace osu.Game.Modes.Objects.Legacy.Catch { /// - /// Legacy Hit-type, used for parsing Beatmaps. + /// Legacy osu!catch Hit-type, used for parsing Beatmaps. /// internal sealed class Hit : HitObject, IHasCombo, IHasXPosition { diff --git a/osu.Game/Modes/Objects/Legacy/Catch/HitObjectParser.cs b/osu.Game/Modes/Objects/Legacy/Catch/HitObjectParser.cs index f84b333d97..0ef4ed0646 100644 --- a/osu.Game/Modes/Objects/Legacy/Catch/HitObjectParser.cs +++ b/osu.Game/Modes/Objects/Legacy/Catch/HitObjectParser.cs @@ -1,12 +1,15 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System.Collections.Generic; using OpenTK; using osu.Game.Modes.Objects.Types; +using System.Collections.Generic; namespace osu.Game.Modes.Objects.Legacy.Catch { + /// + /// A HitObjectParser to parse legacy osu!catch Beatmaps. + /// internal class HitObjectParser : Legacy.HitObjectParser { protected override HitObject CreateHit(Vector2 position, bool newCombo) diff --git a/osu.Game/Modes/Objects/Legacy/Catch/Slider.cs b/osu.Game/Modes/Objects/Legacy/Catch/Slider.cs index 9216abd18a..de71198851 100644 --- a/osu.Game/Modes/Objects/Legacy/Catch/Slider.cs +++ b/osu.Game/Modes/Objects/Legacy/Catch/Slider.cs @@ -6,7 +6,7 @@ using osu.Game.Modes.Objects.Types; namespace osu.Game.Modes.Objects.Legacy.Catch { /// - /// Legacy Slider-type, used for parsing Beatmaps. + /// Legacy osu!catch Slider-type, used for parsing Beatmaps. /// internal sealed class Slider : CurvedHitObject, IHasXPosition, IHasCombo { diff --git a/osu.Game/Modes/Objects/Legacy/Catch/Spinner.cs b/osu.Game/Modes/Objects/Legacy/Catch/Spinner.cs index c5e8f396c1..a99804a243 100644 --- a/osu.Game/Modes/Objects/Legacy/Catch/Spinner.cs +++ b/osu.Game/Modes/Objects/Legacy/Catch/Spinner.cs @@ -6,9 +6,9 @@ using osu.Game.Modes.Objects.Types; namespace osu.Game.Modes.Objects.Legacy.Catch { /// - /// Legacy Spinner-type, used for parsing Beatmaps. + /// Legacy osu!catch Spinner-type, used for parsing Beatmaps. /// - internal class Spinner : HitObject, IHasEndTime + internal sealed class Spinner : HitObject, IHasEndTime { public double EndTime { get; set; } diff --git a/osu.Game/Modes/Objects/Legacy/HitObjectParser.cs b/osu.Game/Modes/Objects/Legacy/HitObjectParser.cs index 6db7caeb3e..ec89a63c7a 100644 --- a/osu.Game/Modes/Objects/Legacy/HitObjectParser.cs +++ b/osu.Game/Modes/Objects/Legacy/HitObjectParser.cs @@ -11,6 +11,9 @@ using osu.Game.Audio; namespace osu.Game.Modes.Objects.Legacy { + /// + /// A HitObjectParser to parse legacy Beatmaps. + /// internal abstract class HitObjectParser : Objects.HitObjectParser { public override HitObject Parse(string text) @@ -146,10 +149,6 @@ namespace osu.Game.Modes.Objects.Legacy return result; } - protected abstract HitObject CreateHit(Vector2 position, bool newCombo); - protected abstract HitObject CreateSlider(Vector2 position, bool newCombo, List controlPoints, double length, CurveType curveType, int repeatCount); - protected abstract HitObject CreateSpinner(Vector2 position, double endTime); - private void readCustomSampleBanks(string str, ref string normalSampleBank, ref string addSampleBank, ref int sampleVolume) { if (string.IsNullOrEmpty(str)) @@ -175,6 +174,34 @@ namespace osu.Game.Modes.Objects.Legacy sampleVolume = split.Length > 3 ? int.Parse(split[3]) : 0; } + /// + /// Creates a legacy Hit-type hit object. + /// + /// The position of the hit object. + /// Whether the hit object creates a new combo. + /// The hit object. + protected abstract HitObject CreateHit(Vector2 position, bool newCombo); + + /// + /// Creats a legacy Slider-type hit object. + /// + /// The position of the hit object. + /// Whether the hit object creates a new combo. + /// The slider control points. + /// The slider length. + /// The slider curve type. + /// The slider repeat count. + /// The hit object. + protected abstract HitObject CreateSlider(Vector2 position, bool newCombo, List controlPoints, double length, CurveType curveType, int repeatCount); + + /// + /// Creates a legacy Spinner-type hit object. + /// + /// The position of the hit object. + /// The spinner end time. + /// The hit object. + protected abstract HitObject CreateSpinner(Vector2 position, double endTime); + [Flags] private enum LegacySoundType { diff --git a/osu.Game/Modes/Objects/Legacy/Mania/Hit.cs b/osu.Game/Modes/Objects/Legacy/Mania/Hit.cs index b892434151..acf9777fbf 100644 --- a/osu.Game/Modes/Objects/Legacy/Mania/Hit.cs +++ b/osu.Game/Modes/Objects/Legacy/Mania/Hit.cs @@ -6,7 +6,7 @@ using osu.Game.Modes.Objects.Types; namespace osu.Game.Modes.Objects.Legacy.Mania { /// - /// Legacy Hit-type, used for parsing Beatmaps. + /// Legacy osu!mania Hit-type, used for parsing Beatmaps. /// internal sealed class Hit : HitObject, IHasColumn, IHasCombo { diff --git a/osu.Game/Modes/Objects/Legacy/Mania/HitObjectParser.cs b/osu.Game/Modes/Objects/Legacy/Mania/HitObjectParser.cs index 572657fe9b..7ef923633c 100644 --- a/osu.Game/Modes/Objects/Legacy/Mania/HitObjectParser.cs +++ b/osu.Game/Modes/Objects/Legacy/Mania/HitObjectParser.cs @@ -1,12 +1,15 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System.Collections.Generic; using OpenTK; using osu.Game.Modes.Objects.Types; +using System.Collections.Generic; namespace osu.Game.Modes.Objects.Legacy.Mania { + /// + /// A HitObjectParser to parse legacy osu!mania Beatmaps. + /// internal class HitObjectParser : Legacy.HitObjectParser { protected override HitObject CreateHit(Vector2 position, bool newCombo) diff --git a/osu.Game/Modes/Objects/Legacy/Mania/Slider.cs b/osu.Game/Modes/Objects/Legacy/Mania/Slider.cs index cd0f4e95cb..f320ac1d59 100644 --- a/osu.Game/Modes/Objects/Legacy/Mania/Slider.cs +++ b/osu.Game/Modes/Objects/Legacy/Mania/Slider.cs @@ -6,7 +6,7 @@ using osu.Game.Modes.Objects.Types; namespace osu.Game.Modes.Objects.Legacy.Mania { /// - /// Legacy Slider-type, used for parsing Beatmaps. + /// Legacy osu!mania Slider-type, used for parsing Beatmaps. /// internal sealed class Slider : CurvedHitObject, IHasColumn, IHasCombo { diff --git a/osu.Game/Modes/Objects/Legacy/Mania/Spinner.cs b/osu.Game/Modes/Objects/Legacy/Mania/Spinner.cs index 7234ebc711..1df5907860 100644 --- a/osu.Game/Modes/Objects/Legacy/Mania/Spinner.cs +++ b/osu.Game/Modes/Objects/Legacy/Mania/Spinner.cs @@ -6,9 +6,9 @@ using osu.Game.Modes.Objects.Types; namespace osu.Game.Modes.Objects.Legacy.Mania { /// - /// Legacy Spinner-type, used for parsing Beatmaps. + /// Legacy osu!mania Spinner-type, used for parsing Beatmaps. /// - internal class Spinner : HitObject, IHasEndTime, IHasColumn + internal sealed class Spinner : HitObject, IHasEndTime, IHasColumn { public double EndTime { get; set; } diff --git a/osu.Game/Modes/Objects/Legacy/Osu/Hit.cs b/osu.Game/Modes/Objects/Legacy/Osu/Hit.cs index 2b59497a0a..397273391a 100644 --- a/osu.Game/Modes/Objects/Legacy/Osu/Hit.cs +++ b/osu.Game/Modes/Objects/Legacy/Osu/Hit.cs @@ -7,7 +7,7 @@ using OpenTK; namespace osu.Game.Modes.Objects.Legacy.Osu { /// - /// Legacy Hit-type, used for parsing Beatmaps. + /// Legacy osu! Hit-type, used for parsing Beatmaps. /// internal sealed class Hit : HitObject, IHasPosition, IHasCombo { diff --git a/osu.Game/Modes/Objects/Legacy/Osu/HitObjectParser.cs b/osu.Game/Modes/Objects/Legacy/Osu/HitObjectParser.cs index 362339ffd9..d063ef8c48 100644 --- a/osu.Game/Modes/Objects/Legacy/Osu/HitObjectParser.cs +++ b/osu.Game/Modes/Objects/Legacy/Osu/HitObjectParser.cs @@ -7,6 +7,9 @@ using System.Collections.Generic; namespace osu.Game.Modes.Objects.Legacy.Osu { + /// + /// A HitObjectParser to parse legacy osu! Beatmaps. + /// internal class HitObjectParser : Legacy.HitObjectParser { protected override HitObject CreateHit(Vector2 position, bool newCombo) diff --git a/osu.Game/Modes/Objects/Legacy/Osu/Slider.cs b/osu.Game/Modes/Objects/Legacy/Osu/Slider.cs index 5f7b5306ab..24deda85bf 100644 --- a/osu.Game/Modes/Objects/Legacy/Osu/Slider.cs +++ b/osu.Game/Modes/Objects/Legacy/Osu/Slider.cs @@ -7,7 +7,7 @@ using OpenTK; namespace osu.Game.Modes.Objects.Legacy.Osu { /// - /// Legacy Slider-type, used for parsing Beatmaps. + /// Legacy osu! Slider-type, used for parsing Beatmaps. /// internal sealed class Slider : CurvedHitObject, IHasPosition, IHasCombo { diff --git a/osu.Game/Modes/Objects/Legacy/Osu/Spinner.cs b/osu.Game/Modes/Objects/Legacy/Osu/Spinner.cs index 8da93428c4..c1c2b34b7c 100644 --- a/osu.Game/Modes/Objects/Legacy/Osu/Spinner.cs +++ b/osu.Game/Modes/Objects/Legacy/Osu/Spinner.cs @@ -7,9 +7,9 @@ using OpenTK; namespace osu.Game.Modes.Objects.Legacy.Osu { /// - /// Legacy Spinner-type, used for parsing Beatmaps. + /// Legacy osu! Spinner-type, used for parsing Beatmaps. /// - internal class Spinner : HitObject, IHasEndTime, IHasPosition + internal sealed class Spinner : HitObject, IHasEndTime, IHasPosition { public double EndTime { get; set; } diff --git a/osu.Game/Modes/Objects/Legacy/Taiko/Hit.cs b/osu.Game/Modes/Objects/Legacy/Taiko/Hit.cs index 7d0f7d88ee..73f9b67630 100644 --- a/osu.Game/Modes/Objects/Legacy/Taiko/Hit.cs +++ b/osu.Game/Modes/Objects/Legacy/Taiko/Hit.cs @@ -6,7 +6,7 @@ using osu.Game.Modes.Objects.Types; namespace osu.Game.Modes.Objects.Legacy.Taiko { /// - /// Legacy Hit-type, used for parsing Beatmaps. + /// Legacy osu!taiko Hit-type, used for parsing Beatmaps. /// internal sealed class Hit : HitObject, IHasCombo { diff --git a/osu.Game/Modes/Objects/Legacy/Taiko/HitObjectParser.cs b/osu.Game/Modes/Objects/Legacy/Taiko/HitObjectParser.cs index 6f98dad58d..80b5b9d1cb 100644 --- a/osu.Game/Modes/Objects/Legacy/Taiko/HitObjectParser.cs +++ b/osu.Game/Modes/Objects/Legacy/Taiko/HitObjectParser.cs @@ -7,6 +7,9 @@ using System.Collections.Generic; namespace osu.Game.Modes.Objects.Legacy.Taiko { + /// + /// A HitObjectParser to parse legacy osu!taiko Beatmaps. + /// internal class HitObjectParser : Legacy.HitObjectParser { protected override HitObject CreateHit(Vector2 position, bool newCombo) diff --git a/osu.Game/Modes/Objects/Legacy/Taiko/Slider.cs b/osu.Game/Modes/Objects/Legacy/Taiko/Slider.cs index ac7c7cb89e..b173101fce 100644 --- a/osu.Game/Modes/Objects/Legacy/Taiko/Slider.cs +++ b/osu.Game/Modes/Objects/Legacy/Taiko/Slider.cs @@ -6,7 +6,7 @@ using osu.Game.Modes.Objects.Types; namespace osu.Game.Modes.Objects.Legacy.Taiko { /// - /// Legacy Slider-type, used for parsing Beatmaps. + /// Legacy osu!taiko Slider-type, used for parsing Beatmaps. /// internal sealed class Slider : CurvedHitObject, IHasCombo { diff --git a/osu.Game/Modes/Objects/Legacy/Taiko/Spinner.cs b/osu.Game/Modes/Objects/Legacy/Taiko/Spinner.cs index 62d827c435..b22f4600c9 100644 --- a/osu.Game/Modes/Objects/Legacy/Taiko/Spinner.cs +++ b/osu.Game/Modes/Objects/Legacy/Taiko/Spinner.cs @@ -6,9 +6,9 @@ using osu.Game.Modes.Objects.Types; namespace osu.Game.Modes.Objects.Legacy.Taiko { /// - /// Legacy Spinner-type, used for parsing Beatmaps. + /// Legacy osu!taiko Spinner-type, used for parsing Beatmaps. /// - internal class Spinner : HitObject, IHasEndTime + internal sealed class Spinner : HitObject, IHasEndTime { public double EndTime { get; set; } diff --git a/osu.Game/Modes/Objects/Types/IHasColumn.cs b/osu.Game/Modes/Objects/Types/IHasColumn.cs index b446d9db53..7609a26773 100644 --- a/osu.Game/Modes/Objects/Types/IHasColumn.cs +++ b/osu.Game/Modes/Objects/Types/IHasColumn.cs @@ -3,8 +3,14 @@ namespace osu.Game.Modes.Objects.Types { + /// + /// A HitObject that lies in a column space. + /// public interface IHasColumn { + /// + /// The column which this HitObject lies in. + /// int Column { get; } } } diff --git a/osu.Game/Modes/Objects/Types/IHasXPosition.cs b/osu.Game/Modes/Objects/Types/IHasXPosition.cs index 03a562c8b7..1f75625e93 100644 --- a/osu.Game/Modes/Objects/Types/IHasXPosition.cs +++ b/osu.Game/Modes/Objects/Types/IHasXPosition.cs @@ -9,6 +9,9 @@ namespace osu.Game.Modes.Objects.Types /// public interface IHasXPosition { + /// + /// The starting X-position of this HitObject. + /// float X { get; } } } diff --git a/osu.Game/Modes/Objects/Types/IHasYPosition.cs b/osu.Game/Modes/Objects/Types/IHasYPosition.cs index 38ddd3bdf5..f746acb939 100644 --- a/osu.Game/Modes/Objects/Types/IHasYPosition.cs +++ b/osu.Game/Modes/Objects/Types/IHasYPosition.cs @@ -9,6 +9,9 @@ namespace osu.Game.Modes.Objects.Types /// public interface IHasYPosition { + /// + /// The starting Y-position of this HitObject. + /// float Y { get; } } } From 456aee63caa50e04e809af0eb31aaa9520f98f37 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Tue, 18 Apr 2017 09:32:22 +0900 Subject: [PATCH 21/45] Mode IBeatmapConverter and IBeatmapProcessor to osu.Game.Modes.Beatmaps namespace. --- osu.Game.Modes.Catch/Beatmaps/CatchBeatmapConverter.cs | 1 + osu.Game.Modes.Catch/Beatmaps/CatchBeatmapProcessor.cs | 1 + osu.Game.Modes.Catch/CatchDifficultyCalculator.cs | 1 + osu.Game.Modes.Catch/UI/CatchHitRenderer.cs | 1 + osu.Game.Modes.Mania/Beatmaps/ManiaBeatmapConverter.cs | 1 + osu.Game.Modes.Mania/Beatmaps/ManiaBeatmapProcessor.cs | 1 + osu.Game.Modes.Mania/ManiaDifficultyCalculator.cs | 1 + osu.Game.Modes.Mania/UI/ManiaHitRenderer.cs | 1 + osu.Game.Modes.Osu/Beatmaps/OsuBeatmapConverter.cs | 1 + osu.Game.Modes.Osu/Beatmaps/OsuBeatmapProcessor.cs | 1 + osu.Game.Modes.Osu/OsuDifficultyCalculator.cs | 1 + osu.Game.Modes.Osu/UI/OsuHitRenderer.cs | 1 + osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapConverter.cs | 1 + osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapProcessor.cs | 1 + osu.Game.Modes.Taiko/TaikoDifficultyCalculator.cs | 1 + osu.Game.Modes.Taiko/UI/TaikoHitRenderer.cs | 1 + osu.Game/Beatmaps/DifficultyCalculator.cs | 1 + osu.Game/{ => Modes}/Beatmaps/IBeatmapConverter.cs | 3 ++- osu.Game/{ => Modes}/Beatmaps/IBeatmapProcessor.cs | 3 ++- osu.Game/Modes/UI/HitRenderer.cs | 1 + osu.Game/osu.Game.csproj | 4 ++-- 21 files changed, 24 insertions(+), 4 deletions(-) rename osu.Game/{ => Modes}/Beatmaps/IBeatmapConverter.cs (94%) rename osu.Game/{ => Modes}/Beatmaps/IBeatmapProcessor.cs (90%) diff --git a/osu.Game.Modes.Catch/Beatmaps/CatchBeatmapConverter.cs b/osu.Game.Modes.Catch/Beatmaps/CatchBeatmapConverter.cs index 59991af3ce..e82b3f46ec 100644 --- a/osu.Game.Modes.Catch/Beatmaps/CatchBeatmapConverter.cs +++ b/osu.Game.Modes.Catch/Beatmaps/CatchBeatmapConverter.cs @@ -6,6 +6,7 @@ using osu.Game.Modes.Catch.Objects; using System.Collections.Generic; using System; using osu.Game.Modes.Objects.Types; +using osu.Game.Modes.Beatmaps; namespace osu.Game.Modes.Catch.Beatmaps { diff --git a/osu.Game.Modes.Catch/Beatmaps/CatchBeatmapProcessor.cs b/osu.Game.Modes.Catch/Beatmaps/CatchBeatmapProcessor.cs index ef585e2675..83e179dfce 100644 --- a/osu.Game.Modes.Catch/Beatmaps/CatchBeatmapProcessor.cs +++ b/osu.Game.Modes.Catch/Beatmaps/CatchBeatmapProcessor.cs @@ -2,6 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Beatmaps; +using osu.Game.Modes.Beatmaps; using osu.Game.Modes.Catch.Objects; namespace osu.Game.Modes.Catch.Beatmaps diff --git a/osu.Game.Modes.Catch/CatchDifficultyCalculator.cs b/osu.Game.Modes.Catch/CatchDifficultyCalculator.cs index 53c6f5c2ce..46f89b5575 100644 --- a/osu.Game.Modes.Catch/CatchDifficultyCalculator.cs +++ b/osu.Game.Modes.Catch/CatchDifficultyCalculator.cs @@ -2,6 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Beatmaps; +using osu.Game.Modes.Beatmaps; using osu.Game.Modes.Catch.Beatmaps; using osu.Game.Modes.Catch.Objects; using System.Collections.Generic; diff --git a/osu.Game.Modes.Catch/UI/CatchHitRenderer.cs b/osu.Game.Modes.Catch/UI/CatchHitRenderer.cs index 90bd61a39f..5b5f7ff2eb 100644 --- a/osu.Game.Modes.Catch/UI/CatchHitRenderer.cs +++ b/osu.Game.Modes.Catch/UI/CatchHitRenderer.cs @@ -2,6 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Beatmaps; +using osu.Game.Modes.Beatmaps; using osu.Game.Modes.Catch.Beatmaps; using osu.Game.Modes.Catch.Judgements; using osu.Game.Modes.Catch.Objects; diff --git a/osu.Game.Modes.Mania/Beatmaps/ManiaBeatmapConverter.cs b/osu.Game.Modes.Mania/Beatmaps/ManiaBeatmapConverter.cs index bbe39e6772..188679d47c 100644 --- a/osu.Game.Modes.Mania/Beatmaps/ManiaBeatmapConverter.cs +++ b/osu.Game.Modes.Mania/Beatmaps/ManiaBeatmapConverter.cs @@ -6,6 +6,7 @@ using osu.Game.Modes.Mania.Objects; using System.Collections.Generic; using System; using osu.Game.Modes.Objects.Types; +using osu.Game.Modes.Beatmaps; namespace osu.Game.Modes.Mania.Beatmaps { diff --git a/osu.Game.Modes.Mania/Beatmaps/ManiaBeatmapProcessor.cs b/osu.Game.Modes.Mania/Beatmaps/ManiaBeatmapProcessor.cs index 5e85a8f864..a25f5652fc 100644 --- a/osu.Game.Modes.Mania/Beatmaps/ManiaBeatmapProcessor.cs +++ b/osu.Game.Modes.Mania/Beatmaps/ManiaBeatmapProcessor.cs @@ -2,6 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Beatmaps; +using osu.Game.Modes.Beatmaps; using osu.Game.Modes.Mania.Objects; namespace osu.Game.Modes.Mania.Beatmaps diff --git a/osu.Game.Modes.Mania/ManiaDifficultyCalculator.cs b/osu.Game.Modes.Mania/ManiaDifficultyCalculator.cs index 02a5a3acdc..629c5a3374 100644 --- a/osu.Game.Modes.Mania/ManiaDifficultyCalculator.cs +++ b/osu.Game.Modes.Mania/ManiaDifficultyCalculator.cs @@ -2,6 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Beatmaps; +using osu.Game.Modes.Beatmaps; using osu.Game.Modes.Mania.Beatmaps; using osu.Game.Modes.Mania.Objects; using System.Collections.Generic; diff --git a/osu.Game.Modes.Mania/UI/ManiaHitRenderer.cs b/osu.Game.Modes.Mania/UI/ManiaHitRenderer.cs index 0415bc961a..9cee3bff87 100644 --- a/osu.Game.Modes.Mania/UI/ManiaHitRenderer.cs +++ b/osu.Game.Modes.Mania/UI/ManiaHitRenderer.cs @@ -2,6 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Beatmaps; +using osu.Game.Modes.Beatmaps; using osu.Game.Modes.Mania.Beatmaps; using osu.Game.Modes.Mania.Judgements; using osu.Game.Modes.Mania.Objects; diff --git a/osu.Game.Modes.Osu/Beatmaps/OsuBeatmapConverter.cs b/osu.Game.Modes.Osu/Beatmaps/OsuBeatmapConverter.cs index d5d02f9eda..abb18e8236 100644 --- a/osu.Game.Modes.Osu/Beatmaps/OsuBeatmapConverter.cs +++ b/osu.Game.Modes.Osu/Beatmaps/OsuBeatmapConverter.cs @@ -10,6 +10,7 @@ using System.Collections.Generic; using osu.Game.Modes.Objects.Types; using System.Linq; using System; +using osu.Game.Modes.Beatmaps; namespace osu.Game.Modes.Osu.Beatmaps { diff --git a/osu.Game.Modes.Osu/Beatmaps/OsuBeatmapProcessor.cs b/osu.Game.Modes.Osu/Beatmaps/OsuBeatmapProcessor.cs index 08c9d94141..df8fb58f9e 100644 --- a/osu.Game.Modes.Osu/Beatmaps/OsuBeatmapProcessor.cs +++ b/osu.Game.Modes.Osu/Beatmaps/OsuBeatmapProcessor.cs @@ -2,6 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Beatmaps; +using osu.Game.Modes.Beatmaps; using osu.Game.Modes.Osu.Objects; namespace osu.Game.Modes.Osu.Beatmaps diff --git a/osu.Game.Modes.Osu/OsuDifficultyCalculator.cs b/osu.Game.Modes.Osu/OsuDifficultyCalculator.cs index 7696638082..9b4c6875c8 100644 --- a/osu.Game.Modes.Osu/OsuDifficultyCalculator.cs +++ b/osu.Game.Modes.Osu/OsuDifficultyCalculator.cs @@ -2,6 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Beatmaps; +using osu.Game.Modes.Beatmaps; using osu.Game.Modes.Objects.Types; using osu.Game.Modes.Osu.Beatmaps; using osu.Game.Modes.Osu.Objects; diff --git a/osu.Game.Modes.Osu/UI/OsuHitRenderer.cs b/osu.Game.Modes.Osu/UI/OsuHitRenderer.cs index 7e314c5ba1..0e7772bc11 100644 --- a/osu.Game.Modes.Osu/UI/OsuHitRenderer.cs +++ b/osu.Game.Modes.Osu/UI/OsuHitRenderer.cs @@ -3,6 +3,7 @@ using OpenTK; using osu.Game.Beatmaps; +using osu.Game.Modes.Beatmaps; using osu.Game.Modes.Objects.Drawables; using osu.Game.Modes.Osu.Beatmaps; using osu.Game.Modes.Osu.Judgements; diff --git a/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapConverter.cs b/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapConverter.cs index a56ca43805..25aa296eb7 100644 --- a/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapConverter.cs +++ b/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapConverter.cs @@ -11,6 +11,7 @@ using System.Linq; using osu.Game.Database; using osu.Game.IO.Serialization; using osu.Game.Audio; +using osu.Game.Modes.Beatmaps; namespace osu.Game.Modes.Taiko.Beatmaps { diff --git a/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapProcessor.cs b/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapProcessor.cs index 84bc470e55..6f162c2816 100644 --- a/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapProcessor.cs +++ b/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapProcessor.cs @@ -2,6 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Beatmaps; +using osu.Game.Modes.Beatmaps; using osu.Game.Modes.Taiko.Objects; namespace osu.Game.Modes.Taiko.Beatmaps diff --git a/osu.Game.Modes.Taiko/TaikoDifficultyCalculator.cs b/osu.Game.Modes.Taiko/TaikoDifficultyCalculator.cs index 93dfc3d651..3cc0536fd3 100644 --- a/osu.Game.Modes.Taiko/TaikoDifficultyCalculator.cs +++ b/osu.Game.Modes.Taiko/TaikoDifficultyCalculator.cs @@ -2,6 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Beatmaps; +using osu.Game.Modes.Beatmaps; using osu.Game.Modes.Taiko.Beatmaps; using osu.Game.Modes.Taiko.Objects; using System.Collections.Generic; diff --git a/osu.Game.Modes.Taiko/UI/TaikoHitRenderer.cs b/osu.Game.Modes.Taiko/UI/TaikoHitRenderer.cs index 32476dff7f..6ed43afe7d 100644 --- a/osu.Game.Modes.Taiko/UI/TaikoHitRenderer.cs +++ b/osu.Game.Modes.Taiko/UI/TaikoHitRenderer.cs @@ -18,6 +18,7 @@ using osu.Game.Modes.Taiko.Scoring; using osu.Game.Modes.UI; using osu.Game.Modes.Taiko.Replays; using OpenTK; +using osu.Game.Modes.Beatmaps; namespace osu.Game.Modes.Taiko.UI { diff --git a/osu.Game/Beatmaps/DifficultyCalculator.cs b/osu.Game/Beatmaps/DifficultyCalculator.cs index a9da5c589c..48fdf250f0 100644 --- a/osu.Game/Beatmaps/DifficultyCalculator.cs +++ b/osu.Game/Beatmaps/DifficultyCalculator.cs @@ -1,6 +1,7 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using osu.Game.Modes.Beatmaps; using osu.Game.Modes.Objects; using System.Collections.Generic; diff --git a/osu.Game/Beatmaps/IBeatmapConverter.cs b/osu.Game/Modes/Beatmaps/IBeatmapConverter.cs similarity index 94% rename from osu.Game/Beatmaps/IBeatmapConverter.cs rename to osu.Game/Modes/Beatmaps/IBeatmapConverter.cs index 948e55967e..cfc27c5bdb 100644 --- a/osu.Game/Beatmaps/IBeatmapConverter.cs +++ b/osu.Game/Modes/Beatmaps/IBeatmapConverter.cs @@ -5,8 +5,9 @@ using System; using System.Collections.Generic; using System.Linq; using osu.Game.Modes.Objects; +using osu.Game.Beatmaps; -namespace osu.Game.Beatmaps +namespace osu.Game.Modes.Beatmaps { /// /// Converts a Beatmap for another mode. diff --git a/osu.Game/Beatmaps/IBeatmapProcessor.cs b/osu.Game/Modes/Beatmaps/IBeatmapProcessor.cs similarity index 90% rename from osu.Game/Beatmaps/IBeatmapProcessor.cs rename to osu.Game/Modes/Beatmaps/IBeatmapProcessor.cs index 9157a760b1..c40e7d1c41 100644 --- a/osu.Game/Beatmaps/IBeatmapProcessor.cs +++ b/osu.Game/Modes/Beatmaps/IBeatmapProcessor.cs @@ -1,9 +1,10 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using osu.Game.Beatmaps; using osu.Game.Modes.Objects; -namespace osu.Game.Beatmaps +namespace osu.Game.Modes.Beatmaps { /// /// Processes a post-converted Beatmap. diff --git a/osu.Game/Modes/UI/HitRenderer.cs b/osu.Game/Modes/UI/HitRenderer.cs index 98a6c35135..7ccd29a977 100644 --- a/osu.Game/Modes/UI/HitRenderer.cs +++ b/osu.Game/Modes/UI/HitRenderer.cs @@ -17,6 +17,7 @@ using System.Linq; using osu.Game.Modes.Replays; using osu.Game.Modes.Scoring; using OpenTK; +using osu.Game.Modes.Beatmaps; namespace osu.Game.Modes.UI { diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index f259a37bb0..84589e53a1 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -72,8 +72,8 @@ - - + + From efc050a95a3e69f15dca5c7d7af70a7c0633170c Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Tue, 18 Apr 2017 09:38:52 +0900 Subject: [PATCH 22/45] Make IBeatmapConverter an abstract class instead of an interface. --- .../Beatmaps/CatchBeatmapConverter.cs | 6 +++--- osu.Game.Modes.Catch/CatchDifficultyCalculator.cs | 2 +- osu.Game.Modes.Catch/UI/CatchHitRenderer.cs | 2 +- .../Beatmaps/ManiaBeatmapConverter.cs | 6 +++--- osu.Game.Modes.Mania/ManiaDifficultyCalculator.cs | 2 +- osu.Game.Modes.Mania/UI/ManiaHitRenderer.cs | 2 +- .../Beatmaps/OsuBeatmapConverter.cs | 6 +++--- osu.Game.Modes.Osu/OsuDifficultyCalculator.cs | 2 +- osu.Game.Modes.Osu/UI/OsuHitRenderer.cs | 2 +- .../Beatmaps/TaikoBeatmapConverter.cs | 6 +++--- osu.Game.Modes.Taiko/TaikoDifficultyCalculator.cs | 2 +- osu.Game.Modes.Taiko/UI/TaikoHitRenderer.cs | 2 +- osu.Game/Beatmaps/DifficultyCalculator.cs | 2 +- .../{IBeatmapConverter.cs => BeatmapConverter.cs} | 15 +++++---------- osu.Game/Modes/UI/HitRenderer.cs | 4 ++-- osu.Game/osu.Game.csproj | 2 +- 16 files changed, 29 insertions(+), 34 deletions(-) rename osu.Game/Modes/Beatmaps/{IBeatmapConverter.cs => BeatmapConverter.cs} (63%) diff --git a/osu.Game.Modes.Catch/Beatmaps/CatchBeatmapConverter.cs b/osu.Game.Modes.Catch/Beatmaps/CatchBeatmapConverter.cs index e82b3f46ec..3b7b1c3a29 100644 --- a/osu.Game.Modes.Catch/Beatmaps/CatchBeatmapConverter.cs +++ b/osu.Game.Modes.Catch/Beatmaps/CatchBeatmapConverter.cs @@ -10,11 +10,11 @@ using osu.Game.Modes.Beatmaps; namespace osu.Game.Modes.Catch.Beatmaps { - internal class CatchBeatmapConverter : IBeatmapConverter + internal class CatchBeatmapConverter : BeatmapConverter { - public IEnumerable ValidConversionTypes { get; } = new[] { typeof(IHasXPosition) }; + public override IEnumerable ValidConversionTypes { get; } = new[] { typeof(IHasXPosition) }; - public Beatmap Convert(Beatmap original) + public override Beatmap Convert(Beatmap original) { return new Beatmap(original) { diff --git a/osu.Game.Modes.Catch/CatchDifficultyCalculator.cs b/osu.Game.Modes.Catch/CatchDifficultyCalculator.cs index 46f89b5575..7e47db6259 100644 --- a/osu.Game.Modes.Catch/CatchDifficultyCalculator.cs +++ b/osu.Game.Modes.Catch/CatchDifficultyCalculator.cs @@ -20,6 +20,6 @@ namespace osu.Game.Modes.Catch return 0; } - protected override IBeatmapConverter CreateBeatmapConverter() => new CatchBeatmapConverter(); + protected override BeatmapConverter CreateBeatmapConverter() => new CatchBeatmapConverter(); } } \ No newline at end of file diff --git a/osu.Game.Modes.Catch/UI/CatchHitRenderer.cs b/osu.Game.Modes.Catch/UI/CatchHitRenderer.cs index 5b5f7ff2eb..4b2a93977f 100644 --- a/osu.Game.Modes.Catch/UI/CatchHitRenderer.cs +++ b/osu.Game.Modes.Catch/UI/CatchHitRenderer.cs @@ -22,7 +22,7 @@ namespace osu.Game.Modes.Catch.UI public override ScoreProcessor CreateScoreProcessor() => new CatchScoreProcessor(this); - protected override IBeatmapConverter CreateBeatmapConverter() => new CatchBeatmapConverter(); + protected override BeatmapConverter CreateBeatmapConverter() => new CatchBeatmapConverter(); protected override IBeatmapProcessor CreateBeatmapProcessor() => new CatchBeatmapProcessor(); diff --git a/osu.Game.Modes.Mania/Beatmaps/ManiaBeatmapConverter.cs b/osu.Game.Modes.Mania/Beatmaps/ManiaBeatmapConverter.cs index 188679d47c..6dbf4af6b1 100644 --- a/osu.Game.Modes.Mania/Beatmaps/ManiaBeatmapConverter.cs +++ b/osu.Game.Modes.Mania/Beatmaps/ManiaBeatmapConverter.cs @@ -10,11 +10,11 @@ using osu.Game.Modes.Beatmaps; namespace osu.Game.Modes.Mania.Beatmaps { - internal class ManiaBeatmapConverter : IBeatmapConverter + internal class ManiaBeatmapConverter : BeatmapConverter { - public IEnumerable ValidConversionTypes { get; } = new[] { typeof(IHasColumn) }; + public override IEnumerable ValidConversionTypes { get; } = new[] { typeof(IHasColumn) }; - public Beatmap Convert(Beatmap original) + public override Beatmap Convert(Beatmap original) { return new Beatmap(original) { diff --git a/osu.Game.Modes.Mania/ManiaDifficultyCalculator.cs b/osu.Game.Modes.Mania/ManiaDifficultyCalculator.cs index 629c5a3374..84e5ee2d72 100644 --- a/osu.Game.Modes.Mania/ManiaDifficultyCalculator.cs +++ b/osu.Game.Modes.Mania/ManiaDifficultyCalculator.cs @@ -21,6 +21,6 @@ namespace osu.Game.Modes.Mania return 0; } - protected override IBeatmapConverter CreateBeatmapConverter() => new ManiaBeatmapConverter(); + protected override BeatmapConverter CreateBeatmapConverter() => new ManiaBeatmapConverter(); } } \ No newline at end of file diff --git a/osu.Game.Modes.Mania/UI/ManiaHitRenderer.cs b/osu.Game.Modes.Mania/UI/ManiaHitRenderer.cs index 9cee3bff87..6bc8ab0788 100644 --- a/osu.Game.Modes.Mania/UI/ManiaHitRenderer.cs +++ b/osu.Game.Modes.Mania/UI/ManiaHitRenderer.cs @@ -25,7 +25,7 @@ namespace osu.Game.Modes.Mania.UI public override ScoreProcessor CreateScoreProcessor() => new ManiaScoreProcessor(this); - protected override IBeatmapConverter CreateBeatmapConverter() => new ManiaBeatmapConverter(); + protected override BeatmapConverter CreateBeatmapConverter() => new ManiaBeatmapConverter(); protected override IBeatmapProcessor CreateBeatmapProcessor() => new ManiaBeatmapProcessor(); diff --git a/osu.Game.Modes.Osu/Beatmaps/OsuBeatmapConverter.cs b/osu.Game.Modes.Osu/Beatmaps/OsuBeatmapConverter.cs index abb18e8236..dd8dde5530 100644 --- a/osu.Game.Modes.Osu/Beatmaps/OsuBeatmapConverter.cs +++ b/osu.Game.Modes.Osu/Beatmaps/OsuBeatmapConverter.cs @@ -14,11 +14,11 @@ using osu.Game.Modes.Beatmaps; namespace osu.Game.Modes.Osu.Beatmaps { - internal class OsuBeatmapConverter : IBeatmapConverter + internal class OsuBeatmapConverter : BeatmapConverter { - public IEnumerable ValidConversionTypes { get; } = new[] { typeof(IHasPosition) }; + public override IEnumerable ValidConversionTypes { get; } = new[] { typeof(IHasPosition) }; - public Beatmap Convert(Beatmap original) + public override Beatmap Convert(Beatmap original) { return new Beatmap(original) { diff --git a/osu.Game.Modes.Osu/OsuDifficultyCalculator.cs b/osu.Game.Modes.Osu/OsuDifficultyCalculator.cs index 9b4c6875c8..f3ef47fe27 100644 --- a/osu.Game.Modes.Osu/OsuDifficultyCalculator.cs +++ b/osu.Game.Modes.Osu/OsuDifficultyCalculator.cs @@ -181,7 +181,7 @@ namespace osu.Game.Modes.Osu return difficulty; } - protected override IBeatmapConverter CreateBeatmapConverter() => new OsuBeatmapConverter(); + protected override BeatmapConverter CreateBeatmapConverter() => new OsuBeatmapConverter(); // Those values are used as array indices. Be careful when changing them! public enum DifficultyType diff --git a/osu.Game.Modes.Osu/UI/OsuHitRenderer.cs b/osu.Game.Modes.Osu/UI/OsuHitRenderer.cs index 0e7772bc11..0f73fcdb19 100644 --- a/osu.Game.Modes.Osu/UI/OsuHitRenderer.cs +++ b/osu.Game.Modes.Osu/UI/OsuHitRenderer.cs @@ -25,7 +25,7 @@ namespace osu.Game.Modes.Osu.UI public override ScoreProcessor CreateScoreProcessor() => new OsuScoreProcessor(this); - protected override IBeatmapConverter CreateBeatmapConverter() => new OsuBeatmapConverter(); + protected override BeatmapConverter CreateBeatmapConverter() => new OsuBeatmapConverter(); protected override IBeatmapProcessor CreateBeatmapProcessor() => new OsuBeatmapProcessor(); diff --git a/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapConverter.cs b/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapConverter.cs index 25aa296eb7..c7ff225d0a 100644 --- a/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapConverter.cs +++ b/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapConverter.cs @@ -15,7 +15,7 @@ using osu.Game.Modes.Beatmaps; namespace osu.Game.Modes.Taiko.Beatmaps { - internal class TaikoBeatmapConverter : IBeatmapConverter + internal class TaikoBeatmapConverter : BeatmapConverter { /// /// osu! is generally slower than taiko, so a factor is added to increase @@ -39,9 +39,9 @@ namespace osu.Game.Modes.Taiko.Beatmaps /// private const float taiko_base_distance = 100; - public IEnumerable ValidConversionTypes { get; } = new[] { typeof(HitObject) }; + public override IEnumerable ValidConversionTypes { get; } = new[] { typeof(HitObject) }; - public Beatmap Convert(Beatmap original) + public override Beatmap Convert(Beatmap original) { BeatmapInfo info = original.BeatmapInfo.DeepClone(); info.Difficulty.SliderMultiplier *= legacy_velocity_multiplier; diff --git a/osu.Game.Modes.Taiko/TaikoDifficultyCalculator.cs b/osu.Game.Modes.Taiko/TaikoDifficultyCalculator.cs index 3cc0536fd3..453a937b9e 100644 --- a/osu.Game.Modes.Taiko/TaikoDifficultyCalculator.cs +++ b/osu.Game.Modes.Taiko/TaikoDifficultyCalculator.cs @@ -20,6 +20,6 @@ namespace osu.Game.Modes.Taiko return 0; } - protected override IBeatmapConverter CreateBeatmapConverter() => new TaikoBeatmapConverter(); + protected override BeatmapConverter CreateBeatmapConverter() => new TaikoBeatmapConverter(); } } \ No newline at end of file diff --git a/osu.Game.Modes.Taiko/UI/TaikoHitRenderer.cs b/osu.Game.Modes.Taiko/UI/TaikoHitRenderer.cs index 6ed43afe7d..18cbd30776 100644 --- a/osu.Game.Modes.Taiko/UI/TaikoHitRenderer.cs +++ b/osu.Game.Modes.Taiko/UI/TaikoHitRenderer.cs @@ -115,7 +115,7 @@ namespace osu.Game.Modes.Taiko.UI public override ScoreProcessor CreateScoreProcessor() => new TaikoScoreProcessor(this); - protected override IBeatmapConverter CreateBeatmapConverter() => new TaikoBeatmapConverter(); + protected override BeatmapConverter CreateBeatmapConverter() => new TaikoBeatmapConverter(); protected override IBeatmapProcessor CreateBeatmapProcessor() => new TaikoBeatmapProcessor(); diff --git a/osu.Game/Beatmaps/DifficultyCalculator.cs b/osu.Game/Beatmaps/DifficultyCalculator.cs index 48fdf250f0..911aaa7189 100644 --- a/osu.Game/Beatmaps/DifficultyCalculator.cs +++ b/osu.Game/Beatmaps/DifficultyCalculator.cs @@ -42,6 +42,6 @@ namespace osu.Game.Beatmaps { } - protected abstract IBeatmapConverter CreateBeatmapConverter(); + protected abstract BeatmapConverter CreateBeatmapConverter(); } } diff --git a/osu.Game/Modes/Beatmaps/IBeatmapConverter.cs b/osu.Game/Modes/Beatmaps/BeatmapConverter.cs similarity index 63% rename from osu.Game/Modes/Beatmaps/IBeatmapConverter.cs rename to osu.Game/Modes/Beatmaps/BeatmapConverter.cs index cfc27c5bdb..4a8684864f 100644 --- a/osu.Game/Modes/Beatmaps/IBeatmapConverter.cs +++ b/osu.Game/Modes/Beatmaps/BeatmapConverter.cs @@ -13,30 +13,25 @@ namespace osu.Game.Modes.Beatmaps /// Converts a Beatmap for another mode. /// /// The type of HitObject stored in the Beatmap. - public interface IBeatmapConverter where T : HitObject + public abstract class BeatmapConverter where T : HitObject { /// /// The types of HitObjects that can be converted to be used for this Beatmap. /// - IEnumerable ValidConversionTypes { get; } + public abstract IEnumerable ValidConversionTypes { get; } /// /// Converts a Beatmap to another mode. /// /// The original Beatmap. /// The converted Beatmap. - Beatmap Convert(Beatmap original); - } + public abstract Beatmap Convert(Beatmap original); - public static class BeatmapConverterExtensions - { /// /// Checks if a Beatmap can be converted using this Beatmap Converter. /// - /// The Beatmap Converter. /// The Beatmap to check. - /// Whether the Beatmap can be converted using . - public static bool CanConvert(this IBeatmapConverter converter, Beatmap beatmap) where TObject : HitObject - => converter.ValidConversionTypes.All(t => beatmap.HitObjects.Any(h => t.IsAssignableFrom(h.GetType()))); + /// Whether the Beatmap can be converted using this Beatmap Converter. + public bool CanConvert(Beatmap beatmap) => ValidConversionTypes.All(t => beatmap.HitObjects.Any(h => t.IsAssignableFrom(h.GetType()))); } } diff --git a/osu.Game/Modes/UI/HitRenderer.cs b/osu.Game/Modes/UI/HitRenderer.cs index 7ccd29a977..46d05aa98f 100644 --- a/osu.Game/Modes/UI/HitRenderer.cs +++ b/osu.Game/Modes/UI/HitRenderer.cs @@ -120,7 +120,7 @@ namespace osu.Game.Modes.UI RelativeSizeAxes = Axes.Both; - IBeatmapConverter converter = CreateBeatmapConverter(); + BeatmapConverter converter = CreateBeatmapConverter(); IBeatmapProcessor processor = CreateBeatmapProcessor(); // Check if the beatmap can be converted @@ -158,7 +158,7 @@ namespace osu.Game.Modes.UI /// Creates a converter to convert Beatmap to a specific mode. /// /// The Beatmap converter. - protected abstract IBeatmapConverter CreateBeatmapConverter(); + protected abstract BeatmapConverter CreateBeatmapConverter(); /// /// Creates a processor to perform post-processing operations diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 84589e53a1..770008be5f 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -72,7 +72,7 @@ - + From 0e1ce333e36806e566002316de3f4ea136a6917c Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Tue, 18 Apr 2017 09:43:43 +0900 Subject: [PATCH 23/45] Make IBeatmapProcessor a class with virtual methods. --- .../Beatmaps/CatchBeatmapProcessor.cs | 20 ------------------- osu.Game.Modes.Catch/UI/CatchHitRenderer.cs | 2 -- .../osu.Game.Modes.Catch.csproj | 1 - .../Beatmaps/ManiaBeatmapProcessor.cs | 20 ------------------- osu.Game.Modes.Mania/UI/ManiaHitRenderer.cs | 2 -- .../osu.Game.Modes.Mania.csproj | 1 - .../Beatmaps/OsuBeatmapProcessor.cs | 4 ++-- osu.Game.Modes.Osu/UI/OsuHitRenderer.cs | 2 +- .../Beatmaps/TaikoBeatmapProcessor.cs | 20 ------------------- osu.Game.Modes.Taiko/UI/TaikoHitRenderer.cs | 2 -- .../osu.Game.Modes.Taiko.csproj | 1 - ...eatmapProcessor.cs => BeatmapProcessor.cs} | 4 ++-- osu.Game/Modes/UI/HitRenderer.cs | 16 +++++++-------- osu.Game/osu.Game.csproj | 2 +- 14 files changed, 14 insertions(+), 83 deletions(-) delete mode 100644 osu.Game.Modes.Catch/Beatmaps/CatchBeatmapProcessor.cs delete mode 100644 osu.Game.Modes.Mania/Beatmaps/ManiaBeatmapProcessor.cs delete mode 100644 osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapProcessor.cs rename osu.Game/Modes/Beatmaps/{IBeatmapProcessor.cs => BeatmapProcessor.cs} (85%) diff --git a/osu.Game.Modes.Catch/Beatmaps/CatchBeatmapProcessor.cs b/osu.Game.Modes.Catch/Beatmaps/CatchBeatmapProcessor.cs deleted file mode 100644 index 83e179dfce..0000000000 --- a/osu.Game.Modes.Catch/Beatmaps/CatchBeatmapProcessor.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - -using osu.Game.Beatmaps; -using osu.Game.Modes.Beatmaps; -using osu.Game.Modes.Catch.Objects; - -namespace osu.Game.Modes.Catch.Beatmaps -{ - internal class CatchBeatmapProcessor : IBeatmapProcessor - { - public void SetDefaults(CatchBaseHit hitObject, Beatmap beatmap) - { - } - - public void PostProcess(Beatmap beatmap) - { - } - } -} diff --git a/osu.Game.Modes.Catch/UI/CatchHitRenderer.cs b/osu.Game.Modes.Catch/UI/CatchHitRenderer.cs index 4b2a93977f..795904935d 100644 --- a/osu.Game.Modes.Catch/UI/CatchHitRenderer.cs +++ b/osu.Game.Modes.Catch/UI/CatchHitRenderer.cs @@ -24,8 +24,6 @@ namespace osu.Game.Modes.Catch.UI protected override BeatmapConverter CreateBeatmapConverter() => new CatchBeatmapConverter(); - protected override IBeatmapProcessor CreateBeatmapProcessor() => new CatchBeatmapProcessor(); - protected override Playfield CreatePlayfield() => new CatchPlayfield(); protected override DrawableHitObject GetVisualRepresentation(CatchBaseHit h) => null; diff --git a/osu.Game.Modes.Catch/osu.Game.Modes.Catch.csproj b/osu.Game.Modes.Catch/osu.Game.Modes.Catch.csproj index b3e847a5be..dc1ea5dc23 100644 --- a/osu.Game.Modes.Catch/osu.Game.Modes.Catch.csproj +++ b/osu.Game.Modes.Catch/osu.Game.Modes.Catch.csproj @@ -48,7 +48,6 @@ - diff --git a/osu.Game.Modes.Mania/Beatmaps/ManiaBeatmapProcessor.cs b/osu.Game.Modes.Mania/Beatmaps/ManiaBeatmapProcessor.cs deleted file mode 100644 index a25f5652fc..0000000000 --- a/osu.Game.Modes.Mania/Beatmaps/ManiaBeatmapProcessor.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - -using osu.Game.Beatmaps; -using osu.Game.Modes.Beatmaps; -using osu.Game.Modes.Mania.Objects; - -namespace osu.Game.Modes.Mania.Beatmaps -{ - internal class ManiaBeatmapProcessor : IBeatmapProcessor - { - public void SetDefaults(ManiaBaseHit hitObject, Beatmap beatmap) - { - } - - public void PostProcess(Beatmap beatmap) - { - } - } -} diff --git a/osu.Game.Modes.Mania/UI/ManiaHitRenderer.cs b/osu.Game.Modes.Mania/UI/ManiaHitRenderer.cs index 6bc8ab0788..ada79e992a 100644 --- a/osu.Game.Modes.Mania/UI/ManiaHitRenderer.cs +++ b/osu.Game.Modes.Mania/UI/ManiaHitRenderer.cs @@ -27,8 +27,6 @@ namespace osu.Game.Modes.Mania.UI protected override BeatmapConverter CreateBeatmapConverter() => new ManiaBeatmapConverter(); - protected override IBeatmapProcessor CreateBeatmapProcessor() => new ManiaBeatmapProcessor(); - protected override Playfield CreatePlayfield() => new ManiaPlayfield(columns); protected override DrawableHitObject GetVisualRepresentation(ManiaBaseHit h) => null; diff --git a/osu.Game.Modes.Mania/osu.Game.Modes.Mania.csproj b/osu.Game.Modes.Mania/osu.Game.Modes.Mania.csproj index 6c666fd6ea..a8366a465f 100644 --- a/osu.Game.Modes.Mania/osu.Game.Modes.Mania.csproj +++ b/osu.Game.Modes.Mania/osu.Game.Modes.Mania.csproj @@ -48,7 +48,6 @@ - diff --git a/osu.Game.Modes.Osu/Beatmaps/OsuBeatmapProcessor.cs b/osu.Game.Modes.Osu/Beatmaps/OsuBeatmapProcessor.cs index df8fb58f9e..fd506f3493 100644 --- a/osu.Game.Modes.Osu/Beatmaps/OsuBeatmapProcessor.cs +++ b/osu.Game.Modes.Osu/Beatmaps/OsuBeatmapProcessor.cs @@ -7,9 +7,9 @@ using osu.Game.Modes.Osu.Objects; namespace osu.Game.Modes.Osu.Beatmaps { - internal class OsuBeatmapProcessor : IBeatmapProcessor + internal class OsuBeatmapProcessor : BeatmapProcessor { - public void PostProcess(Beatmap beatmap) + public override void PostProcess(Beatmap beatmap) { if (beatmap.ComboColors.Count == 0) return; diff --git a/osu.Game.Modes.Osu/UI/OsuHitRenderer.cs b/osu.Game.Modes.Osu/UI/OsuHitRenderer.cs index 0f73fcdb19..a514ba6358 100644 --- a/osu.Game.Modes.Osu/UI/OsuHitRenderer.cs +++ b/osu.Game.Modes.Osu/UI/OsuHitRenderer.cs @@ -27,7 +27,7 @@ namespace osu.Game.Modes.Osu.UI protected override BeatmapConverter CreateBeatmapConverter() => new OsuBeatmapConverter(); - protected override IBeatmapProcessor CreateBeatmapProcessor() => new OsuBeatmapProcessor(); + protected override BeatmapProcessor CreateBeatmapProcessor() => new OsuBeatmapProcessor(); protected override Playfield CreatePlayfield() => new OsuPlayfield(); diff --git a/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapProcessor.cs b/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapProcessor.cs deleted file mode 100644 index 6f162c2816..0000000000 --- a/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapProcessor.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - -using osu.Game.Beatmaps; -using osu.Game.Modes.Beatmaps; -using osu.Game.Modes.Taiko.Objects; - -namespace osu.Game.Modes.Taiko.Beatmaps -{ - internal class TaikoBeatmapProcessor : IBeatmapProcessor - { - public void SetDefaults(TaikoHitObject hitObject, Beatmap beatmap) - { - } - - public void PostProcess(Beatmap beatmap) - { - } - } -} diff --git a/osu.Game.Modes.Taiko/UI/TaikoHitRenderer.cs b/osu.Game.Modes.Taiko/UI/TaikoHitRenderer.cs index 18cbd30776..48d4457a53 100644 --- a/osu.Game.Modes.Taiko/UI/TaikoHitRenderer.cs +++ b/osu.Game.Modes.Taiko/UI/TaikoHitRenderer.cs @@ -117,8 +117,6 @@ namespace osu.Game.Modes.Taiko.UI protected override BeatmapConverter CreateBeatmapConverter() => new TaikoBeatmapConverter(); - protected override IBeatmapProcessor CreateBeatmapProcessor() => new TaikoBeatmapProcessor(); - protected override Playfield CreatePlayfield() => new TaikoPlayfield { Anchor = Anchor.CentreLeft, diff --git a/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj b/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj index 03137802d4..ee7cb73431 100644 --- a/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj +++ b/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj @@ -48,7 +48,6 @@ - diff --git a/osu.Game/Modes/Beatmaps/IBeatmapProcessor.cs b/osu.Game/Modes/Beatmaps/BeatmapProcessor.cs similarity index 85% rename from osu.Game/Modes/Beatmaps/IBeatmapProcessor.cs rename to osu.Game/Modes/Beatmaps/BeatmapProcessor.cs index c40e7d1c41..ff675a4e5e 100644 --- a/osu.Game/Modes/Beatmaps/IBeatmapProcessor.cs +++ b/osu.Game/Modes/Beatmaps/BeatmapProcessor.cs @@ -10,7 +10,7 @@ namespace osu.Game.Modes.Beatmaps /// Processes a post-converted Beatmap. /// /// The type of HitObject contained in the Beatmap. - public interface IBeatmapProcessor + public class BeatmapProcessor where TObject : HitObject { /// @@ -20,6 +20,6 @@ namespace osu.Game.Modes.Beatmaps /// /// /// The Beatmap to process. - void PostProcess(Beatmap beatmap); + public virtual void PostProcess(Beatmap beatmap) { } } } diff --git a/osu.Game/Modes/UI/HitRenderer.cs b/osu.Game/Modes/UI/HitRenderer.cs index 46d05aa98f..72b67836f7 100644 --- a/osu.Game/Modes/UI/HitRenderer.cs +++ b/osu.Game/Modes/UI/HitRenderer.cs @@ -121,7 +121,7 @@ namespace osu.Game.Modes.UI RelativeSizeAxes = Axes.Both; BeatmapConverter converter = CreateBeatmapConverter(); - IBeatmapProcessor processor = CreateBeatmapProcessor(); + BeatmapProcessor processor = CreateBeatmapProcessor(); // Check if the beatmap can be converted if (!converter.CanConvert(beatmap.Beatmap)) @@ -154,18 +154,18 @@ namespace osu.Game.Modes.UI mod.Apply(this); } - /// - /// Creates a converter to convert Beatmap to a specific mode. - /// - /// The Beatmap converter. - protected abstract BeatmapConverter CreateBeatmapConverter(); - /// /// Creates a processor to perform post-processing operations /// on HitObjects in converted Beatmaps. /// /// The Beatmap processor. - protected abstract IBeatmapProcessor CreateBeatmapProcessor(); + protected virtual BeatmapProcessor CreateBeatmapProcessor() => new BeatmapProcessor(); + + /// + /// Creates a converter to convert Beatmap to a specific mode. + /// + /// The Beatmap converter. + protected abstract BeatmapConverter CreateBeatmapConverter(); } /// diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 770008be5f..9d1c3e527e 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -73,7 +73,7 @@ - + From 4393c2cb250d00233b1d6373d89e58a4e388883f Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 18 Apr 2017 09:46:14 +0900 Subject: [PATCH 24/45] Add unit tests to ensure all rulesets' beatmaps are added successfully. --- osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs b/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs index 0c64c47a63..b35f5901be 100644 --- a/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs +++ b/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs @@ -154,7 +154,15 @@ namespace osu.Game.Tests.Beatmaps.IO Assert.IsTrue(set.Beatmaps.Count > 0); var beatmap = osu.Dependencies.Get().GetWorkingBeatmap(set.Beatmaps.First(b => b.RulesetID == 0))?.Beatmap; + Assert.IsTrue(beatmap?.HitObjects.Count > 0); + beatmap = osu.Dependencies.Get().GetWorkingBeatmap(set.Beatmaps.First(b => b.RulesetID == 1))?.Beatmap; + Assert.IsTrue(beatmap?.HitObjects.Count > 0); + + beatmap = osu.Dependencies.Get().GetWorkingBeatmap(set.Beatmaps.First(b => b.RulesetID == 2))?.Beatmap; + Assert.IsTrue(beatmap?.HitObjects.Count > 0); + + beatmap = osu.Dependencies.Get().GetWorkingBeatmap(set.Beatmaps.First(b => b.RulesetID == 3))?.Beatmap; Assert.IsTrue(beatmap?.HitObjects.Count > 0); } } From 2734983564a3fa132242fbe55a794dd124d582ed Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 18 Apr 2017 09:47:16 +0900 Subject: [PATCH 25/45] Add unique constraints on RulesetInfo table to ensure things stay sane. --- osu.Game/Database/RulesetInfo.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osu.Game/Database/RulesetInfo.cs b/osu.Game/Database/RulesetInfo.cs index d7bab39b97..c3c0d4343d 100644 --- a/osu.Game/Database/RulesetInfo.cs +++ b/osu.Game/Database/RulesetInfo.cs @@ -12,8 +12,10 @@ namespace osu.Game.Database [PrimaryKey, AutoIncrement] public int? ID { get; set; } + [Indexed(Unique = true)] public string Name { get; set; } + [Indexed(Unique = true)] public string InstantiationInfo { get; set; } [Indexed] From d3c1520a2d4f851d394b81f49613a25369cbcc53 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 18 Apr 2017 09:47:29 +0900 Subject: [PATCH 26/45] Fix beatmaps not getting the correct ruleset on import. --- osu.Game/Database/BeatmapDatabase.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/osu.Game/Database/BeatmapDatabase.cs b/osu.Game/Database/BeatmapDatabase.cs index 7789096067..e11ea797ca 100644 --- a/osu.Game/Database/BeatmapDatabase.cs +++ b/osu.Game/Database/BeatmapDatabase.cs @@ -219,10 +219,9 @@ namespace osu.Game.Database beatmap.BeatmapInfo.Metadata = null; // TODO: this should be done in a better place once we actually need to dynamically update it. + beatmap.BeatmapInfo.Ruleset = rulesets.Query().FirstOrDefault(r => r.ID == beatmap.BeatmapInfo.RulesetID); beatmap.BeatmapInfo.StarDifficulty = rulesets.Query().FirstOrDefault(r => r.ID == beatmap.BeatmapInfo.RulesetID)?.CreateInstance()?.CreateDifficultyCalculator(beatmap).Calculate() ?? 0; - beatmap.BeatmapInfo.Ruleset = null; - beatmapSet.Beatmaps.Add(beatmap.BeatmapInfo); } beatmapSet.StoryboardFile = archive.StoryboardFilename; @@ -239,7 +238,7 @@ namespace osu.Game.Database foreach (var s in beatmapSets) { - Connection.InsertWithChildren(s, true); + Connection.InsertOrReplaceWithChildren(s, true); BeatmapSetAdded?.Invoke(s); } From 0cef14ca63d4f23e466ff064c36a914f4f789aac Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Tue, 18 Apr 2017 09:51:02 +0900 Subject: [PATCH 27/45] CI fixes. --- osu.Game.Modes.Osu/Objects/OsuHitObject.cs | 1 - osu.Game/Modes/Beatmaps/BeatmapConverter.cs | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/osu.Game.Modes.Osu/Objects/OsuHitObject.cs b/osu.Game.Modes.Osu/Objects/OsuHitObject.cs index 5e45d04390..55fc99e41a 100644 --- a/osu.Game.Modes.Osu/Objects/OsuHitObject.cs +++ b/osu.Game.Modes.Osu/Objects/OsuHitObject.cs @@ -8,7 +8,6 @@ using osu.Game.Modes.Objects.Types; using OpenTK.Graphics; using osu.Game.Beatmaps.Timing; using osu.Game.Database; -using System; namespace osu.Game.Modes.Osu.Objects { diff --git a/osu.Game/Modes/Beatmaps/BeatmapConverter.cs b/osu.Game/Modes/Beatmaps/BeatmapConverter.cs index 4a8684864f..3da1dff001 100644 --- a/osu.Game/Modes/Beatmaps/BeatmapConverter.cs +++ b/osu.Game/Modes/Beatmaps/BeatmapConverter.cs @@ -32,6 +32,6 @@ namespace osu.Game.Modes.Beatmaps /// /// The Beatmap to check. /// Whether the Beatmap can be converted using this Beatmap Converter. - public bool CanConvert(Beatmap beatmap) => ValidConversionTypes.All(t => beatmap.HitObjects.Any(h => t.IsAssignableFrom(h.GetType()))); + public bool CanConvert(Beatmap beatmap) => ValidConversionTypes.All(t => beatmap.HitObjects.Any(h => h.GetType().IsInstanceOfType(t))); } } From f2174054ea0810a1dccb4b88c4760b23d0edfcce Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 18 Apr 2017 10:04:32 +0900 Subject: [PATCH 28/45] Fix song select. --- osu.Game/Database/BeatmapDatabase.cs | 8 +++++--- osu.Game/Screens/Select/BeatmapCarousel.cs | 9 +++++++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/osu.Game/Database/BeatmapDatabase.cs b/osu.Game/Database/BeatmapDatabase.cs index e11ea797ca..ab2a612176 100644 --- a/osu.Game/Database/BeatmapDatabase.cs +++ b/osu.Game/Database/BeatmapDatabase.cs @@ -271,12 +271,14 @@ namespace osu.Game.Database { var beatmapSetInfo = Query().FirstOrDefault(s => s.ID == beatmapInfo.BeatmapSetInfoID); - //we need metadata - GetChildren(beatmapSetInfo); - if (beatmapSetInfo == null) throw new InvalidOperationException($@"Beatmap set {beatmapInfo.BeatmapSetInfoID} is not in the local database."); + //we need metadata + GetChildren(beatmapSetInfo); + foreach (var b in beatmapSetInfo.Beatmaps) + GetChildren(b); + if (beatmapInfo.Metadata == null) beatmapInfo.Metadata = beatmapSetInfo.Metadata; diff --git a/osu.Game/Screens/Select/BeatmapCarousel.cs b/osu.Game/Screens/Select/BeatmapCarousel.cs index f104bf9a37..06aaea041a 100644 --- a/osu.Game/Screens/Select/BeatmapCarousel.cs +++ b/osu.Game/Screens/Select/BeatmapCarousel.cs @@ -145,7 +145,7 @@ namespace osu.Game.Screens.Select } } - int startIndex = groups.IndexOf(selectedGroup); + int startIndex = Math.Max(0, groups.IndexOf(selectedGroup)); int index = startIndex; do @@ -221,7 +221,12 @@ namespace osu.Game.Screens.Select private BeatmapGroup createGroup(BeatmapSetInfo beatmapSet) { database.GetChildren(beatmapSet); - beatmapSet.Beatmaps.ForEach(b => { if (b.Metadata == null) b.Metadata = beatmapSet.Metadata; }); + beatmapSet.Beatmaps.ForEach(b => + { + database.GetChildren(b); + if (b.Metadata == null) + b.Metadata = beatmapSet.Metadata; + }); return new BeatmapGroup(beatmapSet, database) { From 6b6690caf7989e566318ad949b22dadf83fc6b2f Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 18 Apr 2017 10:04:41 +0900 Subject: [PATCH 29/45] Fix filtering by ruleset. --- osu.Game/Screens/Select/FilterCriteria.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Select/FilterCriteria.cs b/osu.Game/Screens/Select/FilterCriteria.cs index 1a32244deb..11aea3eb4c 100644 --- a/osu.Game/Screens/Select/FilterCriteria.cs +++ b/osu.Game/Screens/Select/FilterCriteria.cs @@ -23,7 +23,7 @@ namespace osu.Game.Screens.Select { var set = g.BeatmapSet; - bool hasCurrentMode = set.Beatmaps.Any(bm => bm.Ruleset == Ruleset); + bool hasCurrentMode = set.Beatmaps.Any(bm => bm.RulesetID == Ruleset.ID); bool match = hasCurrentMode; From 5a78ce15a1718b3cf69e550e9facb74bbb39d1ce Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Tue, 18 Apr 2017 10:23:49 +0900 Subject: [PATCH 30/45] Fix CanConvert not returning correctly. --- osu.Game/Modes/Beatmaps/BeatmapConverter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Modes/Beatmaps/BeatmapConverter.cs b/osu.Game/Modes/Beatmaps/BeatmapConverter.cs index 3da1dff001..d08eff6583 100644 --- a/osu.Game/Modes/Beatmaps/BeatmapConverter.cs +++ b/osu.Game/Modes/Beatmaps/BeatmapConverter.cs @@ -32,6 +32,6 @@ namespace osu.Game.Modes.Beatmaps /// /// The Beatmap to check. /// Whether the Beatmap can be converted using this Beatmap Converter. - public bool CanConvert(Beatmap beatmap) => ValidConversionTypes.All(t => beatmap.HitObjects.Any(h => h.GetType().IsInstanceOfType(t))); + public bool CanConvert(Beatmap beatmap) => ValidConversionTypes.All(t => beatmap.HitObjects.Any(h => t.IsInstanceOfType(h))); } } From 3b9067e55e4f06015754e9f6fd165d5c947e8efb Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Tue, 18 Apr 2017 10:41:26 +0900 Subject: [PATCH 31/45] Convert chords to strong hits for osu!mania conversion. --- osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapConverter.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapConverter.cs b/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapConverter.cs index c7ff225d0a..abba5316bb 100644 --- a/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapConverter.cs +++ b/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapConverter.cs @@ -49,7 +49,13 @@ namespace osu.Game.Modes.Taiko.Beatmaps return new Beatmap(original) { BeatmapInfo = info, - HitObjects = original.HitObjects.SelectMany(h => convertHitObject(h, original)).ToList() + HitObjects = original.HitObjects.SelectMany(h => convertHitObject(h, original)).GroupBy(t => t.StartTime).Select(x => + { + TaikoHitObject first = x.First(); + if (x.Skip(1).Any()) + first.IsStrong = true; + return first; + }).ToList() }; } From 5939ba9143cf410e32ce2d9b1cd9b3b4d59b34a9 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 18 Apr 2017 10:55:33 +0900 Subject: [PATCH 32/45] Fix ruleset not always being initialised correctly. --- osu.Desktop.VisualTests/Tests/TestCasePlayer.cs | 2 +- osu.Game/Database/BeatmapDatabase.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Desktop.VisualTests/Tests/TestCasePlayer.cs b/osu.Desktop.VisualTests/Tests/TestCasePlayer.cs index a21c09a9d0..8c3ac526f6 100644 --- a/osu.Desktop.VisualTests/Tests/TestCasePlayer.cs +++ b/osu.Desktop.VisualTests/Tests/TestCasePlayer.cs @@ -39,7 +39,7 @@ namespace osu.Desktop.VisualTests.Tests WorkingBeatmap beatmap = null; - var beatmapInfo = db.Query().FirstOrDefault(b => b.Ruleset.CreateInstance() is OsuRuleset); + var beatmapInfo = db.Query().FirstOrDefault(b => b.RulesetID == 0); if (beatmapInfo != null) beatmap = db.GetWorkingBeatmap(beatmapInfo); diff --git a/osu.Game/Database/BeatmapDatabase.cs b/osu.Game/Database/BeatmapDatabase.cs index ab2a612176..0e814dea82 100644 --- a/osu.Game/Database/BeatmapDatabase.cs +++ b/osu.Game/Database/BeatmapDatabase.cs @@ -276,8 +276,8 @@ namespace osu.Game.Database //we need metadata GetChildren(beatmapSetInfo); - foreach (var b in beatmapSetInfo.Beatmaps) - GetChildren(b); + //we also need a ruleset + GetChildren(beatmapInfo); if (beatmapInfo.Metadata == null) beatmapInfo.Metadata = beatmapSetInfo.Metadata; From 8ef675d9b3dab2730535eed3124b2737e9d1aac3 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 18 Apr 2017 10:55:45 +0900 Subject: [PATCH 33/45] Add fallback to allow FilterCriteria to run without a ruleset being set. --- osu.Game/Screens/Select/FilterCriteria.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Select/FilterCriteria.cs b/osu.Game/Screens/Select/FilterCriteria.cs index 11aea3eb4c..d49c7296ba 100644 --- a/osu.Game/Screens/Select/FilterCriteria.cs +++ b/osu.Game/Screens/Select/FilterCriteria.cs @@ -23,7 +23,7 @@ namespace osu.Game.Screens.Select { var set = g.BeatmapSet; - bool hasCurrentMode = set.Beatmaps.Any(bm => bm.RulesetID == Ruleset.ID); + bool hasCurrentMode = set.Beatmaps.Any(bm => bm.RulesetID == (Ruleset?.ID ?? 0)); bool match = hasCurrentMode; From 7d3a1c5658393f3ec8b50a9ee581752174b659df Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 18 Apr 2017 10:59:50 +0900 Subject: [PATCH 34/45] Remove using. --- osu.Desktop.VisualTests/Tests/TestCasePlayer.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Desktop.VisualTests/Tests/TestCasePlayer.cs b/osu.Desktop.VisualTests/Tests/TestCasePlayer.cs index 8c3ac526f6..8e19419dbb 100644 --- a/osu.Desktop.VisualTests/Tests/TestCasePlayer.cs +++ b/osu.Desktop.VisualTests/Tests/TestCasePlayer.cs @@ -14,7 +14,6 @@ using osu.Game.Modes.Osu.Objects; using osu.Game.Screens.Play; using OpenTK.Graphics; using osu.Desktop.VisualTests.Beatmaps; -using osu.Game.Modes.Osu; namespace osu.Desktop.VisualTests.Tests { From d04353aed0652c9ec61bdf7e6c676e2e0711c6d0 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Tue, 18 Apr 2017 11:13:11 +0900 Subject: [PATCH 35/45] Legacy mania hit objects don't have a "column", this should be determined by the beatmap converter. --- .../Beatmaps/ManiaBeatmapConverter.cs | 2 +- osu.Game/Modes/Objects/Legacy/Mania/Hit.cs | 4 ++-- .../Objects/Legacy/Mania/HitObjectParser.cs | 3 +++ osu.Game/Modes/Objects/Legacy/Mania/Slider.cs | 4 ++-- osu.Game/Modes/Objects/Legacy/Mania/Spinner.cs | 4 ++-- osu.Game/Modes/Objects/Types/IHasColumn.cs | 16 ---------------- osu.Game/osu.Game.csproj | 1 - 7 files changed, 10 insertions(+), 24 deletions(-) delete mode 100644 osu.Game/Modes/Objects/Types/IHasColumn.cs diff --git a/osu.Game.Modes.Mania/Beatmaps/ManiaBeatmapConverter.cs b/osu.Game.Modes.Mania/Beatmaps/ManiaBeatmapConverter.cs index 6dbf4af6b1..d8ea7f322d 100644 --- a/osu.Game.Modes.Mania/Beatmaps/ManiaBeatmapConverter.cs +++ b/osu.Game.Modes.Mania/Beatmaps/ManiaBeatmapConverter.cs @@ -12,7 +12,7 @@ namespace osu.Game.Modes.Mania.Beatmaps { internal class ManiaBeatmapConverter : BeatmapConverter { - public override IEnumerable ValidConversionTypes { get; } = new[] { typeof(IHasColumn) }; + public override IEnumerable ValidConversionTypes { get; } = new[] { typeof(IHasXPosition) }; public override Beatmap Convert(Beatmap original) { diff --git a/osu.Game/Modes/Objects/Legacy/Mania/Hit.cs b/osu.Game/Modes/Objects/Legacy/Mania/Hit.cs index acf9777fbf..3131bbd89d 100644 --- a/osu.Game/Modes/Objects/Legacy/Mania/Hit.cs +++ b/osu.Game/Modes/Objects/Legacy/Mania/Hit.cs @@ -8,9 +8,9 @@ namespace osu.Game.Modes.Objects.Legacy.Mania /// /// Legacy osu!mania Hit-type, used for parsing Beatmaps. /// - internal sealed class Hit : HitObject, IHasColumn, IHasCombo + internal sealed class Hit : HitObject, IHasXPosition, IHasCombo { - public int Column { get; set; } + public float X { get; set; } public bool NewCombo { get; set; } } diff --git a/osu.Game/Modes/Objects/Legacy/Mania/HitObjectParser.cs b/osu.Game/Modes/Objects/Legacy/Mania/HitObjectParser.cs index 7ef923633c..1ef01a06b9 100644 --- a/osu.Game/Modes/Objects/Legacy/Mania/HitObjectParser.cs +++ b/osu.Game/Modes/Objects/Legacy/Mania/HitObjectParser.cs @@ -16,6 +16,7 @@ namespace osu.Game.Modes.Objects.Legacy.Mania { return new Hit { + X = position.X, NewCombo = newCombo, }; } @@ -24,6 +25,7 @@ namespace osu.Game.Modes.Objects.Legacy.Mania { return new Slider { + X = position.X, NewCombo = newCombo, ControlPoints = controlPoints, Distance = length, @@ -36,6 +38,7 @@ namespace osu.Game.Modes.Objects.Legacy.Mania { return new Spinner { + X = position.X, EndTime = endTime }; } diff --git a/osu.Game/Modes/Objects/Legacy/Mania/Slider.cs b/osu.Game/Modes/Objects/Legacy/Mania/Slider.cs index f320ac1d59..bf8eaa561a 100644 --- a/osu.Game/Modes/Objects/Legacy/Mania/Slider.cs +++ b/osu.Game/Modes/Objects/Legacy/Mania/Slider.cs @@ -8,9 +8,9 @@ namespace osu.Game.Modes.Objects.Legacy.Mania /// /// Legacy osu!mania Slider-type, used for parsing Beatmaps. /// - internal sealed class Slider : CurvedHitObject, IHasColumn, IHasCombo + internal sealed class Slider : CurvedHitObject, IHasXPosition, IHasCombo { - public int Column { get; set; } + public float X { get; set; } public bool NewCombo { get; set; } } diff --git a/osu.Game/Modes/Objects/Legacy/Mania/Spinner.cs b/osu.Game/Modes/Objects/Legacy/Mania/Spinner.cs index 1df5907860..8183f1129b 100644 --- a/osu.Game/Modes/Objects/Legacy/Mania/Spinner.cs +++ b/osu.Game/Modes/Objects/Legacy/Mania/Spinner.cs @@ -8,12 +8,12 @@ namespace osu.Game.Modes.Objects.Legacy.Mania /// /// Legacy osu!mania Spinner-type, used for parsing Beatmaps. /// - internal sealed class Spinner : HitObject, IHasEndTime, IHasColumn + internal sealed class Spinner : HitObject, IHasEndTime, IHasXPosition { public double EndTime { get; set; } public double Duration => EndTime - StartTime; - public int Column { get; set; } + public float X { get; set; } } } diff --git a/osu.Game/Modes/Objects/Types/IHasColumn.cs b/osu.Game/Modes/Objects/Types/IHasColumn.cs deleted file mode 100644 index 7609a26773..0000000000 --- a/osu.Game/Modes/Objects/Types/IHasColumn.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - -namespace osu.Game.Modes.Objects.Types -{ - /// - /// A HitObject that lies in a column space. - /// - public interface IHasColumn - { - /// - /// The column which this HitObject lies in. - /// - int Column { get; } - } -} diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 9d1c3e527e..05fd0502ab 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -117,7 +117,6 @@ - From 8844ff7ab79ff2c68f5940192e6fb3e4ad08dfd7 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Tue, 18 Apr 2017 11:20:39 +0900 Subject: [PATCH 36/45] CI fixes. --- osu.Desktop.VisualTests/Tests/TestCasePlayer.cs | 1 - osu.Game/Modes/Beatmaps/BeatmapConverter.cs | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/osu.Desktop.VisualTests/Tests/TestCasePlayer.cs b/osu.Desktop.VisualTests/Tests/TestCasePlayer.cs index 8c3ac526f6..8e19419dbb 100644 --- a/osu.Desktop.VisualTests/Tests/TestCasePlayer.cs +++ b/osu.Desktop.VisualTests/Tests/TestCasePlayer.cs @@ -14,7 +14,6 @@ using osu.Game.Modes.Osu.Objects; using osu.Game.Screens.Play; using OpenTK.Graphics; using osu.Desktop.VisualTests.Beatmaps; -using osu.Game.Modes.Osu; namespace osu.Desktop.VisualTests.Tests { diff --git a/osu.Game/Modes/Beatmaps/BeatmapConverter.cs b/osu.Game/Modes/Beatmaps/BeatmapConverter.cs index d08eff6583..ca7cb5a5bc 100644 --- a/osu.Game/Modes/Beatmaps/BeatmapConverter.cs +++ b/osu.Game/Modes/Beatmaps/BeatmapConverter.cs @@ -32,6 +32,6 @@ namespace osu.Game.Modes.Beatmaps /// /// The Beatmap to check. /// Whether the Beatmap can be converted using this Beatmap Converter. - public bool CanConvert(Beatmap beatmap) => ValidConversionTypes.All(t => beatmap.HitObjects.Any(h => t.IsInstanceOfType(h))); + public bool CanConvert(Beatmap beatmap) => ValidConversionTypes.All(t => beatmap.HitObjects.Any(t.IsInstanceOfType)); } } From ef5d50e7d841dc7a01f0c6d88004f1e83ba950f5 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Tue, 18 Apr 2017 11:29:27 +0900 Subject: [PATCH 37/45] mode -> ruleset. --- osu.Game/Modes/UI/HitRenderer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Modes/UI/HitRenderer.cs b/osu.Game/Modes/UI/HitRenderer.cs index 72b67836f7..3e51b2b44f 100644 --- a/osu.Game/Modes/UI/HitRenderer.cs +++ b/osu.Game/Modes/UI/HitRenderer.cs @@ -125,7 +125,7 @@ namespace osu.Game.Modes.UI // Check if the beatmap can be converted if (!converter.CanConvert(beatmap.Beatmap)) - throw new BeatmapInvalidForModeException($"{nameof(Beatmap)} can't be converted to the current mode."); + throw new BeatmapInvalidForModeException($"{nameof(Beatmap)} can't be converted for the current ruleset."); // Convert the beatmap Beatmap = converter.Convert(beatmap.Beatmap); From 2df21066e792d77859a7734db2630a95e2f8c779 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 18 Apr 2017 12:19:39 +0900 Subject: [PATCH 38/45] Add constant for osu! playfield size. --- osu.Desktop.VisualTests/Tests/TestCaseGamefield.cs | 2 +- osu.Desktop.VisualTests/Tests/TestCasePlayer.cs | 5 +++-- osu.Game.Modes.Osu/Beatmaps/OsuBeatmapConverter.cs | 3 ++- osu.Game.Modes.Osu/Objects/Drawables/DrawableSpinner.cs | 3 ++- osu.Game.Modes.Osu/UI/OsuPlayfield.cs | 6 ++++-- 5 files changed, 12 insertions(+), 7 deletions(-) diff --git a/osu.Desktop.VisualTests/Tests/TestCaseGamefield.cs b/osu.Desktop.VisualTests/Tests/TestCaseGamefield.cs index d1519d0404..87b201a8e8 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseGamefield.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseGamefield.cs @@ -45,7 +45,7 @@ namespace osu.Desktop.VisualTests.Tests objects.Add(new HitCircle { StartTime = time, - Position = new Vector2(RNG.Next(0, 512), RNG.Next(0, 384)), + Position = new Vector2(RNG.Next(0, (int)OsuPlayfield.BASE_SIZE.X), RNG.Next(0, (int)OsuPlayfield.BASE_SIZE.Y)), Scale = RNG.NextSingle(0.5f, 1.0f), }); diff --git a/osu.Desktop.VisualTests/Tests/TestCasePlayer.cs b/osu.Desktop.VisualTests/Tests/TestCasePlayer.cs index 8e19419dbb..c196476545 100644 --- a/osu.Desktop.VisualTests/Tests/TestCasePlayer.cs +++ b/osu.Desktop.VisualTests/Tests/TestCasePlayer.cs @@ -14,6 +14,7 @@ using osu.Game.Modes.Osu.Objects; using osu.Game.Screens.Play; using OpenTK.Graphics; using osu.Desktop.VisualTests.Beatmaps; +using osu.Game.Modes.Osu.UI; namespace osu.Desktop.VisualTests.Tests { @@ -52,8 +53,8 @@ namespace osu.Desktop.VisualTests.Tests objects.Add(new HitCircle { StartTime = time, - Position = new Vector2(i % 4 == 0 || i % 4 == 2 ? 0 : 512, - i % 4 < 2 ? 0 : 384), + Position = new Vector2(i % 4 == 0 || i % 4 == 2 ? 0 : OsuPlayfield.BASE_SIZE.X, + i % 4 < 2 ? 0 : OsuPlayfield.BASE_SIZE.Y), NewCombo = i % 4 == 0 }); diff --git a/osu.Game.Modes.Osu/Beatmaps/OsuBeatmapConverter.cs b/osu.Game.Modes.Osu/Beatmaps/OsuBeatmapConverter.cs index dd8dde5530..044c45b184 100644 --- a/osu.Game.Modes.Osu/Beatmaps/OsuBeatmapConverter.cs +++ b/osu.Game.Modes.Osu/Beatmaps/OsuBeatmapConverter.cs @@ -10,6 +10,7 @@ using System.Collections.Generic; using osu.Game.Modes.Objects.Types; using System.Linq; using System; +using osu.Game.Modes.Osu.UI; using osu.Game.Modes.Beatmaps; namespace osu.Game.Modes.Osu.Beatmaps @@ -66,7 +67,7 @@ namespace osu.Game.Modes.Osu.Beatmaps Samples = original.Samples, EndTime = endTimeData.EndTime, - Position = positionData?.Position ?? new Vector2(512, 384) / 2, + Position = positionData?.Position ?? OsuPlayfield.BASE_SIZE / 2, }; } diff --git a/osu.Game.Modes.Osu/Objects/Drawables/DrawableSpinner.cs b/osu.Game.Modes.Osu/Objects/Drawables/DrawableSpinner.cs index d0136f717c..d921481290 100644 --- a/osu.Game.Modes.Osu/Objects/Drawables/DrawableSpinner.cs +++ b/osu.Game.Modes.Osu/Objects/Drawables/DrawableSpinner.cs @@ -9,6 +9,7 @@ using osu.Game.Modes.Objects.Drawables; using osu.Game.Modes.Osu.Objects.Drawables.Pieces; using OpenTK; using OpenTK.Graphics; +using osu.Game.Modes.Osu.UI; namespace osu.Game.Modes.Osu.Objects.Drawables { @@ -29,7 +30,7 @@ namespace osu.Game.Modes.Osu.Objects.Drawables Position = s.Position; //take up full playfield. - Size = new Vector2(512); + Size = OsuPlayfield.BASE_SIZE; spinner = s; diff --git a/osu.Game.Modes.Osu/UI/OsuPlayfield.cs b/osu.Game.Modes.Osu/UI/OsuPlayfield.cs index 4164607b4d..47e2c1ed16 100644 --- a/osu.Game.Modes.Osu/UI/OsuPlayfield.cs +++ b/osu.Game.Modes.Osu/UI/OsuPlayfield.cs @@ -23,6 +23,8 @@ namespace osu.Game.Modes.Osu.UI public override bool ProvidingUserCursor => true; + public static readonly Vector2 BASE_SIZE = new Vector2(512, 384); + public override Vector2 Size { get @@ -34,7 +36,7 @@ namespace osu.Game.Modes.Osu.UI } } - public OsuPlayfield() : base(512) + public OsuPlayfield() : base(BASE_SIZE.X) { Anchor = Anchor.Centre; Origin = Anchor.Centre; @@ -94,4 +96,4 @@ namespace osu.Game.Modes.Osu.UI judgementLayer.Add(explosion); } } -} \ No newline at end of file +} From 27ddf4b4755e0fa65294600a3da22e5014644af2 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Tue, 18 Apr 2017 14:24:16 +0900 Subject: [PATCH 39/45] Refactor beatmap converters. --- .../Beatmaps/CatchBeatmapConverter.cs | 10 +- .../Beatmaps/ManiaBeatmapConverter.cs | 10 +- .../Beatmaps/OsuBeatmapConverter.cs | 194 ++---------------- .../Beatmaps/OsuBeatmapProcessor.cs | 150 ++++++++++++++ .../Beatmaps/TaikoBeatmapConverter.cs | 33 ++- osu.Game/Beatmaps/Beatmap.cs | 1 + osu.Game/Modes/Beatmaps/BeatmapConverter.cs | 69 +++++-- 7 files changed, 243 insertions(+), 224 deletions(-) diff --git a/osu.Game.Modes.Catch/Beatmaps/CatchBeatmapConverter.cs b/osu.Game.Modes.Catch/Beatmaps/CatchBeatmapConverter.cs index 3b7b1c3a29..bd09e19ab8 100644 --- a/osu.Game.Modes.Catch/Beatmaps/CatchBeatmapConverter.cs +++ b/osu.Game.Modes.Catch/Beatmaps/CatchBeatmapConverter.cs @@ -7,19 +7,17 @@ using System.Collections.Generic; using System; using osu.Game.Modes.Objects.Types; using osu.Game.Modes.Beatmaps; +using osu.Game.Modes.Objects; namespace osu.Game.Modes.Catch.Beatmaps { internal class CatchBeatmapConverter : BeatmapConverter { - public override IEnumerable ValidConversionTypes { get; } = new[] { typeof(IHasXPosition) }; + protected override IEnumerable ValidConversionTypes { get; } = new[] { typeof(IHasXPosition) }; - public override Beatmap Convert(Beatmap original) + protected override IEnumerable ConvertHitObject(HitObject original, Beatmap beatmap) { - return new Beatmap(original) - { - HitObjects = new List() // Todo: Convert HitObjects - }; + yield return null; } } } diff --git a/osu.Game.Modes.Mania/Beatmaps/ManiaBeatmapConverter.cs b/osu.Game.Modes.Mania/Beatmaps/ManiaBeatmapConverter.cs index d8ea7f322d..c804fd4eeb 100644 --- a/osu.Game.Modes.Mania/Beatmaps/ManiaBeatmapConverter.cs +++ b/osu.Game.Modes.Mania/Beatmaps/ManiaBeatmapConverter.cs @@ -7,19 +7,17 @@ using System.Collections.Generic; using System; using osu.Game.Modes.Objects.Types; using osu.Game.Modes.Beatmaps; +using osu.Game.Modes.Objects; namespace osu.Game.Modes.Mania.Beatmaps { internal class ManiaBeatmapConverter : BeatmapConverter { - public override IEnumerable ValidConversionTypes { get; } = new[] { typeof(IHasXPosition) }; + protected override IEnumerable ValidConversionTypes { get; } = new[] { typeof(IHasXPosition) }; - public override Beatmap Convert(Beatmap original) + protected override IEnumerable ConvertHitObject(HitObject original, Beatmap beatmap) { - return new Beatmap(original) - { - HitObjects = new List() // Todo: Implement - }; + yield return null; } } } diff --git a/osu.Game.Modes.Osu/Beatmaps/OsuBeatmapConverter.cs b/osu.Game.Modes.Osu/Beatmaps/OsuBeatmapConverter.cs index 044c45b184..0172112969 100644 --- a/osu.Game.Modes.Osu/Beatmaps/OsuBeatmapConverter.cs +++ b/osu.Game.Modes.Osu/Beatmaps/OsuBeatmapConverter.cs @@ -5,10 +5,8 @@ using OpenTK; using osu.Game.Beatmaps; using osu.Game.Modes.Objects; using osu.Game.Modes.Osu.Objects; -using osu.Game.Modes.Osu.Objects.Drawables; using System.Collections.Generic; using osu.Game.Modes.Objects.Types; -using System.Linq; using System; using osu.Game.Modes.Osu.UI; using osu.Game.Modes.Beatmaps; @@ -17,31 +15,10 @@ namespace osu.Game.Modes.Osu.Beatmaps { internal class OsuBeatmapConverter : BeatmapConverter { - public override IEnumerable ValidConversionTypes { get; } = new[] { typeof(IHasPosition) }; + protected override IEnumerable ValidConversionTypes { get; } = new[] { typeof(IHasPosition) }; - public override Beatmap Convert(Beatmap original) + protected override IEnumerable ConvertHitObject(HitObject original, Beatmap beatmap) { - return new Beatmap(original) - { - HitObjects = convertHitObjects(original.HitObjects, original.BeatmapInfo?.StackLeniency ?? 0.7f) - }; - } - - private List convertHitObjects(List hitObjects, float stackLeniency) - { - List converted = hitObjects.Select(convertHitObject).ToList(); - - updateStacking(converted, stackLeniency); - - return converted; - } - - private OsuHitObject convertHitObject(HitObject original) - { - OsuHitObject originalOsu = original as OsuHitObject; - if (originalOsu != null) - return originalOsu; - IHasCurve curveData = original as IHasCurve; IHasEndTime endTimeData = original as IHasEndTime; IHasPosition positionData = original as IHasPosition; @@ -49,7 +26,7 @@ namespace osu.Game.Modes.Osu.Beatmaps if (curveData != null) { - return new Slider + yield return new Slider { StartTime = original.StartTime, Samples = original.Samples, @@ -58,10 +35,9 @@ namespace osu.Game.Modes.Osu.Beatmaps NewCombo = comboData?.NewCombo ?? false }; } - - if (endTimeData != null) + else if (endTimeData != null) { - return new Spinner + yield return new Spinner { StartTime = original.StartTime, Samples = original.Samples, @@ -70,161 +46,15 @@ namespace osu.Game.Modes.Osu.Beatmaps Position = positionData?.Position ?? OsuPlayfield.BASE_SIZE / 2, }; } - - return new HitCircle + else { - StartTime = original.StartTime, - Samples = original.Samples, - Position = positionData?.Position ?? Vector2.Zero, - NewCombo = comboData?.NewCombo ?? false - }; - } - - private void updateStacking(List hitObjects, float stackLeniency, int startIndex = 0, int endIndex = -1) - { - if (endIndex == -1) - endIndex = hitObjects.Count - 1; - - const int stack_distance = 3; - float stackThreshold = DrawableOsuHitObject.TIME_PREEMPT * stackLeniency; - - // Reset stacking inside the update range - for (int i = startIndex; i <= endIndex; i++) - hitObjects[i].StackHeight = 0; - - // Extend the end index to include objects they are stacked on - int extendedEndIndex = endIndex; - for (int i = endIndex; i >= startIndex; i--) - { - int stackBaseIndex = i; - for (int n = stackBaseIndex + 1; n < hitObjects.Count; n++) + yield return new HitCircle { - OsuHitObject stackBaseObject = hitObjects[stackBaseIndex]; - if (stackBaseObject is Spinner) break; - - OsuHitObject objectN = hitObjects[n]; - if (objectN is Spinner) - continue; - - double endTime = (stackBaseObject as IHasEndTime)?.EndTime ?? stackBaseObject.StartTime; - - if (objectN.StartTime - endTime > stackThreshold) - //We are no longer within stacking range of the next object. - break; - - if (Vector2.Distance(stackBaseObject.Position, objectN.Position) < stack_distance || - stackBaseObject is Slider && Vector2.Distance(stackBaseObject.EndPosition, objectN.Position) < stack_distance) - { - stackBaseIndex = n; - - // HitObjects after the specified update range haven't been reset yet - objectN.StackHeight = 0; - } - } - - if (stackBaseIndex > extendedEndIndex) - { - extendedEndIndex = stackBaseIndex; - if (extendedEndIndex == hitObjects.Count - 1) - break; - } - } - - //Reverse pass for stack calculation. - int extendedStartIndex = startIndex; - for (int i = extendedEndIndex; i > startIndex; i--) - { - int n = i; - /* We should check every note which has not yet got a stack. - * Consider the case we have two interwound stacks and this will make sense. - * - * o <-1 o <-2 - * o <-3 o <-4 - * - * We first process starting from 4 and handle 2, - * then we come backwards on the i loop iteration until we reach 3 and handle 1. - * 2 and 1 will be ignored in the i loop because they already have a stack value. - */ - - OsuHitObject objectI = hitObjects[i]; - if (objectI.StackHeight != 0 || objectI is Spinner) continue; - - /* If this object is a hitcircle, then we enter this "special" case. - * It either ends with a stack of hitcircles only, or a stack of hitcircles that are underneath a slider. - * Any other case is handled by the "is Slider" code below this. - */ - if (objectI is HitCircle) - { - while (--n >= 0) - { - OsuHitObject objectN = hitObjects[n]; - if (objectN is Spinner) continue; - - double endTime = (objectN as IHasEndTime)?.EndTime ?? objectN.StartTime; - - if (objectI.StartTime - endTime > stackThreshold) - //We are no longer within stacking range of the previous object. - break; - - // HitObjects before the specified update range haven't been reset yet - if (n < extendedStartIndex) - { - objectN.StackHeight = 0; - extendedStartIndex = n; - } - - /* This is a special case where hticircles are moved DOWN and RIGHT (negative stacking) if they are under the *last* slider in a stacked pattern. - * o==o <- slider is at original location - * o <- hitCircle has stack of -1 - * o <- hitCircle has stack of -2 - */ - if (objectN is Slider && Vector2.Distance(objectN.EndPosition, objectI.Position) < stack_distance) - { - int offset = objectI.StackHeight - objectN.StackHeight + 1; - for (int j = n + 1; j <= i; j++) - { - //For each object which was declared under this slider, we will offset it to appear *below* the slider end (rather than above). - OsuHitObject objectJ = hitObjects[j]; - if (Vector2.Distance(objectN.EndPosition, objectJ.Position) < stack_distance) - objectJ.StackHeight -= offset; - } - - //We have hit a slider. We should restart calculation using this as the new base. - //Breaking here will mean that the slider still has StackCount of 0, so will be handled in the i-outer-loop. - break; - } - - if (Vector2.Distance(objectN.Position, objectI.Position) < stack_distance) - { - //Keep processing as if there are no sliders. If we come across a slider, this gets cancelled out. - //NOTE: Sliders with start positions stacking are a special case that is also handled here. - - objectN.StackHeight = objectI.StackHeight + 1; - objectI = objectN; - } - } - } - else if (objectI is Slider) - { - /* We have hit the first slider in a possible stack. - * From this point on, we ALWAYS stack positive regardless. - */ - while (--n >= startIndex) - { - OsuHitObject objectN = hitObjects[n]; - if (objectN is Spinner) continue; - - if (objectI.StartTime - objectN.StartTime > stackThreshold) - //We are no longer within stacking range of the previous object. - break; - - if (Vector2.Distance(objectN.EndPosition, objectI.Position) < stack_distance) - { - objectN.StackHeight = objectI.StackHeight + 1; - objectI = objectN; - } - } - } + StartTime = original.StartTime, + Samples = original.Samples, + Position = positionData?.Position ?? Vector2.Zero, + NewCombo = comboData?.NewCombo ?? false + }; } } } diff --git a/osu.Game.Modes.Osu/Beatmaps/OsuBeatmapProcessor.cs b/osu.Game.Modes.Osu/Beatmaps/OsuBeatmapProcessor.cs index fd506f3493..912da40f3d 100644 --- a/osu.Game.Modes.Osu/Beatmaps/OsuBeatmapProcessor.cs +++ b/osu.Game.Modes.Osu/Beatmaps/OsuBeatmapProcessor.cs @@ -1,9 +1,12 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using OpenTK; using osu.Game.Beatmaps; using osu.Game.Modes.Beatmaps; +using osu.Game.Modes.Objects.Types; using osu.Game.Modes.Osu.Objects; +using osu.Game.Modes.Osu.Objects.Drawables; namespace osu.Game.Modes.Osu.Beatmaps { @@ -11,6 +14,8 @@ namespace osu.Game.Modes.Osu.Beatmaps { public override void PostProcess(Beatmap beatmap) { + applyStacking(beatmap); + if (beatmap.ComboColors.Count == 0) return; @@ -29,5 +34,150 @@ namespace osu.Game.Modes.Osu.Beatmaps obj.ComboColour = beatmap.ComboColors[colourIndex]; } } + + private void applyStacking(Beatmap beatmap) + { + const int stack_distance = 3; + float stackThreshold = DrawableOsuHitObject.TIME_PREEMPT * beatmap.BeatmapInfo?.StackLeniency ?? 0.7f; + + // Reset stacking + for (int i = 0; i <= beatmap.HitObjects.Count - 1; i++) + beatmap.HitObjects[i].StackHeight = 0; + + // Extend the end index to include objects they are stacked on + int extendedEndIndex = beatmap.HitObjects.Count - 1; + for (int i = beatmap.HitObjects.Count - 1; i >= 0; i--) + { + int stackBaseIndex = i; + for (int n = stackBaseIndex + 1; n < beatmap.HitObjects.Count; n++) + { + OsuHitObject stackBaseObject = beatmap.HitObjects[stackBaseIndex]; + if (stackBaseObject is Spinner) break; + + OsuHitObject objectN = beatmap.HitObjects[n]; + if (objectN is Spinner) + continue; + + double endTime = (stackBaseObject as IHasEndTime)?.EndTime ?? stackBaseObject.StartTime; + + if (objectN.StartTime - endTime > stackThreshold) + //We are no longer within stacking range of the next object. + break; + + if (Vector2.Distance(stackBaseObject.Position, objectN.Position) < stack_distance || + stackBaseObject is Slider && Vector2.Distance(stackBaseObject.EndPosition, objectN.Position) < stack_distance) + { + stackBaseIndex = n; + + // HitObjects after the specified update range haven't been reset yet + objectN.StackHeight = 0; + } + } + + if (stackBaseIndex > extendedEndIndex) + { + extendedEndIndex = stackBaseIndex; + if (extendedEndIndex == beatmap.HitObjects.Count - 1) + break; + } + } + + //Reverse pass for stack calculation. + int extendedStartIndex = 0; + for (int i = extendedEndIndex; i > 0; i--) + { + int n = i; + /* We should check every note which has not yet got a stack. + * Consider the case we have two interwound stacks and this will make sense. + * + * o <-1 o <-2 + * o <-3 o <-4 + * + * We first process starting from 4 and handle 2, + * then we come backwards on the i loop iteration until we reach 3 and handle 1. + * 2 and 1 will be ignored in the i loop because they already have a stack value. + */ + + OsuHitObject objectI = beatmap.HitObjects[i]; + if (objectI.StackHeight != 0 || objectI is Spinner) continue; + + /* If this object is a hitcircle, then we enter this "special" case. + * It either ends with a stack of hitcircles only, or a stack of hitcircles that are underneath a slider. + * Any other case is handled by the "is Slider" code below this. + */ + if (objectI is HitCircle) + { + while (--n >= 0) + { + OsuHitObject objectN = beatmap.HitObjects[n]; + if (objectN is Spinner) continue; + + double endTime = (objectN as IHasEndTime)?.EndTime ?? objectN.StartTime; + + if (objectI.StartTime - endTime > stackThreshold) + //We are no longer within stacking range of the previous object. + break; + + // HitObjects before the specified update range haven't been reset yet + if (n < extendedStartIndex) + { + objectN.StackHeight = 0; + extendedStartIndex = n; + } + + /* This is a special case where hticircles are moved DOWN and RIGHT (negative stacking) if they are under the *last* slider in a stacked pattern. + * o==o <- slider is at original location + * o <- hitCircle has stack of -1 + * o <- hitCircle has stack of -2 + */ + if (objectN is Slider && Vector2.Distance(objectN.EndPosition, objectI.Position) < stack_distance) + { + int offset = objectI.StackHeight - objectN.StackHeight + 1; + for (int j = n + 1; j <= i; j++) + { + //For each object which was declared under this slider, we will offset it to appear *below* the slider end (rather than above). + OsuHitObject objectJ = beatmap.HitObjects[j]; + if (Vector2.Distance(objectN.EndPosition, objectJ.Position) < stack_distance) + objectJ.StackHeight -= offset; + } + + //We have hit a slider. We should restart calculation using this as the new base. + //Breaking here will mean that the slider still has StackCount of 0, so will be handled in the i-outer-loop. + break; + } + + if (Vector2.Distance(objectN.Position, objectI.Position) < stack_distance) + { + //Keep processing as if there are no sliders. If we come across a slider, this gets cancelled out. + //NOTE: Sliders with start positions stacking are a special case that is also handled here. + + objectN.StackHeight = objectI.StackHeight + 1; + objectI = objectN; + } + } + } + else if (objectI is Slider) + { + /* We have hit the first slider in a possible stack. + * From this point on, we ALWAYS stack positive regardless. + */ + while (--n >= 0) + { + OsuHitObject objectN = beatmap.HitObjects[n]; + if (objectN is Spinner) continue; + + if (objectI.StartTime - objectN.StartTime > stackThreshold) + //We are no longer within stacking range of the previous object. + break; + + if (Vector2.Distance(objectN.EndPosition, objectI.Position) < stack_distance) + { + objectN.StackHeight = objectI.StackHeight + 1; + objectI = objectN; + } + } + } + } + } } } diff --git a/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapConverter.cs b/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapConverter.cs index abba5316bb..d26cc8ab0b 100644 --- a/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapConverter.cs +++ b/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapConverter.cs @@ -39,33 +39,30 @@ namespace osu.Game.Modes.Taiko.Beatmaps /// private const float taiko_base_distance = 100; - public override IEnumerable ValidConversionTypes { get; } = new[] { typeof(HitObject) }; + protected override IEnumerable ValidConversionTypes { get; } = new[] { typeof(HitObject) }; - public override Beatmap Convert(Beatmap original) + protected override Beatmap ConvertBeatmap(Beatmap original) { + // Rewrite the beatmap info to add the slider velocity multiplier BeatmapInfo info = original.BeatmapInfo.DeepClone(); info.Difficulty.SliderMultiplier *= legacy_velocity_multiplier; - return new Beatmap(original) + Beatmap converted = base.ConvertBeatmap(original); + + // Post processing step to transform hit objects with the same start time into strong hits + converted.HitObjects = converted.HitObjects.GroupBy(t => t.StartTime).Select(x => { - BeatmapInfo = info, - HitObjects = original.HitObjects.SelectMany(h => convertHitObject(h, original)).GroupBy(t => t.StartTime).Select(x => - { - TaikoHitObject first = x.First(); - if (x.Skip(1).Any()) - first.IsStrong = true; - return first; - }).ToList() - }; + TaikoHitObject first = x.First(); + if (x.Skip(1).Any()) + first.IsStrong = true; + return first; + }).ToList(); + + return converted; } - private IEnumerable convertHitObject(HitObject obj, Beatmap beatmap) + protected override IEnumerable ConvertHitObject(HitObject obj, Beatmap beatmap) { - // Check if this HitObject is already a TaikoHitObject, and return it if so - var originalTaiko = obj as TaikoHitObject; - if (originalTaiko != null) - yield return originalTaiko; - var distanceData = obj as IHasDistance; var repeatsData = obj as IHasRepeats; var endTimeData = obj as IHasEndTime; diff --git a/osu.Game/Beatmaps/Beatmap.cs b/osu.Game/Beatmaps/Beatmap.cs index e3a7a81d0d..7ed0546747 100644 --- a/osu.Game/Beatmaps/Beatmap.cs +++ b/osu.Game/Beatmaps/Beatmap.cs @@ -56,6 +56,7 @@ namespace osu.Game.Beatmaps public Beatmap(Beatmap original = null) : base(original) { + HitObjects = original?.HitObjects; } } } diff --git a/osu.Game/Modes/Beatmaps/BeatmapConverter.cs b/osu.Game/Modes/Beatmaps/BeatmapConverter.cs index ca7cb5a5bc..ea75577e25 100644 --- a/osu.Game/Modes/Beatmaps/BeatmapConverter.cs +++ b/osu.Game/Modes/Beatmaps/BeatmapConverter.cs @@ -15,23 +15,68 @@ namespace osu.Game.Modes.Beatmaps /// The type of HitObject stored in the Beatmap. public abstract class BeatmapConverter where T : HitObject { - /// - /// The types of HitObjects that can be converted to be used for this Beatmap. - /// - public abstract IEnumerable ValidConversionTypes { get; } - - /// - /// Converts a Beatmap to another mode. - /// - /// The original Beatmap. - /// The converted Beatmap. - public abstract Beatmap Convert(Beatmap original); - /// /// Checks if a Beatmap can be converted using this Beatmap Converter. /// /// The Beatmap to check. /// Whether the Beatmap can be converted using this Beatmap Converter. public bool CanConvert(Beatmap beatmap) => ValidConversionTypes.All(t => beatmap.HitObjects.Any(t.IsInstanceOfType)); + + /// + /// Converts a Beatmap using this Beatmap Converter. + /// + /// The un-converted Beatmap. + /// The converted Beatmap. + public Beatmap Convert(Beatmap original) + { + // We always operate on a clone of the original beatmap, to not modify it game-wide + return ConvertBeatmap(new Beatmap(original)); + } + + /// + /// Performs the conversion of a Beatmap using this Beatmap Converter. + /// + /// The un-converted Beatmap. + /// The converted Beatmap. + protected virtual Beatmap ConvertBeatmap(Beatmap original) + { + return new Beatmap + { + BeatmapInfo = original.BeatmapInfo, + TimingInfo = original.TimingInfo, + HitObjects = original.HitObjects.SelectMany(h => convert(h, original)).ToList() + }; + } + + /// + /// Converts a hit object. + /// + /// The hit object to convert. + /// The un-converted Beatmap. + /// The converted hit object. + private IEnumerable convert(HitObject original, Beatmap beatmap) + { + // Check if the hitobject is already the converted type + T tObject = original as T; + if (tObject != null) + yield return tObject; + + // Convert the hit object + foreach (var obj in ConvertHitObject(original, beatmap)) + yield return obj; + } + + /// + /// The types of HitObjects that can be converted to be used for this Beatmap. + /// + protected abstract IEnumerable ValidConversionTypes { get; } + + /// + /// Performs the conversion of a hit object. + /// + /// The hit object to convert. + /// The un-converted Beatmap. + /// The converted hit object. + protected abstract IEnumerable ConvertHitObject(HitObject original, Beatmap beatmap); } } From 0dd97c433f3a2464fe35c218c072595ebe76d771 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Tue, 18 Apr 2017 14:34:39 +0900 Subject: [PATCH 40/45] Trim whitespace. --- osu.Game/Modes/Beatmaps/BeatmapConverter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Modes/Beatmaps/BeatmapConverter.cs b/osu.Game/Modes/Beatmaps/BeatmapConverter.cs index ea75577e25..253d4b3a93 100644 --- a/osu.Game/Modes/Beatmaps/BeatmapConverter.cs +++ b/osu.Game/Modes/Beatmaps/BeatmapConverter.cs @@ -60,7 +60,7 @@ namespace osu.Game.Modes.Beatmaps T tObject = original as T; if (tObject != null) yield return tObject; - + // Convert the hit object foreach (var obj in ConvertHitObject(original, beatmap)) yield return obj; From cf404b4bcf029c97879d84b80aea8281c715aebe Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Tue, 18 Apr 2017 14:46:56 +0900 Subject: [PATCH 41/45] We shouldn't be adding null hitobjects. --- osu.Game/Modes/Beatmaps/BeatmapConverter.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/osu.Game/Modes/Beatmaps/BeatmapConverter.cs b/osu.Game/Modes/Beatmaps/BeatmapConverter.cs index 253d4b3a93..545c49e507 100644 --- a/osu.Game/Modes/Beatmaps/BeatmapConverter.cs +++ b/osu.Game/Modes/Beatmaps/BeatmapConverter.cs @@ -63,7 +63,12 @@ namespace osu.Game.Modes.Beatmaps // Convert the hit object foreach (var obj in ConvertHitObject(original, beatmap)) + { + if (obj == null) + continue; + yield return obj; + } } /// From 7a6b062e720c97b2eb6bab34d70575045a9ec6e0 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Tue, 18 Apr 2017 14:48:18 +0900 Subject: [PATCH 42/45] Fix adding duplicate hitobjects in the case where a hit object doesn't need to be converted. --- osu.Game/Modes/Beatmaps/BeatmapConverter.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/osu.Game/Modes/Beatmaps/BeatmapConverter.cs b/osu.Game/Modes/Beatmaps/BeatmapConverter.cs index 545c49e507..c2e5b0affa 100644 --- a/osu.Game/Modes/Beatmaps/BeatmapConverter.cs +++ b/osu.Game/Modes/Beatmaps/BeatmapConverter.cs @@ -59,7 +59,10 @@ namespace osu.Game.Modes.Beatmaps // Check if the hitobject is already the converted type T tObject = original as T; if (tObject != null) + { yield return tObject; + yield break; + } // Convert the hit object foreach (var obj in ConvertHitObject(original, beatmap)) From 727086c0b2532bd8618897c95954a2ed9d08e6b2 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 18 Apr 2017 15:34:53 +0900 Subject: [PATCH 43/45] Updates in-line with framework. --- osu.Game/Overlays/Toolbar/Toolbar.cs | 2 +- osu.Game/Screens/Play/MenuOverlay.cs | 2 ++ osu.Game/Screens/Select/BeatmapInfoWedge.cs | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/osu.Game/Overlays/Toolbar/Toolbar.cs b/osu.Game/Overlays/Toolbar/Toolbar.cs index 4632b55775..e1495827f9 100644 --- a/osu.Game/Overlays/Toolbar/Toolbar.cs +++ b/osu.Game/Overlays/Toolbar/Toolbar.cs @@ -27,7 +27,7 @@ namespace osu.Game.Overlays.Toolbar protected override bool HideOnEscape => false; - protected override bool BlockPassThroughInput => false; + protected override bool BlockPassThroughMouse => false; private const double transition_time = 500; diff --git a/osu.Game/Screens/Play/MenuOverlay.cs b/osu.Game/Screens/Play/MenuOverlay.cs index 738e5cc35d..fa522956f7 100644 --- a/osu.Game/Screens/Play/MenuOverlay.cs +++ b/osu.Game/Screens/Play/MenuOverlay.cs @@ -25,6 +25,8 @@ namespace osu.Game.Screens.Play protected override bool HideOnEscape => false; + protected override bool BlockPassThroughKeyboard => true; + public Action OnRetry; public Action OnQuit; diff --git a/osu.Game/Screens/Select/BeatmapInfoWedge.cs b/osu.Game/Screens/Select/BeatmapInfoWedge.cs index d15e5a9bb8..cc225659b4 100644 --- a/osu.Game/Screens/Select/BeatmapInfoWedge.cs +++ b/osu.Game/Screens/Select/BeatmapInfoWedge.cs @@ -47,7 +47,7 @@ namespace osu.Game.Screens.Select protected override bool HideOnEscape => false; - protected override bool BlockPassThroughInput => false; + protected override bool BlockPassThroughMouse => false; protected override void PopIn() { From fbd26a1d5eb5c94ac723e8e2bf32eeeb8960db38 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 18 Apr 2017 16:05:58 +0900 Subject: [PATCH 44/45] Mode -> Ruleset. --- osu.Desktop.Tests/osu.Desktop.Tests.csproj | 16 +-- .../Tests/TestCaseGamefield.cs | 12 +- .../Tests/TestCaseHitObjects.cs | 10 +- .../Tests/TestCaseLeaderboard.cs | 6 +- .../Tests/TestCasePlayer.cs | 6 +- .../Tests/TestCaseReplay.cs | 4 +- .../Tests/TestCaseScoreCounter.cs | 2 +- .../Tests/TestCaseSongProgress.cs | 2 +- .../Tests/TestCaseTaikoHitObjects.cs | 2 +- .../Tests/TestCaseTaikoPlayfield.cs | 10 +- .../osu.Desktop.VisualTests.csproj | 16 +-- osu.Desktop/osu.Desktop.csproj | 16 +-- .../Beatmaps/CatchBeatmapConverter.cs | 10 +- .../CatchDifficultyCalculator.cs | 8 +- .../CatchRuleset.cs | 14 +- .../Judgements/CatchJudgement.cs | 4 +- .../Mods/CatchMod.cs | 4 +- .../Objects/CatchBaseHit.cs | 4 +- .../Objects/Drawable/DrawableFruit.cs | 2 +- .../Objects/Droplet.cs | 2 +- .../Objects/Fruit.cs | 2 +- .../OpenTK.dll.config | 0 .../Properties/AssemblyInfo.cs | 4 +- .../Scoring/CatchScoreProcessor.cs | 10 +- .../UI/CatchHitRenderer.cs | 18 +-- .../UI/CatchPlayfield.cs | 8 +- .../osu.Game.Rulesets.Catch.csproj | 8 +- .../packages.config | 0 .../Beatmaps/ManiaBeatmapConverter.cs | 10 +- .../Judgements/ManiaJudgement.cs | 4 +- .../ManiaDifficultyCalculator.cs | 8 +- .../ManiaRuleset.cs | 14 +- .../Mods/ManiaMod.cs | 4 +- .../Objects/Drawable/DrawableNote.cs | 2 +- .../Objects/HoldNote.cs | 2 +- .../Objects/ManiaBaseHit.cs | 4 +- .../Objects/Note.cs | 2 +- .../OpenTK.dll.config | 0 .../Properties/AssemblyInfo.cs | 4 +- .../Scoring/ManiaScoreProcessor.cs | 10 +- .../UI/ManiaHitRenderer.cs | 18 +-- .../UI/ManiaPlayfield.cs | 8 +- .../osu.Game.Rulesets.Mania.csproj | 12 +- .../packages.config | 0 .../Beatmaps/OsuBeatmapConverter.cs | 12 +- .../Beatmaps/OsuBeatmapProcessor.cs | 10 +- .../Judgements/OsuJudgement.cs | 6 +- .../Mods/OsuMod.cs | 8 +- .../Connections/ConnectionRenderer.cs | 4 +- .../Drawables/Connections/FollowPoint.cs | 2 +- .../Connections/FollowPointRenderer.cs | 4 +- .../Objects/Drawables/DrawableHitCircle.cs | 8 +- .../Objects/Drawables/DrawableOsuHitObject.cs | 6 +- .../Objects/Drawables/DrawableOsuJudgement.cs | 8 +- .../Objects/Drawables/DrawableSlider.cs | 6 +- .../Objects/Drawables/DrawableSliderTick.cs | 6 +- .../Objects/Drawables/DrawableSpinner.cs | 8 +- .../Drawables/Pieces/ApproachCircle.cs | 2 +- .../Objects/Drawables/Pieces/CirclePiece.cs | 2 +- .../Objects/Drawables/Pieces/ExplodePiece.cs | 2 +- .../Objects/Drawables/Pieces/FlashPiece.cs | 2 +- .../Objects/Drawables/Pieces/GlowPiece.cs | 2 +- .../Objects/Drawables/Pieces/NumberPiece.cs | 2 +- .../Objects/Drawables/Pieces/RingPiece.cs | 2 +- .../Objects/Drawables/Pieces/SliderBall.cs | 2 +- .../Objects/Drawables/Pieces/SliderBody.cs | 2 +- .../Objects/Drawables/Pieces/SliderBouncer.cs | 2 +- .../Drawables/Pieces/SpinnerBackground.cs | 2 +- .../Objects/Drawables/Pieces/SpinnerDisc.cs | 2 +- .../Drawables/Pieces/TrianglesPiece.cs | 2 +- .../Objects/HitCircle.cs | 2 +- .../Objects/OsuHitObject.cs | 8 +- .../Objects/OsuHitObjectDifficulty.cs | 2 +- .../Objects/Slider.cs | 6 +- .../Objects/SliderTick.cs | 2 +- .../Objects/Spinner.cs | 4 +- .../OpenTK.dll.config | 0 .../OsuAutoReplay.cs | 10 +- .../OsuDifficultyCalculator.cs | 10 +- .../OsuKeyConversionInputManager.cs | 2 +- .../OsuRuleset.cs | 16 +-- .../Properties/AssemblyInfo.cs | 0 .../Scoring/OsuScore.cs | 4 +- .../Scoring/OsuScoreProcessor.cs | 12 +- .../UI/OsuHitRenderer.cs | 20 +-- .../UI/OsuPlayfield.cs | 14 +- .../osu.Game.Rulesets.Osu.csproj | 4 +- .../packages.config | 0 .../Beatmaps/TaikoBeatmapConverter.cs | 10 +- .../Judgements/TaikoDrumRollTickJudgement.cs | 2 +- .../Judgements/TaikoHitResult.cs | 2 +- .../Judgements/TaikoJudgement.cs | 6 +- .../Judgements/TaikoStrongHitJudgement.cs | 4 +- .../Mods/TaikoMod.cs | 10 +- .../Objects/BarLine.cs | 2 +- .../Objects/CentreHit.cs | 2 +- .../Objects/Drawables/DrawableBarLine.cs | 2 +- .../Objects/Drawables/DrawableBarLineMajor.cs | 2 +- .../Objects/Drawables/DrawableCentreHit.cs | 4 +- .../Drawables/DrawableCentreHitStrong.cs | 4 +- .../Objects/Drawables/DrawableDrumRoll.cs | 8 +- .../Objects/Drawables/DrawableDrumRollTick.cs | 8 +- .../Objects/Drawables/DrawableHit.cs | 8 +- .../Objects/Drawables/DrawableHitStrong.cs | 8 +- .../Objects/Drawables/DrawableRimHit.cs | 4 +- .../Objects/Drawables/DrawableRimHitStrong.cs | 4 +- .../Objects/Drawables/DrawableSwell.cs | 8 +- .../Drawables/DrawableTaikoHitObject.cs | 8 +- .../Drawables/Pieces/CentreHitSymbolPiece.cs | 2 +- .../Objects/Drawables/Pieces/CirclePiece.cs | 2 +- .../Drawables/Pieces/ElongatedCirclePiece.cs | 4 +- .../Drawables/Pieces/RimHitSymbolPiece.cs | 2 +- .../Drawables/Pieces/SwellSymbolPiece.cs | 2 +- .../Objects/Drawables/Pieces/TaikoPiece.cs | 2 +- .../Objects/Drawables/Pieces/TickPiece.cs | 2 +- .../Objects/DrumRoll.cs | 4 +- .../Objects/DrumRollTick.cs | 2 +- .../Objects/Hit.cs | 2 +- .../Objects/RimHit.cs | 2 +- .../Objects/Swell.cs | 4 +- .../Objects/TaikoHitObject.cs | 6 +- .../OpenTK.dll.config | 0 .../Properties/AssemblyInfo.cs | 4 +- .../Replays/TaikoAutoReplay.cs | 8 +- .../Replays/TaikoFramedReplayInputHandler.cs | 4 +- .../Scoring/TaikoScoreProcessor.cs | 12 +- .../TaikoDifficultyCalculator.cs | 8 +- .../TaikoRuleset.cs | 14 +- .../UI/DrawableTaikoJudgement.cs | 8 +- .../UI/HitExplosion.cs | 6 +- .../UI/HitTarget.cs | 4 +- .../UI/InputDrum.cs | 2 +- .../UI/TaikoHitRenderer.cs | 26 ++-- .../UI/TaikoPlayfield.cs | 12 +- .../osu.Game.Rulesets.Taiko.csproj | 4 +- .../packages.config | 0 .../Beatmaps/Formats/OsuLegacyDecoderTest.cs | 2 +- osu.Game.Tests/osu.Game.Tests.csproj | 16 +-- osu.Game/Beatmaps/Beatmap.cs | 2 +- osu.Game/Beatmaps/DifficultyCalculator.cs | 4 +- osu.Game/Beatmaps/Formats/BeatmapDecoder.cs | 2 +- osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs | 10 +- osu.Game/Beatmaps/WorkingBeatmap.cs | 2 +- osu.Game/Database/RulesetDatabase.cs | 4 +- osu.Game/Database/RulesetInfo.cs | 2 +- osu.Game/Database/ScoreDatabase.cs | 2 +- osu.Game/Graphics/TextAwesome.cs | 4 +- .../Online/API/Requests/GetScoresRequest.cs | 2 +- osu.Game/OsuGame.cs | 6 +- osu.Game/Overlays/Mods/AssistedSection.cs | 2 +- .../Mods/DifficultyIncreaseSection.cs | 2 +- .../Mods/DifficultyReductionSection.cs | 2 +- osu.Game/Overlays/Mods/ModButton.cs | 4 +- osu.Game/Overlays/Mods/ModSection.cs | 2 +- osu.Game/Overlays/Mods/ModSelectOverlay.cs | 2 +- osu.Game/Overlays/Toolbar/Toolbar.cs | 2 +- .../Overlays/Toolbar/ToolbarModeSelector.cs | 4 +- .../{Modes => Rulesets}/BeatmapStatistic.cs | 2 +- .../Beatmaps/BeatmapConverter.cs | 4 +- .../Beatmaps/BeatmapProcessor.cs | 4 +- .../Judgements/DrawableJudgement.cs | 4 +- .../Judgements/IPartialJudgement.cs | 6 +- .../Judgements/Judgement.cs | 4 +- .../Mods/IApplicableMod.cs | 6 +- osu.Game/{Modes => Rulesets}/Mods/Mod.cs | 8 +- osu.Game/{Modes => Rulesets}/Mods/ModType.cs | 2 +- .../Objects/BezierApproximator.cs | 2 +- .../Objects/CircularArcApproximator.cs | 2 +- .../Objects/CurvedHitObject.cs | 4 +- .../Objects/Drawables/ArmedState.cs | 2 +- .../Objects/Drawables/DrawableHitObject.cs | 6 +- .../Objects/Drawables/HitResult.cs | 2 +- .../IDrawableHitObjectWithProxiedApproach.cs | 2 +- .../{Modes => Rulesets}/Objects/HitObject.cs | 2 +- .../Objects/HitObjectParser.cs | 2 +- .../Objects/Legacy/Catch/Hit.cs | 4 +- .../Objects/Legacy/Catch/HitObjectParser.cs | 4 +- .../Objects/Legacy/Catch/Slider.cs | 4 +- .../Objects/Legacy/Catch/Spinner.cs | 4 +- .../Objects/Legacy/HitObjectParser.cs | 4 +- .../Objects/Legacy/HitObjectType.cs | 2 +- .../Objects/Legacy/Hold.cs | 4 +- .../Objects/Legacy/Mania/Hit.cs | 4 +- .../Objects/Legacy/Mania/HitObjectParser.cs | 4 +- .../Objects/Legacy/Mania/Slider.cs | 4 +- .../Objects/Legacy/Mania/Spinner.cs | 4 +- .../Objects/Legacy/Osu/Hit.cs | 4 +- .../Objects/Legacy/Osu/HitObjectParser.cs | 4 +- .../Objects/Legacy/Osu/Slider.cs | 4 +- .../Objects/Legacy/Osu/Spinner.cs | 4 +- .../Objects/Legacy/Taiko/Hit.cs | 4 +- .../Objects/Legacy/Taiko/HitObjectParser.cs | 4 +- .../Objects/Legacy/Taiko/Slider.cs | 4 +- .../Objects/Legacy/Taiko/Spinner.cs | 4 +- .../Objects/SliderCurve.cs | 4 +- .../Objects/Types/CurveType.cs | 2 +- .../Objects/Types/IHasCombo.cs | 2 +- .../Objects/Types/IHasCurve.cs | 2 +- .../Objects/Types/IHasDistance.cs | 2 +- .../Objects/Types/IHasEndTime.cs | 2 +- .../Objects/Types/IHasHold.cs | 2 +- .../Objects/Types/IHasPosition.cs | 2 +- .../Objects/Types/IHasRepeats.cs | 2 +- .../Objects/Types/IHasXPosition.cs | 2 +- .../Objects/Types/IHasYPosition.cs | 2 +- .../Replays/FramedReplayInputHandler.cs | 2 +- .../{Modes => Rulesets}/Replays/Replay.cs | 2 +- .../Replays/ReplayButtonState.cs | 2 +- .../Replays/ReplayFrame.cs | 2 +- osu.Game/{Modes => Rulesets}/Ruleset.cs | 8 +- osu.Game/{Modes => Rulesets}/Scoring/Score.cs | 6 +- .../Scoring/ScoreProcessor.cs | 14 +- .../{Modes => Rulesets}/Scoring/ScoreRank.cs | 2 +- .../{Modes => Rulesets}/UI/ComboCounter.cs | 2 +- .../UI/ComboResultCounter.cs | 2 +- .../{Modes => Rulesets}/UI/HealthDisplay.cs | 2 +- .../{Modes => Rulesets}/UI/HitRenderer.cs | 16 +-- osu.Game/{Modes => Rulesets}/UI/HudOverlay.cs | 4 +- osu.Game/{Modes => Rulesets}/UI/ModIcon.cs | 2 +- osu.Game/{Modes => Rulesets}/UI/Playfield.cs | 8 +- .../UI/StandardComboCounter.cs | 2 +- .../UI/StandardHealthDisplay.cs | 2 +- .../UI/StandardHudOverlay.cs | 2 +- osu.Game/Screens/BackgroundScreen.cs | 4 +- osu.Game/Screens/OsuScreen.cs | 4 +- osu.Game/Screens/Play/Player.cs | 6 +- osu.Game/Screens/Play/ReplayPlayer.cs | 2 +- osu.Game/Screens/Play/SongProgress.cs | 4 +- osu.Game/Screens/Ranking/Results.cs | 2 +- osu.Game/Screens/ScreenWhiteBox.cs | 2 +- osu.Game/Screens/Select/BeatmapInfoWedge.cs | 6 +- .../Select/Leaderboards/DrawableRank.cs | 2 +- .../Select/Leaderboards/Leaderboard.cs | 2 +- .../Select/Leaderboards/LeaderboardScore.cs | 4 +- osu.Game/osu.Game.csproj | 132 +++++++++--------- osu.sln | 8 +- 236 files changed, 642 insertions(+), 642 deletions(-) rename {osu.Game.Modes.Catch => osu.Game.Rulesets.Catch}/Beatmaps/CatchBeatmapConverter.cs (73%) rename {osu.Game.Modes.Catch => osu.Game.Rulesets.Catch}/CatchDifficultyCalculator.cs (79%) rename {osu.Game.Modes.Catch => osu.Game.Rulesets.Catch}/CatchRuleset.cs (90%) rename {osu.Game.Modes.Catch => osu.Game.Rulesets.Catch}/Judgements/CatchJudgement.cs (78%) rename {osu.Game.Modes.Catch => osu.Game.Rulesets.Catch}/Mods/CatchMod.cs (91%) rename {osu.Game.Modes.Catch => osu.Game.Rulesets.Catch}/Objects/CatchBaseHit.cs (75%) rename {osu.Game.Modes.Catch => osu.Game.Rulesets.Catch}/Objects/Drawable/DrawableFruit.cs (93%) rename {osu.Game.Modes.Catch => osu.Game.Rulesets.Catch}/Objects/Droplet.cs (80%) rename {osu.Game.Modes.Catch => osu.Game.Rulesets.Catch}/Objects/Fruit.cs (80%) rename {osu.Game.Modes.Catch => osu.Game.Rulesets.Catch}/OpenTK.dll.config (100%) rename {osu.Game.Modes.Catch => osu.Game.Rulesets.Catch}/Properties/AssemblyInfo.cs (90%) rename {osu.Game.Modes.Catch => osu.Game.Rulesets.Catch}/Scoring/CatchScoreProcessor.cs (72%) rename {osu.Game.Modes.Catch => osu.Game.Rulesets.Catch}/UI/CatchHitRenderer.cs (69%) rename {osu.Game.Modes.Catch => osu.Game.Rulesets.Catch}/UI/CatchPlayfield.cs (77%) rename osu.Game.Modes.Catch/osu.Game.Modes.Catch.csproj => osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj (92%) rename {osu.Game.Modes.Catch => osu.Game.Rulesets.Catch}/packages.config (100%) rename {osu.Game.Modes.Mania => osu.Game.Rulesets.Mania}/Beatmaps/ManiaBeatmapConverter.cs (73%) rename {osu.Game.Modes.Mania => osu.Game.Rulesets.Mania}/Judgements/ManiaJudgement.cs (78%) rename {osu.Game.Modes.Mania => osu.Game.Rulesets.Mania}/ManiaDifficultyCalculator.cs (79%) rename {osu.Game.Modes.Mania => osu.Game.Rulesets.Mania}/ManiaRuleset.cs (91%) rename {osu.Game.Modes.Mania => osu.Game.Rulesets.Mania}/Mods/ManiaMod.cs (94%) rename {osu.Game.Modes.Mania => osu.Game.Rulesets.Mania}/Objects/Drawable/DrawableNote.cs (93%) rename {osu.Game.Modes.Mania => osu.Game.Rulesets.Mania}/Objects/HoldNote.cs (79%) rename {osu.Game.Modes.Mania => osu.Game.Rulesets.Mania}/Objects/ManiaBaseHit.cs (74%) rename {osu.Game.Modes.Mania => osu.Game.Rulesets.Mania}/Objects/Note.cs (80%) rename {osu.Game.Modes.Mania => osu.Game.Rulesets.Mania}/OpenTK.dll.config (100%) rename {osu.Game.Modes.Mania => osu.Game.Rulesets.Mania}/Properties/AssemblyInfo.cs (90%) rename {osu.Game.Modes.Mania => osu.Game.Rulesets.Mania}/Scoring/ManiaScoreProcessor.cs (72%) rename {osu.Game.Modes.Mania => osu.Game.Rulesets.Mania}/UI/ManiaHitRenderer.cs (71%) rename {osu.Game.Modes.Mania => osu.Game.Rulesets.Mania}/UI/ManiaPlayfield.cs (84%) rename osu.Game.Modes.Mania/osu.Game.Modes.Mania.csproj => osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj (89%) rename {osu.Game.Modes.Mania => osu.Game.Rulesets.Mania}/packages.config (100%) rename {osu.Game.Modes.Osu => osu.Game.Rulesets.Osu}/Beatmaps/OsuBeatmapConverter.cs (87%) rename {osu.Game.Modes.Osu => osu.Game.Rulesets.Osu}/Beatmaps/OsuBeatmapProcessor.cs (95%) rename {osu.Game.Modes.Osu => osu.Game.Rulesets.Osu}/Judgements/OsuJudgement.cs (89%) rename {osu.Game.Modes.Osu => osu.Game.Rulesets.Osu}/Mods/OsuMod.cs (93%) rename {osu.Game.Modes.Osu => osu.Game.Rulesets.Osu}/Objects/Drawables/Connections/ConnectionRenderer.cs (83%) rename {osu.Game.Modes.Osu => osu.Game.Rulesets.Osu}/Objects/Drawables/Connections/FollowPoint.cs (93%) rename {osu.Game.Modes.Osu => osu.Game.Rulesets.Osu}/Objects/Drawables/Connections/FollowPointRenderer.cs (94%) rename {osu.Game.Modes.Osu => osu.Game.Rulesets.Osu}/Objects/Drawables/DrawableHitCircle.cs (93%) rename {osu.Game.Modes.Osu => osu.Game.Rulesets.Osu}/Objects/Drawables/DrawableOsuHitObject.cs (89%) rename {osu.Game.Modes.Osu => osu.Game.Rulesets.Osu}/Objects/Drawables/DrawableOsuJudgement.cs (76%) rename {osu.Game.Modes.Osu => osu.Game.Rulesets.Osu}/Objects/Drawables/DrawableSlider.cs (95%) rename {osu.Game.Modes.Osu => osu.Game.Rulesets.Osu}/Objects/Drawables/DrawableSliderTick.cs (92%) rename {osu.Game.Modes.Osu => osu.Game.Rulesets.Osu}/Objects/Drawables/DrawableSpinner.cs (93%) rename {osu.Game.Modes.Osu => osu.Game.Rulesets.Osu}/Objects/Drawables/Pieces/ApproachCircle.cs (90%) rename {osu.Game.Modes.Osu => osu.Game.Rulesets.Osu}/Objects/Drawables/Pieces/CirclePiece.cs (93%) rename {osu.Game.Modes.Osu => osu.Game.Rulesets.Osu}/Objects/Drawables/Pieces/ExplodePiece.cs (90%) rename {osu.Game.Modes.Osu => osu.Game.Rulesets.Osu}/Objects/Drawables/Pieces/FlashPiece.cs (89%) rename {osu.Game.Modes.Osu => osu.Game.Rulesets.Osu}/Objects/Drawables/Pieces/GlowPiece.cs (91%) rename {osu.Game.Modes.Osu => osu.Game.Rulesets.Osu}/Objects/Drawables/Pieces/NumberPiece.cs (93%) rename {osu.Game.Modes.Osu => osu.Game.Rulesets.Osu}/Objects/Drawables/Pieces/RingPiece.cs (90%) rename {osu.Game.Modes.Osu => osu.Game.Rulesets.Osu}/Objects/Drawables/Pieces/SliderBall.cs (95%) rename {osu.Game.Modes.Osu => osu.Game.Rulesets.Osu}/Objects/Drawables/Pieces/SliderBody.cs (96%) rename {osu.Game.Modes.Osu => osu.Game.Rulesets.Osu}/Objects/Drawables/Pieces/SliderBouncer.cs (93%) rename {osu.Game.Modes.Osu => osu.Game.Rulesets.Osu}/Objects/Drawables/Pieces/SpinnerBackground.cs (80%) rename {osu.Game.Modes.Osu => osu.Game.Rulesets.Osu}/Objects/Drawables/Pieces/SpinnerDisc.cs (95%) rename {osu.Game.Modes.Osu => osu.Game.Rulesets.Osu}/Objects/Drawables/Pieces/TrianglesPiece.cs (89%) rename {osu.Game.Modes.Osu => osu.Game.Rulesets.Osu}/Objects/HitCircle.cs (81%) rename {osu.Game.Modes.Osu => osu.Game.Rulesets.Osu}/Objects/OsuHitObject.cs (91%) rename {osu.Game.Modes.Osu => osu.Game.Rulesets.Osu}/Objects/OsuHitObjectDifficulty.cs (97%) rename {osu.Game.Modes.Osu => osu.Game.Rulesets.Osu}/Objects/Slider.cs (94%) rename {osu.Game.Modes.Osu => osu.Game.Rulesets.Osu}/Objects/SliderTick.cs (83%) rename {osu.Game.Modes.Osu => osu.Game.Rulesets.Osu}/Objects/Spinner.cs (79%) rename {osu.Game.Modes.Osu => osu.Game.Rulesets.Osu}/OpenTK.dll.config (100%) rename {osu.Game.Modes.Osu => osu.Game.Rulesets.Osu}/OsuAutoReplay.cs (96%) rename {osu.Game.Modes.Osu => osu.Game.Rulesets.Osu}/OsuDifficultyCalculator.cs (96%) rename {osu.Game.Modes.Osu => osu.Game.Rulesets.Osu}/OsuKeyConversionInputManager.cs (95%) rename {osu.Game.Modes.Osu => osu.Game.Rulesets.Osu}/OsuRuleset.cs (90%) rename {osu.Game.Modes.Osu => osu.Game.Rulesets.Osu}/Properties/AssemblyInfo.cs (100%) rename {osu.Game.Modes.Osu => osu.Game.Rulesets.Osu}/Scoring/OsuScore.cs (71%) rename {osu.Game.Modes.Osu => osu.Game.Rulesets.Osu}/Scoring/OsuScoreProcessor.cs (83%) rename {osu.Game.Modes.Osu => osu.Game.Rulesets.Osu}/UI/OsuHitRenderer.cs (78%) rename {osu.Game.Modes.Osu => osu.Game.Rulesets.Osu}/UI/OsuPlayfield.cs (88%) rename osu.Game.Modes.Osu/osu.Game.Modes.Osu.csproj => osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj (95%) rename {osu.Game.Modes.Osu => osu.Game.Rulesets.Osu}/packages.config (100%) rename {osu.Game.Modes.Taiko => osu.Game.Rulesets.Taiko}/Beatmaps/TaikoBeatmapConverter.cs (95%) rename {osu.Game.Modes.Taiko => osu.Game.Rulesets.Taiko}/Judgements/TaikoDrumRollTickJudgement.cs (92%) rename {osu.Game.Modes.Taiko => osu.Game.Rulesets.Taiko}/Judgements/TaikoHitResult.cs (84%) rename {osu.Game.Modes.Taiko => osu.Game.Rulesets.Taiko}/Judgements/TaikoJudgement.cs (93%) rename {osu.Game.Modes.Taiko => osu.Game.Rulesets.Taiko}/Judgements/TaikoStrongHitJudgement.cs (84%) rename {osu.Game.Modes.Taiko => osu.Game.Rulesets.Taiko}/Mods/TaikoMod.cs (87%) rename {osu.Game.Modes.Taiko => osu.Game.Rulesets.Taiko}/Objects/BarLine.cs (80%) rename {osu.Game.Modes.Taiko => osu.Game.Rulesets.Taiko}/Objects/CentreHit.cs (79%) rename {osu.Game.Modes.Taiko => osu.Game.Rulesets.Taiko}/Objects/Drawables/DrawableBarLine.cs (94%) rename {osu.Game.Modes.Taiko => osu.Game.Rulesets.Taiko}/Objects/Drawables/DrawableBarLineMajor.cs (94%) rename {osu.Game.Modes.Taiko => osu.Game.Rulesets.Taiko}/Objects/Drawables/DrawableCentreHit.cs (83%) rename {osu.Game.Modes.Taiko => osu.Game.Rulesets.Taiko}/Objects/Drawables/DrawableCentreHitStrong.cs (83%) rename {osu.Game.Modes.Taiko => osu.Game.Rulesets.Taiko}/Objects/Drawables/DrawableDrumRoll.cs (92%) rename {osu.Game.Modes.Taiko => osu.Game.Rulesets.Taiko}/Objects/Drawables/DrawableDrumRollTick.cs (87%) rename {osu.Game.Modes.Taiko => osu.Game.Rulesets.Taiko}/Objects/Drawables/DrawableHit.cs (91%) rename {osu.Game.Modes.Taiko => osu.Game.Rulesets.Taiko}/Objects/Drawables/DrawableHitStrong.cs (90%) rename {osu.Game.Modes.Taiko => osu.Game.Rulesets.Taiko}/Objects/Drawables/DrawableRimHit.cs (83%) rename {osu.Game.Modes.Taiko => osu.Game.Rulesets.Taiko}/Objects/Drawables/DrawableRimHitStrong.cs (83%) rename {osu.Game.Modes.Taiko => osu.Game.Rulesets.Taiko}/Objects/Drawables/DrawableSwell.cs (95%) rename {osu.Game.Modes.Taiko => osu.Game.Rulesets.Taiko}/Objects/Drawables/DrawableTaikoHitObject.cs (91%) rename {osu.Game.Modes.Taiko => osu.Game.Rulesets.Taiko}/Objects/Drawables/Pieces/CentreHitSymbolPiece.cs (90%) rename {osu.Game.Modes.Taiko => osu.Game.Rulesets.Taiko}/Objects/Drawables/Pieces/CirclePiece.cs (95%) rename {osu.Game.Modes.Taiko => osu.Game.Rulesets.Taiko}/Objects/Drawables/Pieces/ElongatedCirclePiece.cs (89%) rename {osu.Game.Modes.Taiko => osu.Game.Rulesets.Taiko}/Objects/Drawables/Pieces/RimHitSymbolPiece.cs (91%) rename {osu.Game.Modes.Taiko => osu.Game.Rulesets.Taiko}/Objects/Drawables/Pieces/SwellSymbolPiece.cs (88%) rename {osu.Game.Modes.Taiko => osu.Game.Rulesets.Taiko}/Objects/Drawables/Pieces/TaikoPiece.cs (91%) rename {osu.Game.Modes.Taiko => osu.Game.Rulesets.Taiko}/Objects/Drawables/Pieces/TickPiece.cs (93%) rename {osu.Game.Modes.Taiko => osu.Game.Rulesets.Taiko}/Objects/DrumRoll.cs (94%) rename {osu.Game.Modes.Taiko => osu.Game.Rulesets.Taiko}/Objects/DrumRollTick.cs (91%) rename {osu.Game.Modes.Taiko => osu.Game.Rulesets.Taiko}/Objects/Hit.cs (93%) rename {osu.Game.Modes.Taiko => osu.Game.Rulesets.Taiko}/Objects/RimHit.cs (79%) rename {osu.Game.Modes.Taiko => osu.Game.Rulesets.Taiko}/Objects/Swell.cs (82%) rename {osu.Game.Modes.Taiko => osu.Game.Rulesets.Taiko}/Objects/TaikoHitObject.cs (93%) rename {osu.Game.Modes.Taiko => osu.Game.Rulesets.Taiko}/OpenTK.dll.config (100%) rename {osu.Game.Modes.Taiko => osu.Game.Rulesets.Taiko}/Properties/AssemblyInfo.cs (90%) rename {osu.Game.Modes.Taiko => osu.Game.Rulesets.Taiko}/Replays/TaikoAutoReplay.cs (93%) rename {osu.Game.Modes.Taiko => osu.Game.Rulesets.Taiko}/Replays/TaikoFramedReplayInputHandler.cs (90%) rename {osu.Game.Modes.Taiko => osu.Game.Rulesets.Taiko}/Scoring/TaikoScoreProcessor.cs (95%) rename {osu.Game.Modes.Taiko => osu.Game.Rulesets.Taiko}/TaikoDifficultyCalculator.cs (79%) rename {osu.Game.Modes.Taiko => osu.Game.Rulesets.Taiko}/TaikoRuleset.cs (90%) rename {osu.Game.Modes.Taiko => osu.Game.Rulesets.Taiko}/UI/DrawableTaikoJudgement.cs (87%) rename {osu.Game.Modes.Taiko => osu.Game.Rulesets.Taiko}/UI/HitExplosion.cs (91%) rename {osu.Game.Modes.Taiko => osu.Game.Rulesets.Taiko}/UI/HitTarget.cs (95%) rename {osu.Game.Modes.Taiko => osu.Game.Rulesets.Taiko}/UI/InputDrum.cs (96%) rename {osu.Game.Modes.Taiko => osu.Game.Rulesets.Taiko}/UI/TaikoHitRenderer.cs (88%) rename {osu.Game.Modes.Taiko => osu.Game.Rulesets.Taiko}/UI/TaikoPlayfield.cs (95%) rename osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj => osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj (95%) rename {osu.Game.Modes.Taiko => osu.Game.Rulesets.Taiko}/packages.config (100%) rename osu.Game/{Modes => Rulesets}/BeatmapStatistic.cs (88%) rename osu.Game/{Modes => Rulesets}/Beatmaps/BeatmapConverter.cs (95%) rename osu.Game/{Modes => Rulesets}/Beatmaps/BeatmapProcessor.cs (89%) rename osu.Game/{Modes => Rulesets}/Judgements/DrawableJudgement.cs (94%) rename osu.Game/{Modes => Rulesets}/Judgements/IPartialJudgement.cs (87%) rename osu.Game/{Modes => Rulesets}/Judgements/Judgement.cs (88%) rename osu.Game/{Modes => Rulesets}/Mods/IApplicableMod.cs (85%) rename osu.Game/{Modes => Rulesets}/Mods/Mod.cs (95%) rename osu.Game/{Modes => Rulesets}/Mods/ModType.cs (85%) rename osu.Game/{Modes => Rulesets}/Objects/BezierApproximator.cs (97%) rename osu.Game/{Modes => Rulesets}/Objects/CircularArcApproximator.cs (96%) rename osu.Game/{Modes => Rulesets}/Objects/CurvedHitObject.cs (91%) rename osu.Game/{Modes => Rulesets}/Objects/Drawables/ArmedState.cs (80%) rename osu.Game/{Modes => Rulesets}/Objects/Drawables/DrawableHitObject.cs (94%) rename osu.Game/{Modes => Rulesets}/Objects/Drawables/HitResult.cs (90%) rename osu.Game/{Modes => Rulesets}/Objects/Drawables/IDrawableHitObjectWithProxiedApproach.cs (83%) rename osu.Game/{Modes => Rulesets}/Objects/HitObject.cs (95%) rename osu.Game/{Modes => Rulesets}/Objects/HitObjectParser.cs (85%) rename osu.Game/{Modes => Rulesets}/Objects/Legacy/Catch/Hit.cs (79%) rename osu.Game/{Modes => Rulesets}/Objects/Legacy/Catch/HitObjectParser.cs (90%) rename osu.Game/{Modes => Rulesets}/Objects/Legacy/Catch/Slider.cs (80%) rename osu.Game/{Modes => Rulesets}/Objects/Legacy/Catch/Spinner.cs (80%) rename osu.Game/{Modes => Rulesets}/Objects/Legacy/HitObjectParser.cs (96%) rename osu.Game/{Modes => Rulesets}/Objects/Legacy/HitObjectType.cs (86%) rename osu.Game/{Modes => Rulesets}/Objects/Legacy/Hold.cs (83%) rename osu.Game/{Modes => Rulesets}/Objects/Legacy/Mania/Hit.cs (79%) rename osu.Game/{Modes => Rulesets}/Objects/Legacy/Mania/HitObjectParser.cs (90%) rename osu.Game/{Modes => Rulesets}/Objects/Legacy/Mania/Slider.cs (80%) rename osu.Game/{Modes => Rulesets}/Objects/Legacy/Mania/Spinner.cs (81%) rename osu.Game/{Modes => Rulesets}/Objects/Legacy/Osu/Hit.cs (82%) rename osu.Game/{Modes => Rulesets}/Objects/Legacy/Osu/HitObjectParser.cs (90%) rename osu.Game/{Modes => Rulesets}/Objects/Legacy/Osu/Slider.cs (82%) rename osu.Game/{Modes => Rulesets}/Objects/Legacy/Osu/Spinner.cs (84%) rename osu.Game/{Modes => Rulesets}/Objects/Legacy/Taiko/Hit.cs (78%) rename osu.Game/{Modes => Rulesets}/Objects/Legacy/Taiko/HitObjectParser.cs (90%) rename osu.Game/{Modes => Rulesets}/Objects/Legacy/Taiko/Slider.cs (78%) rename osu.Game/{Modes => Rulesets}/Objects/Legacy/Taiko/Spinner.cs (80%) rename osu.Game/{Modes => Rulesets}/Objects/SliderCurve.cs (96%) rename osu.Game/{Modes => Rulesets}/Objects/Types/CurveType.cs (82%) rename osu.Game/{Modes => Rulesets}/Objects/Types/IHasCombo.cs (87%) rename osu.Game/{Modes => Rulesets}/Objects/Types/IHasCurve.cs (95%) rename osu.Game/{Modes => Rulesets}/Objects/Types/IHasDistance.cs (88%) rename osu.Game/{Modes => Rulesets}/Objects/Types/IHasEndTime.cs (89%) rename osu.Game/{Modes => Rulesets}/Objects/Types/IHasHold.cs (85%) rename osu.Game/{Modes => Rulesets}/Objects/Types/IHasPosition.cs (88%) rename osu.Game/{Modes => Rulesets}/Objects/Types/IHasRepeats.cs (88%) rename osu.Game/{Modes => Rulesets}/Objects/Types/IHasXPosition.cs (87%) rename osu.Game/{Modes => Rulesets}/Objects/Types/IHasYPosition.cs (87%) rename osu.Game/{Modes => Rulesets}/Replays/FramedReplayInputHandler.cs (96%) rename osu.Game/{Modes => Rulesets}/Replays/Replay.cs (85%) rename osu.Game/{Modes => Rulesets}/Replays/ReplayButtonState.cs (86%) rename osu.Game/{Modes => Rulesets}/Replays/ReplayFrame.cs (95%) rename osu.Game/{Modes => Rulesets}/Ruleset.cs (87%) rename osu.Game/{Modes => Rulesets}/Scoring/Score.cs (93%) rename osu.Game/{Modes => Rulesets}/Scoring/ScoreProcessor.cs (92%) rename osu.Game/{Modes => Rulesets}/Scoring/ScoreRank.cs (90%) rename osu.Game/{Modes => Rulesets}/UI/ComboCounter.cs (96%) rename osu.Game/{Modes => Rulesets}/UI/ComboResultCounter.cs (95%) rename osu.Game/{Modes => Rulesets}/UI/HealthDisplay.cs (91%) rename osu.Game/{Modes => Rulesets}/UI/HitRenderer.cs (94%) rename osu.Game/{Modes => Rulesets}/UI/HudOverlay.cs (95%) rename osu.Game/{Modes => Rulesets}/UI/ModIcon.cs (94%) rename osu.Game/{Modes => Rulesets}/UI/Playfield.cs (93%) rename osu.Game/{Modes => Rulesets}/UI/StandardComboCounter.cs (96%) rename osu.Game/{Modes => Rulesets}/UI/StandardHealthDisplay.cs (95%) rename osu.Game/{Modes => Rulesets}/UI/StandardHudOverlay.cs (96%) diff --git a/osu.Desktop.Tests/osu.Desktop.Tests.csproj b/osu.Desktop.Tests/osu.Desktop.Tests.csproj index 8afd632bd1..f0620c98ef 100644 --- a/osu.Desktop.Tests/osu.Desktop.Tests.csproj +++ b/osu.Desktop.Tests/osu.Desktop.Tests.csproj @@ -75,21 +75,21 @@ {69051C69-12AE-4E7D-A3E6-460D2E282312} osu.Desktop.VisualTests - + {58F6C80C-1253-4A0E-A465-B8C85EBEADF3} - osu.Game.Modes.Catch + osu.Game.Rulesets.Catch - + {48F4582B-7687-4621-9CBE-5C24197CB536} - osu.Game.Modes.Mania + osu.Game.Rulesets.Mania - + {C92A607B-1FDD-4954-9F92-03FF547D9080} - osu.Game.Modes.Osu + osu.Game.Rulesets.Osu - + {F167E17A-7DE6-4AF5-B920-A5112296C695} - osu.Game.Modes.Taiko + osu.Game.Rulesets.Taiko {0D3FBF8A-7464-4CF7-8C90-3E7886DF2D4D} diff --git a/osu.Desktop.VisualTests/Tests/TestCaseGamefield.cs b/osu.Desktop.VisualTests/Tests/TestCaseGamefield.cs index 87b201a8e8..cb15558ec3 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseGamefield.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseGamefield.cs @@ -9,12 +9,12 @@ using osu.Framework.Testing; using osu.Framework.Timing; using osu.Game.Beatmaps; using osu.Game.Database; -using osu.Game.Modes.Catch.UI; -using osu.Game.Modes.Mania.UI; -using osu.Game.Modes.Objects; -using osu.Game.Modes.Osu.Objects; -using osu.Game.Modes.Osu.UI; -using osu.Game.Modes.Taiko.UI; +using osu.Game.Rulesets.Catch.UI; +using osu.Game.Rulesets.Mania.UI; +using osu.Game.Rulesets.Objects; +using osu.Game.Rulesets.Osu.Objects; +using osu.Game.Rulesets.Osu.UI; +using osu.Game.Rulesets.Taiko.UI; using System.Collections.Generic; using osu.Desktop.VisualTests.Beatmaps; using osu.Framework.Allocation; diff --git a/osu.Desktop.VisualTests/Tests/TestCaseHitObjects.cs b/osu.Desktop.VisualTests/Tests/TestCaseHitObjects.cs index 3d9f3aad79..15b38b3e83 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseHitObjects.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseHitObjects.cs @@ -10,11 +10,11 @@ using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.UserInterface; using osu.Framework.Testing; using osu.Framework.Timing; -using osu.Game.Modes.Objects; -using osu.Game.Modes.Objects.Drawables; -using osu.Game.Modes.Osu.Judgements; -using osu.Game.Modes.Osu.Objects; -using osu.Game.Modes.Osu.Objects.Drawables; +using osu.Game.Rulesets.Objects; +using osu.Game.Rulesets.Objects.Drawables; +using osu.Game.Rulesets.Osu.Judgements; +using osu.Game.Rulesets.Osu.Objects; +using osu.Game.Rulesets.Osu.Objects.Drawables; using System.Collections.Generic; namespace osu.Desktop.VisualTests.Tests diff --git a/osu.Desktop.VisualTests/Tests/TestCaseLeaderboard.cs b/osu.Desktop.VisualTests/Tests/TestCaseLeaderboard.cs index 44e52c237e..39010baf91 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseLeaderboard.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseLeaderboard.cs @@ -4,9 +4,9 @@ using OpenTK; using osu.Framework.Graphics; using osu.Framework.Testing; -using osu.Game.Modes.Mods; -using osu.Game.Modes.Osu.Mods; -using osu.Game.Modes.Scoring; +using osu.Game.Rulesets.Mods; +using osu.Game.Rulesets.Osu.Mods; +using osu.Game.Rulesets.Scoring; using osu.Game.Screens.Select.Leaderboards; using osu.Game.Users; diff --git a/osu.Desktop.VisualTests/Tests/TestCasePlayer.cs b/osu.Desktop.VisualTests/Tests/TestCasePlayer.cs index c196476545..f28cdd6a7e 100644 --- a/osu.Desktop.VisualTests/Tests/TestCasePlayer.cs +++ b/osu.Desktop.VisualTests/Tests/TestCasePlayer.cs @@ -9,12 +9,12 @@ using osu.Game.Beatmaps; using OpenTK; using osu.Framework.Graphics.Sprites; using osu.Game.Database; -using osu.Game.Modes.Objects; -using osu.Game.Modes.Osu.Objects; +using osu.Game.Rulesets.Objects; +using osu.Game.Rulesets.Osu.Objects; using osu.Game.Screens.Play; using OpenTK.Graphics; using osu.Desktop.VisualTests.Beatmaps; -using osu.Game.Modes.Osu.UI; +using osu.Game.Rulesets.Osu.UI; namespace osu.Desktop.VisualTests.Tests { diff --git a/osu.Desktop.VisualTests/Tests/TestCaseReplay.cs b/osu.Desktop.VisualTests/Tests/TestCaseReplay.cs index ffdca25bb3..e00a912278 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseReplay.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseReplay.cs @@ -2,8 +2,8 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Beatmaps; -using osu.Game.Modes.Mods; -using osu.Game.Modes.Osu.Mods; +using osu.Game.Rulesets.Mods; +using osu.Game.Rulesets.Osu.Mods; using osu.Game.Screens.Play; namespace osu.Desktop.VisualTests.Tests diff --git a/osu.Desktop.VisualTests/Tests/TestCaseScoreCounter.cs b/osu.Desktop.VisualTests/Tests/TestCaseScoreCounter.cs index f3cca16678..d8dac63980 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseScoreCounter.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseScoreCounter.cs @@ -8,7 +8,7 @@ using osu.Framework.Graphics.Sprites; using osu.Framework.MathUtils; using osu.Framework.Testing; using osu.Game.Graphics.UserInterface; -using osu.Game.Modes.UI; +using osu.Game.Rulesets.UI; namespace osu.Desktop.VisualTests.Tests { diff --git a/osu.Desktop.VisualTests/Tests/TestCaseSongProgress.cs b/osu.Desktop.VisualTests/Tests/TestCaseSongProgress.cs index 363b0b481e..a75d70acaf 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseSongProgress.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseSongProgress.cs @@ -6,7 +6,7 @@ using osu.Framework.Graphics; using osu.Framework.MathUtils; using osu.Framework.Testing; using osu.Framework.Timing; -using osu.Game.Modes.Objects; +using osu.Game.Rulesets.Objects; using osu.Game.Screens.Play; namespace osu.Desktop.VisualTests.Tests diff --git a/osu.Desktop.VisualTests/Tests/TestCaseTaikoHitObjects.cs b/osu.Desktop.VisualTests/Tests/TestCaseTaikoHitObjects.cs index b3cb8c3457..d769071bd9 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseTaikoHitObjects.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseTaikoHitObjects.cs @@ -6,7 +6,7 @@ using OpenTK; using OpenTK.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Testing; -using osu.Game.Modes.Taiko.Objects.Drawables.Pieces; +using osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces; namespace osu.Desktop.VisualTests.Tests { diff --git a/osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs b/osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs index 4e9ff4980e..259d0267db 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs @@ -7,11 +7,11 @@ using osu.Framework.Graphics.Containers; using osu.Framework.MathUtils; using osu.Framework.Testing; using osu.Framework.Timing; -using osu.Game.Modes.Objects.Drawables; -using osu.Game.Modes.Taiko.Judgements; -using osu.Game.Modes.Taiko.Objects; -using osu.Game.Modes.Taiko.Objects.Drawables; -using osu.Game.Modes.Taiko.UI; +using osu.Game.Rulesets.Objects.Drawables; +using osu.Game.Rulesets.Taiko.Judgements; +using osu.Game.Rulesets.Taiko.Objects; +using osu.Game.Rulesets.Taiko.Objects.Drawables; +using osu.Game.Rulesets.Taiko.UI; using System; namespace osu.Desktop.VisualTests.Tests diff --git a/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj b/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj index 4fc0a93fb4..80b18c4a9b 100644 --- a/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj +++ b/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj @@ -161,21 +161,21 @@ {d9a367c9-4c1a-489f-9b05-a0cea2b53b58} osu.Game.Resources - + {c92a607b-1fdd-4954-9f92-03ff547d9080} - osu.Game.Modes.Osu + osu.Game.Rulesets.Osu - + {58f6c80c-1253-4a0e-a465-b8c85ebeadf3} - osu.Game.Modes.Catch + osu.Game.Rulesets.Catch - + {48f4582b-7687-4621-9cbe-5c24197cb536} - osu.Game.Modes.Mania + osu.Game.Rulesets.Mania - + {f167e17a-7de6-4af5-b920-a5112296c695} - osu.Game.Modes.Taiko + osu.Game.Rulesets.Taiko {0d3fbf8a-7464-4cf7-8c90-3e7886df2d4d} diff --git a/osu.Desktop/osu.Desktop.csproj b/osu.Desktop/osu.Desktop.csproj index 553dff6c6f..4f66dfd3eb 100644 --- a/osu.Desktop/osu.Desktop.csproj +++ b/osu.Desktop/osu.Desktop.csproj @@ -198,21 +198,21 @@ {d9a367c9-4c1a-489f-9b05-a0cea2b53b58} osu.Game.Resources - + {c92a607b-1fdd-4954-9f92-03ff547d9080} - osu.Game.Modes.Osu + osu.Game.Rulesets.Osu - + {58f6c80c-1253-4a0e-a465-b8c85ebeadf3} - osu.Game.Modes.Catch + osu.Game.Rulesets.Catch - + {48f4582b-7687-4621-9cbe-5c24197cb536} - osu.Game.Modes.Mania + osu.Game.Rulesets.Mania - + {f167e17a-7de6-4af5-b920-a5112296c695} - osu.Game.Modes.Taiko + osu.Game.Rulesets.Taiko {0d3fbf8a-7464-4cf7-8c90-3e7886df2d4d} diff --git a/osu.Game.Modes.Catch/Beatmaps/CatchBeatmapConverter.cs b/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapConverter.cs similarity index 73% rename from osu.Game.Modes.Catch/Beatmaps/CatchBeatmapConverter.cs rename to osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapConverter.cs index bd09e19ab8..f9859cd244 100644 --- a/osu.Game.Modes.Catch/Beatmaps/CatchBeatmapConverter.cs +++ b/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapConverter.cs @@ -2,14 +2,14 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Beatmaps; -using osu.Game.Modes.Catch.Objects; +using osu.Game.Rulesets.Catch.Objects; using System.Collections.Generic; using System; -using osu.Game.Modes.Objects.Types; -using osu.Game.Modes.Beatmaps; -using osu.Game.Modes.Objects; +using osu.Game.Rulesets.Objects.Types; +using osu.Game.Rulesets.Beatmaps; +using osu.Game.Rulesets.Objects; -namespace osu.Game.Modes.Catch.Beatmaps +namespace osu.Game.Rulesets.Catch.Beatmaps { internal class CatchBeatmapConverter : BeatmapConverter { diff --git a/osu.Game.Modes.Catch/CatchDifficultyCalculator.cs b/osu.Game.Rulesets.Catch/CatchDifficultyCalculator.cs similarity index 79% rename from osu.Game.Modes.Catch/CatchDifficultyCalculator.cs rename to osu.Game.Rulesets.Catch/CatchDifficultyCalculator.cs index 7e47db6259..a865299cff 100644 --- a/osu.Game.Modes.Catch/CatchDifficultyCalculator.cs +++ b/osu.Game.Rulesets.Catch/CatchDifficultyCalculator.cs @@ -2,12 +2,12 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Beatmaps; -using osu.Game.Modes.Beatmaps; -using osu.Game.Modes.Catch.Beatmaps; -using osu.Game.Modes.Catch.Objects; +using osu.Game.Rulesets.Beatmaps; +using osu.Game.Rulesets.Catch.Beatmaps; +using osu.Game.Rulesets.Catch.Objects; using System.Collections.Generic; -namespace osu.Game.Modes.Catch +namespace osu.Game.Rulesets.Catch { public class CatchDifficultyCalculator : DifficultyCalculator { diff --git a/osu.Game.Modes.Catch/CatchRuleset.cs b/osu.Game.Rulesets.Catch/CatchRuleset.cs similarity index 90% rename from osu.Game.Modes.Catch/CatchRuleset.cs rename to osu.Game.Rulesets.Catch/CatchRuleset.cs index 6aafb2a3c6..a6faf13d51 100644 --- a/osu.Game.Modes.Catch/CatchRuleset.cs +++ b/osu.Game.Rulesets.Catch/CatchRuleset.cs @@ -4,16 +4,16 @@ using OpenTK.Input; using osu.Game.Beatmaps; using osu.Game.Graphics; -using osu.Game.Modes.Catch.Mods; -using osu.Game.Modes.Catch.UI; -using osu.Game.Modes.Mods; -using osu.Game.Modes.UI; +using osu.Game.Rulesets.Catch.Mods; +using osu.Game.Rulesets.Catch.UI; +using osu.Game.Rulesets.Mods; +using osu.Game.Rulesets.UI; using osu.Game.Screens.Play; using System.Collections.Generic; -using osu.Game.Modes.Catch.Scoring; -using osu.Game.Modes.Scoring; +using osu.Game.Rulesets.Catch.Scoring; +using osu.Game.Rulesets.Scoring; -namespace osu.Game.Modes.Catch +namespace osu.Game.Rulesets.Catch { public class CatchRuleset : Ruleset { diff --git a/osu.Game.Modes.Catch/Judgements/CatchJudgement.cs b/osu.Game.Rulesets.Catch/Judgements/CatchJudgement.cs similarity index 78% rename from osu.Game.Modes.Catch/Judgements/CatchJudgement.cs rename to osu.Game.Rulesets.Catch/Judgements/CatchJudgement.cs index eaacedd7e0..f0125b4c3a 100644 --- a/osu.Game.Modes.Catch/Judgements/CatchJudgement.cs +++ b/osu.Game.Rulesets.Catch/Judgements/CatchJudgement.cs @@ -1,9 +1,9 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Game.Modes.Judgements; +using osu.Game.Rulesets.Judgements; -namespace osu.Game.Modes.Catch.Judgements +namespace osu.Game.Rulesets.Catch.Judgements { public class CatchJudgement : Judgement { diff --git a/osu.Game.Modes.Catch/Mods/CatchMod.cs b/osu.Game.Rulesets.Catch/Mods/CatchMod.cs similarity index 91% rename from osu.Game.Modes.Catch/Mods/CatchMod.cs rename to osu.Game.Rulesets.Catch/Mods/CatchMod.cs index 97e4e58a5d..64a0c51b72 100644 --- a/osu.Game.Modes.Catch/Mods/CatchMod.cs +++ b/osu.Game.Rulesets.Catch/Mods/CatchMod.cs @@ -1,9 +1,9 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Game.Modes.Mods; +using osu.Game.Rulesets.Mods; -namespace osu.Game.Modes.Catch.Mods +namespace osu.Game.Rulesets.Catch.Mods { public class CatchModNoFail : ModNoFail { diff --git a/osu.Game.Modes.Catch/Objects/CatchBaseHit.cs b/osu.Game.Rulesets.Catch/Objects/CatchBaseHit.cs similarity index 75% rename from osu.Game.Modes.Catch/Objects/CatchBaseHit.cs rename to osu.Game.Rulesets.Catch/Objects/CatchBaseHit.cs index ee66894d31..de0547580f 100644 --- a/osu.Game.Modes.Catch/Objects/CatchBaseHit.cs +++ b/osu.Game.Rulesets.Catch/Objects/CatchBaseHit.cs @@ -1,9 +1,9 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Game.Modes.Objects; +using osu.Game.Rulesets.Objects; -namespace osu.Game.Modes.Catch.Objects +namespace osu.Game.Rulesets.Catch.Objects { public abstract class CatchBaseHit : HitObject { diff --git a/osu.Game.Modes.Catch/Objects/Drawable/DrawableFruit.cs b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableFruit.cs similarity index 93% rename from osu.Game.Modes.Catch/Objects/Drawable/DrawableFruit.cs rename to osu.Game.Rulesets.Catch/Objects/Drawable/DrawableFruit.cs index 885048b938..ae6585bdb2 100644 --- a/osu.Game.Modes.Catch/Objects/Drawable/DrawableFruit.cs +++ b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableFruit.cs @@ -8,7 +8,7 @@ using osu.Framework.Graphics.Textures; using osu.Framework.Graphics.Transforms; using OpenTK; -namespace osu.Game.Modes.Catch.Objects.Drawable +namespace osu.Game.Rulesets.Catch.Objects.Drawable { internal class DrawableFruit : Sprite { diff --git a/osu.Game.Modes.Catch/Objects/Droplet.cs b/osu.Game.Rulesets.Catch/Objects/Droplet.cs similarity index 80% rename from osu.Game.Modes.Catch/Objects/Droplet.cs rename to osu.Game.Rulesets.Catch/Objects/Droplet.cs index dd58fec7e8..b1206e0d75 100644 --- a/osu.Game.Modes.Catch/Objects/Droplet.cs +++ b/osu.Game.Rulesets.Catch/Objects/Droplet.cs @@ -1,7 +1,7 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -namespace osu.Game.Modes.Catch.Objects +namespace osu.Game.Rulesets.Catch.Objects { public class Droplet : CatchBaseHit { diff --git a/osu.Game.Modes.Catch/Objects/Fruit.cs b/osu.Game.Rulesets.Catch/Objects/Fruit.cs similarity index 80% rename from osu.Game.Modes.Catch/Objects/Fruit.cs rename to osu.Game.Rulesets.Catch/Objects/Fruit.cs index 15363a7031..fc55f83969 100644 --- a/osu.Game.Modes.Catch/Objects/Fruit.cs +++ b/osu.Game.Rulesets.Catch/Objects/Fruit.cs @@ -1,7 +1,7 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -namespace osu.Game.Modes.Catch.Objects +namespace osu.Game.Rulesets.Catch.Objects { public class Fruit : CatchBaseHit { diff --git a/osu.Game.Modes.Catch/OpenTK.dll.config b/osu.Game.Rulesets.Catch/OpenTK.dll.config similarity index 100% rename from osu.Game.Modes.Catch/OpenTK.dll.config rename to osu.Game.Rulesets.Catch/OpenTK.dll.config diff --git a/osu.Game.Modes.Catch/Properties/AssemblyInfo.cs b/osu.Game.Rulesets.Catch/Properties/AssemblyInfo.cs similarity index 90% rename from osu.Game.Modes.Catch/Properties/AssemblyInfo.cs rename to osu.Game.Rulesets.Catch/Properties/AssemblyInfo.cs index 1d25411e73..42fbc7e082 100644 --- a/osu.Game.Modes.Catch/Properties/AssemblyInfo.cs +++ b/osu.Game.Rulesets.Catch/Properties/AssemblyInfo.cs @@ -7,11 +7,11 @@ using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly: AssemblyTitle("osu.Game.Modes.Catch")] +[assembly: AssemblyTitle("osu.Game.Rulesets.Catch")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("osu.Game.Modes.Catch")] +[assembly: AssemblyProduct("osu.Game.Rulesets.Catch")] [assembly: AssemblyCopyright("Copyright © 2016")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/osu.Game.Modes.Catch/Scoring/CatchScoreProcessor.cs b/osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs similarity index 72% rename from osu.Game.Modes.Catch/Scoring/CatchScoreProcessor.cs rename to osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs index 1b9bedf7fb..3f29547e46 100644 --- a/osu.Game.Modes.Catch/Scoring/CatchScoreProcessor.cs +++ b/osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs @@ -1,12 +1,12 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Game.Modes.Catch.Judgements; -using osu.Game.Modes.Catch.Objects; -using osu.Game.Modes.Scoring; -using osu.Game.Modes.UI; +using osu.Game.Rulesets.Catch.Judgements; +using osu.Game.Rulesets.Catch.Objects; +using osu.Game.Rulesets.Scoring; +using osu.Game.Rulesets.UI; -namespace osu.Game.Modes.Catch.Scoring +namespace osu.Game.Rulesets.Catch.Scoring { internal class CatchScoreProcessor : ScoreProcessor { diff --git a/osu.Game.Modes.Catch/UI/CatchHitRenderer.cs b/osu.Game.Rulesets.Catch/UI/CatchHitRenderer.cs similarity index 69% rename from osu.Game.Modes.Catch/UI/CatchHitRenderer.cs rename to osu.Game.Rulesets.Catch/UI/CatchHitRenderer.cs index 795904935d..f34585be55 100644 --- a/osu.Game.Modes.Catch/UI/CatchHitRenderer.cs +++ b/osu.Game.Rulesets.Catch/UI/CatchHitRenderer.cs @@ -2,16 +2,16 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Beatmaps; -using osu.Game.Modes.Beatmaps; -using osu.Game.Modes.Catch.Beatmaps; -using osu.Game.Modes.Catch.Judgements; -using osu.Game.Modes.Catch.Objects; -using osu.Game.Modes.Catch.Scoring; -using osu.Game.Modes.Objects.Drawables; -using osu.Game.Modes.Scoring; -using osu.Game.Modes.UI; +using osu.Game.Rulesets.Beatmaps; +using osu.Game.Rulesets.Catch.Beatmaps; +using osu.Game.Rulesets.Catch.Judgements; +using osu.Game.Rulesets.Catch.Objects; +using osu.Game.Rulesets.Catch.Scoring; +using osu.Game.Rulesets.Objects.Drawables; +using osu.Game.Rulesets.Scoring; +using osu.Game.Rulesets.UI; -namespace osu.Game.Modes.Catch.UI +namespace osu.Game.Rulesets.Catch.UI { public class CatchHitRenderer : HitRenderer { diff --git a/osu.Game.Modes.Catch/UI/CatchPlayfield.cs b/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs similarity index 77% rename from osu.Game.Modes.Catch/UI/CatchPlayfield.cs rename to osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs index f8792a7fd5..4b1e6e93cd 100644 --- a/osu.Game.Modes.Catch/UI/CatchPlayfield.cs +++ b/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs @@ -3,12 +3,12 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; -using osu.Game.Modes.Catch.Objects; -using osu.Game.Modes.UI; +using osu.Game.Rulesets.Catch.Objects; +using osu.Game.Rulesets.UI; using OpenTK; -using osu.Game.Modes.Catch.Judgements; +using osu.Game.Rulesets.Catch.Judgements; -namespace osu.Game.Modes.Catch.UI +namespace osu.Game.Rulesets.Catch.UI { public class CatchPlayfield : Playfield { diff --git a/osu.Game.Modes.Catch/osu.Game.Modes.Catch.csproj b/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj similarity index 92% rename from osu.Game.Modes.Catch/osu.Game.Modes.Catch.csproj rename to osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj index dc1ea5dc23..281d2b5a79 100644 --- a/osu.Game.Modes.Catch/osu.Game.Modes.Catch.csproj +++ b/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj @@ -7,8 +7,8 @@ {58F6C80C-1253-4A0E-A465-B8C85EBEADF3} Library Properties - osu.Game.Modes.Catch - osu.Game.Modes.Catch + osu.Game.Rulesets.Catch + osu.Game.Rulesets.Catch v4.5 512 @@ -73,9 +73,9 @@ {C76BF5B3-985E-4D39-95FE-97C9C879B83A} osu.Framework - + {C92A607B-1FDD-4954-9F92-03FF547D9080} - osu.Game.Modes.Osu + osu.Game.Rulesets.Osu {0D3FBF8A-7464-4CF7-8C90-3E7886DF2D4D} diff --git a/osu.Game.Modes.Catch/packages.config b/osu.Game.Rulesets.Catch/packages.config similarity index 100% rename from osu.Game.Modes.Catch/packages.config rename to osu.Game.Rulesets.Catch/packages.config diff --git a/osu.Game.Modes.Mania/Beatmaps/ManiaBeatmapConverter.cs b/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs similarity index 73% rename from osu.Game.Modes.Mania/Beatmaps/ManiaBeatmapConverter.cs rename to osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs index c804fd4eeb..847af965cc 100644 --- a/osu.Game.Modes.Mania/Beatmaps/ManiaBeatmapConverter.cs +++ b/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs @@ -2,14 +2,14 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Beatmaps; -using osu.Game.Modes.Mania.Objects; +using osu.Game.Rulesets.Mania.Objects; using System.Collections.Generic; using System; -using osu.Game.Modes.Objects.Types; -using osu.Game.Modes.Beatmaps; -using osu.Game.Modes.Objects; +using osu.Game.Rulesets.Objects.Types; +using osu.Game.Rulesets.Beatmaps; +using osu.Game.Rulesets.Objects; -namespace osu.Game.Modes.Mania.Beatmaps +namespace osu.Game.Rulesets.Mania.Beatmaps { internal class ManiaBeatmapConverter : BeatmapConverter { diff --git a/osu.Game.Modes.Mania/Judgements/ManiaJudgement.cs b/osu.Game.Rulesets.Mania/Judgements/ManiaJudgement.cs similarity index 78% rename from osu.Game.Modes.Mania/Judgements/ManiaJudgement.cs rename to osu.Game.Rulesets.Mania/Judgements/ManiaJudgement.cs index 3ef5b0f29b..8dafbd01a5 100644 --- a/osu.Game.Modes.Mania/Judgements/ManiaJudgement.cs +++ b/osu.Game.Rulesets.Mania/Judgements/ManiaJudgement.cs @@ -1,9 +1,9 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Game.Modes.Judgements; +using osu.Game.Rulesets.Judgements; -namespace osu.Game.Modes.Mania.Judgements +namespace osu.Game.Rulesets.Mania.Judgements { public class ManiaJudgement : Judgement { diff --git a/osu.Game.Modes.Mania/ManiaDifficultyCalculator.cs b/osu.Game.Rulesets.Mania/ManiaDifficultyCalculator.cs similarity index 79% rename from osu.Game.Modes.Mania/ManiaDifficultyCalculator.cs rename to osu.Game.Rulesets.Mania/ManiaDifficultyCalculator.cs index 84e5ee2d72..e9bcc60d2c 100644 --- a/osu.Game.Modes.Mania/ManiaDifficultyCalculator.cs +++ b/osu.Game.Rulesets.Mania/ManiaDifficultyCalculator.cs @@ -2,12 +2,12 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Beatmaps; -using osu.Game.Modes.Beatmaps; -using osu.Game.Modes.Mania.Beatmaps; -using osu.Game.Modes.Mania.Objects; +using osu.Game.Rulesets.Beatmaps; +using osu.Game.Rulesets.Mania.Beatmaps; +using osu.Game.Rulesets.Mania.Objects; using System.Collections.Generic; -namespace osu.Game.Modes.Mania +namespace osu.Game.Rulesets.Mania { public class ManiaDifficultyCalculator : DifficultyCalculator { diff --git a/osu.Game.Modes.Mania/ManiaRuleset.cs b/osu.Game.Rulesets.Mania/ManiaRuleset.cs similarity index 91% rename from osu.Game.Modes.Mania/ManiaRuleset.cs rename to osu.Game.Rulesets.Mania/ManiaRuleset.cs index 030cea7344..26614075b1 100644 --- a/osu.Game.Modes.Mania/ManiaRuleset.cs +++ b/osu.Game.Rulesets.Mania/ManiaRuleset.cs @@ -3,16 +3,16 @@ using osu.Game.Beatmaps; using osu.Game.Graphics; -using osu.Game.Modes.Mania.Mods; -using osu.Game.Modes.Mania.UI; -using osu.Game.Modes.Mods; -using osu.Game.Modes.UI; +using osu.Game.Rulesets.Mania.Mods; +using osu.Game.Rulesets.Mania.UI; +using osu.Game.Rulesets.Mods; +using osu.Game.Rulesets.UI; using osu.Game.Screens.Play; using System.Collections.Generic; -using osu.Game.Modes.Mania.Scoring; -using osu.Game.Modes.Scoring; +using osu.Game.Rulesets.Mania.Scoring; +using osu.Game.Rulesets.Scoring; -namespace osu.Game.Modes.Mania +namespace osu.Game.Rulesets.Mania { public class ManiaRuleset : Ruleset { diff --git a/osu.Game.Modes.Mania/Mods/ManiaMod.cs b/osu.Game.Rulesets.Mania/Mods/ManiaMod.cs similarity index 94% rename from osu.Game.Modes.Mania/Mods/ManiaMod.cs rename to osu.Game.Rulesets.Mania/Mods/ManiaMod.cs index b330680550..68458caeac 100644 --- a/osu.Game.Modes.Mania/Mods/ManiaMod.cs +++ b/osu.Game.Rulesets.Mania/Mods/ManiaMod.cs @@ -2,10 +2,10 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Graphics; -using osu.Game.Modes.Mods; +using osu.Game.Rulesets.Mods; using System; -namespace osu.Game.Modes.Mania.Mods +namespace osu.Game.Rulesets.Mania.Mods { public class ManiaModNoFail : ModNoFail { diff --git a/osu.Game.Modes.Mania/Objects/Drawable/DrawableNote.cs b/osu.Game.Rulesets.Mania/Objects/Drawable/DrawableNote.cs similarity index 93% rename from osu.Game.Modes.Mania/Objects/Drawable/DrawableNote.cs rename to osu.Game.Rulesets.Mania/Objects/Drawable/DrawableNote.cs index 76999cef21..07a27b1643 100644 --- a/osu.Game.Modes.Mania/Objects/Drawable/DrawableNote.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawable/DrawableNote.cs @@ -8,7 +8,7 @@ using osu.Framework.Graphics.Transforms; using osu.Framework.Graphics; using OpenTK; -namespace osu.Game.Modes.Mania.Objects.Drawable +namespace osu.Game.Rulesets.Mania.Objects.Drawable { public class DrawableNote : Sprite { diff --git a/osu.Game.Modes.Mania/Objects/HoldNote.cs b/osu.Game.Rulesets.Mania/Objects/HoldNote.cs similarity index 79% rename from osu.Game.Modes.Mania/Objects/HoldNote.cs rename to osu.Game.Rulesets.Mania/Objects/HoldNote.cs index 3d95e11118..e8ce1da77f 100644 --- a/osu.Game.Modes.Mania/Objects/HoldNote.cs +++ b/osu.Game.Rulesets.Mania/Objects/HoldNote.cs @@ -1,7 +1,7 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -namespace osu.Game.Modes.Mania.Objects +namespace osu.Game.Rulesets.Mania.Objects { public class HoldNote : Note { diff --git a/osu.Game.Modes.Mania/Objects/ManiaBaseHit.cs b/osu.Game.Rulesets.Mania/Objects/ManiaBaseHit.cs similarity index 74% rename from osu.Game.Modes.Mania/Objects/ManiaBaseHit.cs rename to osu.Game.Rulesets.Mania/Objects/ManiaBaseHit.cs index 8b3afc82d9..4c15b69eb7 100644 --- a/osu.Game.Modes.Mania/Objects/ManiaBaseHit.cs +++ b/osu.Game.Rulesets.Mania/Objects/ManiaBaseHit.cs @@ -1,9 +1,9 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Game.Modes.Objects; +using osu.Game.Rulesets.Objects; -namespace osu.Game.Modes.Mania.Objects +namespace osu.Game.Rulesets.Mania.Objects { public abstract class ManiaBaseHit : HitObject { diff --git a/osu.Game.Modes.Mania/Objects/Note.cs b/osu.Game.Rulesets.Mania/Objects/Note.cs similarity index 80% rename from osu.Game.Modes.Mania/Objects/Note.cs rename to osu.Game.Rulesets.Mania/Objects/Note.cs index c36ed8cf7e..5a6d6003db 100644 --- a/osu.Game.Modes.Mania/Objects/Note.cs +++ b/osu.Game.Rulesets.Mania/Objects/Note.cs @@ -1,7 +1,7 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -namespace osu.Game.Modes.Mania.Objects +namespace osu.Game.Rulesets.Mania.Objects { public class Note : ManiaBaseHit { diff --git a/osu.Game.Modes.Mania/OpenTK.dll.config b/osu.Game.Rulesets.Mania/OpenTK.dll.config similarity index 100% rename from osu.Game.Modes.Mania/OpenTK.dll.config rename to osu.Game.Rulesets.Mania/OpenTK.dll.config diff --git a/osu.Game.Modes.Mania/Properties/AssemblyInfo.cs b/osu.Game.Rulesets.Mania/Properties/AssemblyInfo.cs similarity index 90% rename from osu.Game.Modes.Mania/Properties/AssemblyInfo.cs rename to osu.Game.Rulesets.Mania/Properties/AssemblyInfo.cs index 11c8290f1b..790002acd7 100644 --- a/osu.Game.Modes.Mania/Properties/AssemblyInfo.cs +++ b/osu.Game.Rulesets.Mania/Properties/AssemblyInfo.cs @@ -7,11 +7,11 @@ using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly: AssemblyTitle("osu.Game.Modes.Mania")] +[assembly: AssemblyTitle("osu.Game.Rulesets.Mania")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("osu.Game.Modes.Mania")] +[assembly: AssemblyProduct("osu.Game.Rulesets.Mania")] [assembly: AssemblyCopyright("Copyright © 2016")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/osu.Game.Modes.Mania/Scoring/ManiaScoreProcessor.cs b/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs similarity index 72% rename from osu.Game.Modes.Mania/Scoring/ManiaScoreProcessor.cs rename to osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs index 0f87030e25..ba0304a44a 100644 --- a/osu.Game.Modes.Mania/Scoring/ManiaScoreProcessor.cs +++ b/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs @@ -1,12 +1,12 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Game.Modes.Mania.Judgements; -using osu.Game.Modes.Mania.Objects; -using osu.Game.Modes.Scoring; -using osu.Game.Modes.UI; +using osu.Game.Rulesets.Mania.Judgements; +using osu.Game.Rulesets.Mania.Objects; +using osu.Game.Rulesets.Scoring; +using osu.Game.Rulesets.UI; -namespace osu.Game.Modes.Mania.Scoring +namespace osu.Game.Rulesets.Mania.Scoring { internal class ManiaScoreProcessor : ScoreProcessor { diff --git a/osu.Game.Modes.Mania/UI/ManiaHitRenderer.cs b/osu.Game.Rulesets.Mania/UI/ManiaHitRenderer.cs similarity index 71% rename from osu.Game.Modes.Mania/UI/ManiaHitRenderer.cs rename to osu.Game.Rulesets.Mania/UI/ManiaHitRenderer.cs index ada79e992a..7fb8f95b4c 100644 --- a/osu.Game.Modes.Mania/UI/ManiaHitRenderer.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaHitRenderer.cs @@ -2,16 +2,16 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Beatmaps; -using osu.Game.Modes.Beatmaps; -using osu.Game.Modes.Mania.Beatmaps; -using osu.Game.Modes.Mania.Judgements; -using osu.Game.Modes.Mania.Objects; -using osu.Game.Modes.Mania.Scoring; -using osu.Game.Modes.Objects.Drawables; -using osu.Game.Modes.Scoring; -using osu.Game.Modes.UI; +using osu.Game.Rulesets.Beatmaps; +using osu.Game.Rulesets.Mania.Beatmaps; +using osu.Game.Rulesets.Mania.Judgements; +using osu.Game.Rulesets.Mania.Objects; +using osu.Game.Rulesets.Mania.Scoring; +using osu.Game.Rulesets.Objects.Drawables; +using osu.Game.Rulesets.Scoring; +using osu.Game.Rulesets.UI; -namespace osu.Game.Modes.Mania.UI +namespace osu.Game.Rulesets.Mania.UI { public class ManiaHitRenderer : HitRenderer { diff --git a/osu.Game.Modes.Mania/UI/ManiaPlayfield.cs b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs similarity index 84% rename from osu.Game.Modes.Mania/UI/ManiaPlayfield.cs rename to osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs index deb4ebac25..5eea3d70c0 100644 --- a/osu.Game.Modes.Mania/UI/ManiaPlayfield.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs @@ -3,13 +3,13 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; -using osu.Game.Modes.Mania.Objects; -using osu.Game.Modes.UI; +using osu.Game.Rulesets.Mania.Objects; +using osu.Game.Rulesets.UI; using OpenTK; using OpenTK.Graphics; -using osu.Game.Modes.Mania.Judgements; +using osu.Game.Rulesets.Mania.Judgements; -namespace osu.Game.Modes.Mania.UI +namespace osu.Game.Rulesets.Mania.UI { public class ManiaPlayfield : Playfield { diff --git a/osu.Game.Modes.Mania/osu.Game.Modes.Mania.csproj b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj similarity index 89% rename from osu.Game.Modes.Mania/osu.Game.Modes.Mania.csproj rename to osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj index a8366a465f..facffa757c 100644 --- a/osu.Game.Modes.Mania/osu.Game.Modes.Mania.csproj +++ b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj @@ -7,8 +7,8 @@ {48F4582B-7687-4621-9CBE-5C24197CB536} Library Properties - osu.Game.Modes.Mania - osu.Game.Modes.Mania + osu.Game.Rulesets.Mania + osu.Game.Rulesets.Mania v4.5 512 @@ -66,13 +66,13 @@ {C76BF5B3-985E-4D39-95FE-97C9C879B83A} osu.Framework - + {C92A607B-1FDD-4954-9F92-03FF547D9080} - osu.Game.Modes.Osu + osu.Game.Rulesets.Osu - + {F167E17A-7DE6-4AF5-B920-A5112296C695} - osu.Game.Modes.Taiko + osu.Game.Rulesets.Taiko {0D3FBF8A-7464-4CF7-8C90-3E7886DF2D4D} diff --git a/osu.Game.Modes.Mania/packages.config b/osu.Game.Rulesets.Mania/packages.config similarity index 100% rename from osu.Game.Modes.Mania/packages.config rename to osu.Game.Rulesets.Mania/packages.config diff --git a/osu.Game.Modes.Osu/Beatmaps/OsuBeatmapConverter.cs b/osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapConverter.cs similarity index 87% rename from osu.Game.Modes.Osu/Beatmaps/OsuBeatmapConverter.cs rename to osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapConverter.cs index 0172112969..0eece7fc4c 100644 --- a/osu.Game.Modes.Osu/Beatmaps/OsuBeatmapConverter.cs +++ b/osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapConverter.cs @@ -3,15 +3,15 @@ using OpenTK; using osu.Game.Beatmaps; -using osu.Game.Modes.Objects; -using osu.Game.Modes.Osu.Objects; +using osu.Game.Rulesets.Objects; +using osu.Game.Rulesets.Osu.Objects; using System.Collections.Generic; -using osu.Game.Modes.Objects.Types; +using osu.Game.Rulesets.Objects.Types; using System; -using osu.Game.Modes.Osu.UI; -using osu.Game.Modes.Beatmaps; +using osu.Game.Rulesets.Osu.UI; +using osu.Game.Rulesets.Beatmaps; -namespace osu.Game.Modes.Osu.Beatmaps +namespace osu.Game.Rulesets.Osu.Beatmaps { internal class OsuBeatmapConverter : BeatmapConverter { diff --git a/osu.Game.Modes.Osu/Beatmaps/OsuBeatmapProcessor.cs b/osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapProcessor.cs similarity index 95% rename from osu.Game.Modes.Osu/Beatmaps/OsuBeatmapProcessor.cs rename to osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapProcessor.cs index 912da40f3d..fce0188cda 100644 --- a/osu.Game.Modes.Osu/Beatmaps/OsuBeatmapProcessor.cs +++ b/osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapProcessor.cs @@ -3,12 +3,12 @@ using OpenTK; using osu.Game.Beatmaps; -using osu.Game.Modes.Beatmaps; -using osu.Game.Modes.Objects.Types; -using osu.Game.Modes.Osu.Objects; -using osu.Game.Modes.Osu.Objects.Drawables; +using osu.Game.Rulesets.Beatmaps; +using osu.Game.Rulesets.Objects.Types; +using osu.Game.Rulesets.Osu.Objects; +using osu.Game.Rulesets.Osu.Objects.Drawables; -namespace osu.Game.Modes.Osu.Beatmaps +namespace osu.Game.Rulesets.Osu.Beatmaps { internal class OsuBeatmapProcessor : BeatmapProcessor { diff --git a/osu.Game.Modes.Osu/Judgements/OsuJudgement.cs b/osu.Game.Rulesets.Osu/Judgements/OsuJudgement.cs similarity index 89% rename from osu.Game.Modes.Osu/Judgements/OsuJudgement.cs rename to osu.Game.Rulesets.Osu/Judgements/OsuJudgement.cs index e65d3dde3a..d61e179002 100644 --- a/osu.Game.Modes.Osu/Judgements/OsuJudgement.cs +++ b/osu.Game.Rulesets.Osu/Judgements/OsuJudgement.cs @@ -2,11 +2,11 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; -using osu.Game.Modes.Judgements; -using osu.Game.Modes.Osu.Objects.Drawables; +using osu.Game.Rulesets.Judgements; +using osu.Game.Rulesets.Osu.Objects.Drawables; using osu.Framework.Extensions; -namespace osu.Game.Modes.Osu.Judgements +namespace osu.Game.Rulesets.Osu.Judgements { public class OsuJudgement : Judgement { diff --git a/osu.Game.Modes.Osu/Mods/OsuMod.cs b/osu.Game.Rulesets.Osu/Mods/OsuMod.cs similarity index 93% rename from osu.Game.Modes.Osu/Mods/OsuMod.cs rename to osu.Game.Rulesets.Osu/Mods/OsuMod.cs index db2ee26b7a..bdb5f386d0 100644 --- a/osu.Game.Modes.Osu/Mods/OsuMod.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuMod.cs @@ -3,13 +3,13 @@ using osu.Game.Beatmaps; using osu.Game.Graphics; -using osu.Game.Modes.Mods; -using osu.Game.Modes.Osu.Objects; +using osu.Game.Rulesets.Mods; +using osu.Game.Rulesets.Osu.Objects; using System; using System.Linq; -using osu.Game.Modes.Scoring; +using osu.Game.Rulesets.Scoring; -namespace osu.Game.Modes.Osu.Mods +namespace osu.Game.Rulesets.Osu.Mods { public class OsuModNoFail : ModNoFail { diff --git a/osu.Game.Modes.Osu/Objects/Drawables/Connections/ConnectionRenderer.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Connections/ConnectionRenderer.cs similarity index 83% rename from osu.Game.Modes.Osu/Objects/Drawables/Connections/ConnectionRenderer.cs rename to osu.Game.Rulesets.Osu/Objects/Drawables/Connections/ConnectionRenderer.cs index a680c847ac..192ab0536e 100644 --- a/osu.Game.Modes.Osu/Objects/Drawables/Connections/ConnectionRenderer.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Connections/ConnectionRenderer.cs @@ -2,10 +2,10 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics.Containers; -using osu.Game.Modes.Objects; +using osu.Game.Rulesets.Objects; using System.Collections.Generic; -namespace osu.Game.Modes.Osu.Objects.Drawables.Connections +namespace osu.Game.Rulesets.Osu.Objects.Drawables.Connections { /// /// Connects hit objects visually, for example with follow points. diff --git a/osu.Game.Modes.Osu/Objects/Drawables/Connections/FollowPoint.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Connections/FollowPoint.cs similarity index 93% rename from osu.Game.Modes.Osu/Objects/Drawables/Connections/FollowPoint.cs rename to osu.Game.Rulesets.Osu/Objects/Drawables/Connections/FollowPoint.cs index 7815e3ba41..e1276f30c4 100644 --- a/osu.Game.Modes.Osu/Objects/Drawables/Connections/FollowPoint.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Connections/FollowPoint.cs @@ -8,7 +8,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; -namespace osu.Game.Modes.Osu.Objects.Drawables.Connections +namespace osu.Game.Rulesets.Osu.Objects.Drawables.Connections { public class FollowPoint : Container { diff --git a/osu.Game.Modes.Osu/Objects/Drawables/Connections/FollowPointRenderer.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Connections/FollowPointRenderer.cs similarity index 94% rename from osu.Game.Modes.Osu/Objects/Drawables/Connections/FollowPointRenderer.cs rename to osu.Game.Rulesets.Osu/Objects/Drawables/Connections/FollowPointRenderer.cs index f45e4226dd..a4e032050e 100644 --- a/osu.Game.Modes.Osu/Objects/Drawables/Connections/FollowPointRenderer.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Connections/FollowPointRenderer.cs @@ -4,9 +4,9 @@ using System; using System.Collections.Generic; using OpenTK; -using osu.Game.Modes.Objects.Types; +using osu.Game.Rulesets.Objects.Types; -namespace osu.Game.Modes.Osu.Objects.Drawables.Connections +namespace osu.Game.Rulesets.Osu.Objects.Drawables.Connections { public class FollowPointRenderer : ConnectionRenderer { diff --git a/osu.Game.Modes.Osu/Objects/Drawables/DrawableHitCircle.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs similarity index 93% rename from osu.Game.Modes.Osu/Objects/Drawables/DrawableHitCircle.cs rename to osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs index 68c5ec0a45..4c1a74c675 100644 --- a/osu.Game.Modes.Osu/Objects/Drawables/DrawableHitCircle.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs @@ -3,12 +3,12 @@ using System; using osu.Framework.Graphics; -using osu.Game.Modes.Objects.Drawables; -using osu.Game.Modes.Osu.Objects.Drawables.Pieces; +using osu.Game.Rulesets.Objects.Drawables; +using osu.Game.Rulesets.Osu.Objects.Drawables.Pieces; using OpenTK; -using osu.Game.Modes.Objects.Types; +using osu.Game.Rulesets.Objects.Types; -namespace osu.Game.Modes.Osu.Objects.Drawables +namespace osu.Game.Rulesets.Osu.Objects.Drawables { public class DrawableHitCircle : DrawableOsuHitObject, IDrawableHitObjectWithProxiedApproach { diff --git a/osu.Game.Modes.Osu/Objects/Drawables/DrawableOsuHitObject.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs similarity index 89% rename from osu.Game.Modes.Osu/Objects/Drawables/DrawableOsuHitObject.cs rename to osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs index 816faa0d98..2baf651cc0 100644 --- a/osu.Game.Modes.Osu/Objects/Drawables/DrawableOsuHitObject.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs @@ -2,10 +2,10 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.ComponentModel; -using osu.Game.Modes.Objects.Drawables; -using osu.Game.Modes.Osu.Judgements; +using osu.Game.Rulesets.Objects.Drawables; +using osu.Game.Rulesets.Osu.Judgements; -namespace osu.Game.Modes.Osu.Objects.Drawables +namespace osu.Game.Rulesets.Osu.Objects.Drawables { public class DrawableOsuHitObject : DrawableHitObject { diff --git a/osu.Game.Modes.Osu/Objects/Drawables/DrawableOsuJudgement.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuJudgement.cs similarity index 76% rename from osu.Game.Modes.Osu/Objects/Drawables/DrawableOsuJudgement.cs rename to osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuJudgement.cs index 647c8faef8..eaa0bb7d27 100644 --- a/osu.Game.Modes.Osu/Objects/Drawables/DrawableOsuJudgement.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuJudgement.cs @@ -2,12 +2,12 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; -using osu.Game.Modes.Objects.Drawables; -using osu.Game.Modes.Osu.Judgements; +using osu.Game.Rulesets.Objects.Drawables; +using osu.Game.Rulesets.Osu.Judgements; using OpenTK; -using osu.Game.Modes.Judgements; +using osu.Game.Rulesets.Judgements; -namespace osu.Game.Modes.Osu.Objects.Drawables +namespace osu.Game.Rulesets.Osu.Objects.Drawables { public class DrawableOsuJudgement : DrawableJudgement { diff --git a/osu.Game.Modes.Osu/Objects/Drawables/DrawableSlider.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs similarity index 95% rename from osu.Game.Modes.Osu/Objects/Drawables/DrawableSlider.cs rename to osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs index be326751ba..ed698f5ad3 100644 --- a/osu.Game.Modes.Osu/Objects/Drawables/DrawableSlider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs @@ -3,13 +3,13 @@ using OpenTK; using osu.Framework.Graphics; -using osu.Game.Modes.Objects.Drawables; -using osu.Game.Modes.Osu.Objects.Drawables.Pieces; +using osu.Game.Rulesets.Objects.Drawables; +using osu.Game.Rulesets.Osu.Objects.Drawables.Pieces; using System.Collections.Generic; using System.Linq; using osu.Framework.Graphics.Containers; -namespace osu.Game.Modes.Osu.Objects.Drawables +namespace osu.Game.Rulesets.Osu.Objects.Drawables { public class DrawableSlider : DrawableOsuHitObject, IDrawableHitObjectWithProxiedApproach { diff --git a/osu.Game.Modes.Osu/Objects/Drawables/DrawableSliderTick.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs similarity index 92% rename from osu.Game.Modes.Osu/Objects/Drawables/DrawableSliderTick.cs rename to osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs index 188306c857..86baf9f235 100644 --- a/osu.Game.Modes.Osu/Objects/Drawables/DrawableSliderTick.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs @@ -4,12 +4,12 @@ using System; using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; -using osu.Game.Modes.Objects.Drawables; -using osu.Game.Modes.Osu.Judgements; +using osu.Game.Rulesets.Objects.Drawables; +using osu.Game.Rulesets.Osu.Judgements; using OpenTK; using OpenTK.Graphics; -namespace osu.Game.Modes.Osu.Objects.Drawables +namespace osu.Game.Rulesets.Osu.Objects.Drawables { public class DrawableSliderTick : DrawableOsuHitObject { diff --git a/osu.Game.Modes.Osu/Objects/Drawables/DrawableSpinner.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs similarity index 93% rename from osu.Game.Modes.Osu/Objects/Drawables/DrawableSpinner.cs rename to osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs index d921481290..9ff77a5f3c 100644 --- a/osu.Game.Modes.Osu/Objects/Drawables/DrawableSpinner.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs @@ -5,13 +5,13 @@ using System; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.MathUtils; -using osu.Game.Modes.Objects.Drawables; -using osu.Game.Modes.Osu.Objects.Drawables.Pieces; +using osu.Game.Rulesets.Objects.Drawables; +using osu.Game.Rulesets.Osu.Objects.Drawables.Pieces; using OpenTK; using OpenTK.Graphics; -using osu.Game.Modes.Osu.UI; +using osu.Game.Rulesets.Osu.UI; -namespace osu.Game.Modes.Osu.Objects.Drawables +namespace osu.Game.Rulesets.Osu.Objects.Drawables { public class DrawableSpinner : DrawableOsuHitObject { diff --git a/osu.Game.Modes.Osu/Objects/Drawables/Pieces/ApproachCircle.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/ApproachCircle.cs similarity index 90% rename from osu.Game.Modes.Osu/Objects/Drawables/Pieces/ApproachCircle.cs rename to osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/ApproachCircle.cs index fd4ef64350..323f5fb297 100644 --- a/osu.Game.Modes.Osu/Objects/Drawables/Pieces/ApproachCircle.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/ApproachCircle.cs @@ -7,7 +7,7 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Textures; -namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces +namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces { public class ApproachCircle : Container { diff --git a/osu.Game.Modes.Osu/Objects/Drawables/Pieces/CirclePiece.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/CirclePiece.cs similarity index 93% rename from osu.Game.Modes.Osu/Objects/Drawables/Pieces/CirclePiece.cs rename to osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/CirclePiece.cs index 704a6b7490..9a90c07517 100644 --- a/osu.Game.Modes.Osu/Objects/Drawables/Pieces/CirclePiece.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/CirclePiece.cs @@ -10,7 +10,7 @@ using osu.Framework.Graphics.Textures; using osu.Framework.Input; using OpenTK; -namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces +namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces { public class CirclePiece : Container { diff --git a/osu.Game.Modes.Osu/Objects/Drawables/Pieces/ExplodePiece.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/ExplodePiece.cs similarity index 90% rename from osu.Game.Modes.Osu/Objects/Drawables/Pieces/ExplodePiece.cs rename to osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/ExplodePiece.cs index 97228f610f..e5cf10b88a 100644 --- a/osu.Game.Modes.Osu/Objects/Drawables/Pieces/ExplodePiece.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/ExplodePiece.cs @@ -5,7 +5,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using OpenTK; -namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces +namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces { public class ExplodePiece : Container { diff --git a/osu.Game.Modes.Osu/Objects/Drawables/Pieces/FlashPiece.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/FlashPiece.cs similarity index 89% rename from osu.Game.Modes.Osu/Objects/Drawables/Pieces/FlashPiece.cs rename to osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/FlashPiece.cs index cb60977dab..68ffb756d4 100644 --- a/osu.Game.Modes.Osu/Objects/Drawables/Pieces/FlashPiece.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/FlashPiece.cs @@ -6,7 +6,7 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; using OpenTK; -namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces +namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces { public class FlashPiece : Container { diff --git a/osu.Game.Modes.Osu/Objects/Drawables/Pieces/GlowPiece.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/GlowPiece.cs similarity index 91% rename from osu.Game.Modes.Osu/Objects/Drawables/Pieces/GlowPiece.cs rename to osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/GlowPiece.cs index 6cffa370cf..8a7b353da1 100644 --- a/osu.Game.Modes.Osu/Objects/Drawables/Pieces/GlowPiece.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/GlowPiece.cs @@ -7,7 +7,7 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Textures; -namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces +namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces { public class GlowPiece : Container { diff --git a/osu.Game.Modes.Osu/Objects/Drawables/Pieces/NumberPiece.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/NumberPiece.cs similarity index 93% rename from osu.Game.Modes.Osu/Objects/Drawables/Pieces/NumberPiece.cs rename to osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/NumberPiece.cs index 0ebd274246..07b21657a5 100644 --- a/osu.Game.Modes.Osu/Objects/Drawables/Pieces/NumberPiece.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/NumberPiece.cs @@ -8,7 +8,7 @@ using osu.Framework.Graphics.Sprites; using osu.Game.Graphics.Sprites; using OpenTK.Graphics; -namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces +namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces { public class NumberPiece : Container { diff --git a/osu.Game.Modes.Osu/Objects/Drawables/Pieces/RingPiece.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/RingPiece.cs similarity index 90% rename from osu.Game.Modes.Osu/Objects/Drawables/Pieces/RingPiece.cs rename to osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/RingPiece.cs index 3e172cdc09..a04d3e7a0a 100644 --- a/osu.Game.Modes.Osu/Objects/Drawables/Pieces/RingPiece.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/RingPiece.cs @@ -7,7 +7,7 @@ using osu.Framework.Graphics.Sprites; using OpenTK; using OpenTK.Graphics; -namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces +namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces { public class RingPiece : Container { diff --git a/osu.Game.Modes.Osu/Objects/Drawables/Pieces/SliderBall.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs similarity index 95% rename from osu.Game.Modes.Osu/Objects/Drawables/Pieces/SliderBall.cs rename to osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs index becbebf0c7..4cffc1def3 100644 --- a/osu.Game.Modes.Osu/Objects/Drawables/Pieces/SliderBall.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs @@ -7,7 +7,7 @@ using osu.Framework.Graphics.Sprites; using osu.Framework.Input; using OpenTK.Graphics; -namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces +namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces { public class SliderBall : CircularContainer, ISliderProgress { diff --git a/osu.Game.Modes.Osu/Objects/Drawables/Pieces/SliderBody.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBody.cs similarity index 96% rename from osu.Game.Modes.Osu/Objects/Drawables/Pieces/SliderBody.cs rename to osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBody.cs index e7837471ee..b23fdde4e8 100644 --- a/osu.Game.Modes.Osu/Objects/Drawables/Pieces/SliderBody.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBody.cs @@ -15,7 +15,7 @@ using OpenTK; using OpenTK.Graphics.ES30; using OpenTK.Graphics; -namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces +namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces { public class SliderBody : Container, ISliderProgress { diff --git a/osu.Game.Modes.Osu/Objects/Drawables/Pieces/SliderBouncer.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBouncer.cs similarity index 93% rename from osu.Game.Modes.Osu/Objects/Drawables/Pieces/SliderBouncer.cs rename to osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBouncer.cs index 196b9fb521..65679dd7d3 100644 --- a/osu.Game.Modes.Osu/Objects/Drawables/Pieces/SliderBouncer.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBouncer.cs @@ -5,7 +5,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Graphics; -namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces +namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces { public class SliderBouncer : Container, ISliderProgress { diff --git a/osu.Game.Modes.Osu/Objects/Drawables/Pieces/SpinnerBackground.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerBackground.cs similarity index 80% rename from osu.Game.Modes.Osu/Objects/Drawables/Pieces/SpinnerBackground.cs rename to osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerBackground.cs index 50dab933b0..72024bbe99 100644 --- a/osu.Game.Modes.Osu/Objects/Drawables/Pieces/SpinnerBackground.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerBackground.cs @@ -1,7 +1,7 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces +namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces { public class SpinnerBackground : SpinnerDisc { diff --git a/osu.Game.Modes.Osu/Objects/Drawables/Pieces/SpinnerDisc.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerDisc.cs similarity index 95% rename from osu.Game.Modes.Osu/Objects/Drawables/Pieces/SpinnerDisc.cs rename to osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerDisc.cs index a4fce3deb5..71adba74c7 100644 --- a/osu.Game.Modes.Osu/Objects/Drawables/Pieces/SpinnerDisc.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerDisc.cs @@ -15,7 +15,7 @@ using osu.Game.Graphics; using OpenTK; using OpenTK.Graphics; -namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces +namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces { public class SpinnerDisc : CircularContainer { diff --git a/osu.Game.Modes.Osu/Objects/Drawables/Pieces/TrianglesPiece.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/TrianglesPiece.cs similarity index 89% rename from osu.Game.Modes.Osu/Objects/Drawables/Pieces/TrianglesPiece.cs rename to osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/TrianglesPiece.cs index 26d44f3865..ea3ddb5051 100644 --- a/osu.Game.Modes.Osu/Objects/Drawables/Pieces/TrianglesPiece.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/TrianglesPiece.cs @@ -3,7 +3,7 @@ using osu.Game.Graphics.Backgrounds; -namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces +namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces { public class TrianglesPiece : Triangles { diff --git a/osu.Game.Modes.Osu/Objects/HitCircle.cs b/osu.Game.Rulesets.Osu/Objects/HitCircle.cs similarity index 81% rename from osu.Game.Modes.Osu/Objects/HitCircle.cs rename to osu.Game.Rulesets.Osu/Objects/HitCircle.cs index aa45ac7fb9..be969f1e18 100644 --- a/osu.Game.Modes.Osu/Objects/HitCircle.cs +++ b/osu.Game.Rulesets.Osu/Objects/HitCircle.cs @@ -1,7 +1,7 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -namespace osu.Game.Modes.Osu.Objects +namespace osu.Game.Rulesets.Osu.Objects { public class HitCircle : OsuHitObject { diff --git a/osu.Game.Modes.Osu/Objects/OsuHitObject.cs b/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs similarity index 91% rename from osu.Game.Modes.Osu/Objects/OsuHitObject.cs rename to osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs index 55fc99e41a..723a37ed7b 100644 --- a/osu.Game.Modes.Osu/Objects/OsuHitObject.cs +++ b/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs @@ -1,15 +1,15 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Game.Modes.Objects; +using osu.Game.Rulesets.Objects; using OpenTK; -using osu.Game.Modes.Osu.Objects.Drawables; -using osu.Game.Modes.Objects.Types; +using osu.Game.Rulesets.Osu.Objects.Drawables; +using osu.Game.Rulesets.Objects.Types; using OpenTK.Graphics; using osu.Game.Beatmaps.Timing; using osu.Game.Database; -namespace osu.Game.Modes.Osu.Objects +namespace osu.Game.Rulesets.Osu.Objects { public abstract class OsuHitObject : HitObject, IHasCombo, IHasPosition { diff --git a/osu.Game.Modes.Osu/Objects/OsuHitObjectDifficulty.cs b/osu.Game.Rulesets.Osu/Objects/OsuHitObjectDifficulty.cs similarity index 97% rename from osu.Game.Modes.Osu/Objects/OsuHitObjectDifficulty.cs rename to osu.Game.Rulesets.Osu/Objects/OsuHitObjectDifficulty.cs index 322f6b077a..1786771dca 100644 --- a/osu.Game.Modes.Osu/Objects/OsuHitObjectDifficulty.cs +++ b/osu.Game.Rulesets.Osu/Objects/OsuHitObjectDifficulty.cs @@ -6,7 +6,7 @@ using System; using System.Diagnostics; using System.Linq; -namespace osu.Game.Modes.Osu.Objects +namespace osu.Game.Rulesets.Osu.Objects { internal class OsuHitObjectDifficulty { diff --git a/osu.Game.Modes.Osu/Objects/Slider.cs b/osu.Game.Rulesets.Osu/Objects/Slider.cs similarity index 94% rename from osu.Game.Modes.Osu/Objects/Slider.cs rename to osu.Game.Rulesets.Osu/Objects/Slider.cs index a01c517cb2..167bf21670 100644 --- a/osu.Game.Modes.Osu/Objects/Slider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Slider.cs @@ -3,15 +3,15 @@ using OpenTK; using osu.Game.Beatmaps.Timing; -using osu.Game.Modes.Objects.Types; +using osu.Game.Rulesets.Objects.Types; using System; using System.Collections.Generic; -using osu.Game.Modes.Objects; +using osu.Game.Rulesets.Objects; using osu.Game.Database; using System.Linq; using osu.Game.Audio; -namespace osu.Game.Modes.Osu.Objects +namespace osu.Game.Rulesets.Osu.Objects { public class Slider : OsuHitObject, IHasCurve { diff --git a/osu.Game.Modes.Osu/Objects/SliderTick.cs b/osu.Game.Rulesets.Osu/Objects/SliderTick.cs similarity index 83% rename from osu.Game.Modes.Osu/Objects/SliderTick.cs rename to osu.Game.Rulesets.Osu/Objects/SliderTick.cs index 67f393b126..7112a39f97 100644 --- a/osu.Game.Modes.Osu/Objects/SliderTick.cs +++ b/osu.Game.Rulesets.Osu/Objects/SliderTick.cs @@ -1,7 +1,7 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -namespace osu.Game.Modes.Osu.Objects +namespace osu.Game.Rulesets.Osu.Objects { public class SliderTick : OsuHitObject { diff --git a/osu.Game.Modes.Osu/Objects/Spinner.cs b/osu.Game.Rulesets.Osu/Objects/Spinner.cs similarity index 79% rename from osu.Game.Modes.Osu/Objects/Spinner.cs rename to osu.Game.Rulesets.Osu/Objects/Spinner.cs index dd9a6c386a..0a2c05833a 100644 --- a/osu.Game.Modes.Osu/Objects/Spinner.cs +++ b/osu.Game.Rulesets.Osu/Objects/Spinner.cs @@ -1,9 +1,9 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Game.Modes.Objects.Types; +using osu.Game.Rulesets.Objects.Types; -namespace osu.Game.Modes.Osu.Objects +namespace osu.Game.Rulesets.Osu.Objects { public class Spinner : OsuHitObject, IHasEndTime { diff --git a/osu.Game.Modes.Osu/OpenTK.dll.config b/osu.Game.Rulesets.Osu/OpenTK.dll.config similarity index 100% rename from osu.Game.Modes.Osu/OpenTK.dll.config rename to osu.Game.Rulesets.Osu/OpenTK.dll.config diff --git a/osu.Game.Modes.Osu/OsuAutoReplay.cs b/osu.Game.Rulesets.Osu/OsuAutoReplay.cs similarity index 96% rename from osu.Game.Modes.Osu/OsuAutoReplay.cs rename to osu.Game.Rulesets.Osu/OsuAutoReplay.cs index ae85bd72d8..6fc005fb6a 100644 --- a/osu.Game.Modes.Osu/OsuAutoReplay.cs +++ b/osu.Game.Rulesets.Osu/OsuAutoReplay.cs @@ -4,16 +4,16 @@ using OpenTK; using osu.Framework.MathUtils; using osu.Game.Beatmaps; -using osu.Game.Modes.Osu.Objects; -using osu.Game.Modes.Osu.Objects.Drawables; +using osu.Game.Rulesets.Osu.Objects; +using osu.Game.Rulesets.Osu.Objects.Drawables; using System; using System.Collections.Generic; using System.Diagnostics; using osu.Framework.Graphics; -using osu.Game.Modes.Objects.Types; -using osu.Game.Modes.Replays; +using osu.Game.Rulesets.Objects.Types; +using osu.Game.Rulesets.Replays; -namespace osu.Game.Modes.Osu +namespace osu.Game.Rulesets.Osu { public class OsuAutoReplay : Replay { diff --git a/osu.Game.Modes.Osu/OsuDifficultyCalculator.cs b/osu.Game.Rulesets.Osu/OsuDifficultyCalculator.cs similarity index 96% rename from osu.Game.Modes.Osu/OsuDifficultyCalculator.cs rename to osu.Game.Rulesets.Osu/OsuDifficultyCalculator.cs index f3ef47fe27..14b890a055 100644 --- a/osu.Game.Modes.Osu/OsuDifficultyCalculator.cs +++ b/osu.Game.Rulesets.Osu/OsuDifficultyCalculator.cs @@ -2,14 +2,14 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Beatmaps; -using osu.Game.Modes.Beatmaps; -using osu.Game.Modes.Objects.Types; -using osu.Game.Modes.Osu.Beatmaps; -using osu.Game.Modes.Osu.Objects; +using osu.Game.Rulesets.Beatmaps; +using osu.Game.Rulesets.Objects.Types; +using osu.Game.Rulesets.Osu.Beatmaps; +using osu.Game.Rulesets.Osu.Objects; using System; using System.Collections.Generic; -namespace osu.Game.Modes.Osu +namespace osu.Game.Rulesets.Osu { public class OsuDifficultyCalculator : DifficultyCalculator { diff --git a/osu.Game.Modes.Osu/OsuKeyConversionInputManager.cs b/osu.Game.Rulesets.Osu/OsuKeyConversionInputManager.cs similarity index 95% rename from osu.Game.Modes.Osu/OsuKeyConversionInputManager.cs rename to osu.Game.Rulesets.Osu/OsuKeyConversionInputManager.cs index 567c7a35b1..e71f15cd65 100644 --- a/osu.Game.Modes.Osu/OsuKeyConversionInputManager.cs +++ b/osu.Game.Rulesets.Osu/OsuKeyConversionInputManager.cs @@ -11,7 +11,7 @@ using OpenTK.Input; using KeyboardState = osu.Framework.Input.KeyboardState; using MouseState = osu.Framework.Input.MouseState; -namespace osu.Game.Modes.Osu +namespace osu.Game.Rulesets.Osu { public class OsuKeyConversionInputManager : KeyConversionInputManager { diff --git a/osu.Game.Modes.Osu/OsuRuleset.cs b/osu.Game.Rulesets.Osu/OsuRuleset.cs similarity index 90% rename from osu.Game.Modes.Osu/OsuRuleset.cs rename to osu.Game.Rulesets.Osu/OsuRuleset.cs index 4de890ac5f..39e911651a 100644 --- a/osu.Game.Modes.Osu/OsuRuleset.cs +++ b/osu.Game.Rulesets.Osu/OsuRuleset.cs @@ -4,18 +4,18 @@ using OpenTK.Input; using osu.Game.Beatmaps; using osu.Game.Graphics; -using osu.Game.Modes.Mods; -using osu.Game.Modes.Osu.Mods; -using osu.Game.Modes.Osu.Objects; -using osu.Game.Modes.Osu.UI; -using osu.Game.Modes.UI; +using osu.Game.Rulesets.Mods; +using osu.Game.Rulesets.Osu.Mods; +using osu.Game.Rulesets.Osu.Objects; +using osu.Game.Rulesets.Osu.UI; +using osu.Game.Rulesets.UI; using osu.Game.Screens.Play; using System.Collections.Generic; using System.Linq; -using osu.Game.Modes.Osu.Scoring; -using osu.Game.Modes.Scoring; +using osu.Game.Rulesets.Osu.Scoring; +using osu.Game.Rulesets.Scoring; -namespace osu.Game.Modes.Osu +namespace osu.Game.Rulesets.Osu { public class OsuRuleset : Ruleset { diff --git a/osu.Game.Modes.Osu/Properties/AssemblyInfo.cs b/osu.Game.Rulesets.Osu/Properties/AssemblyInfo.cs similarity index 100% rename from osu.Game.Modes.Osu/Properties/AssemblyInfo.cs rename to osu.Game.Rulesets.Osu/Properties/AssemblyInfo.cs diff --git a/osu.Game.Modes.Osu/Scoring/OsuScore.cs b/osu.Game.Rulesets.Osu/Scoring/OsuScore.cs similarity index 71% rename from osu.Game.Modes.Osu/Scoring/OsuScore.cs rename to osu.Game.Rulesets.Osu/Scoring/OsuScore.cs index a0a639a59e..c73cfe3338 100644 --- a/osu.Game.Modes.Osu/Scoring/OsuScore.cs +++ b/osu.Game.Rulesets.Osu/Scoring/OsuScore.cs @@ -1,9 +1,9 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Game.Modes.Scoring; +using osu.Game.Rulesets.Scoring; -namespace osu.Game.Modes.Osu.Scoring +namespace osu.Game.Rulesets.Osu.Scoring { internal class OsuScore : Score { diff --git a/osu.Game.Modes.Osu/Scoring/OsuScoreProcessor.cs b/osu.Game.Rulesets.Osu/Scoring/OsuScoreProcessor.cs similarity index 83% rename from osu.Game.Modes.Osu/Scoring/OsuScoreProcessor.cs rename to osu.Game.Rulesets.Osu/Scoring/OsuScoreProcessor.cs index 3b798a2fad..0c38f66abe 100644 --- a/osu.Game.Modes.Osu/Scoring/OsuScoreProcessor.cs +++ b/osu.Game.Rulesets.Osu/Scoring/OsuScoreProcessor.cs @@ -1,13 +1,13 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Game.Modes.Objects.Drawables; -using osu.Game.Modes.Osu.Judgements; -using osu.Game.Modes.Osu.Objects; -using osu.Game.Modes.Scoring; -using osu.Game.Modes.UI; +using osu.Game.Rulesets.Objects.Drawables; +using osu.Game.Rulesets.Osu.Judgements; +using osu.Game.Rulesets.Osu.Objects; +using osu.Game.Rulesets.Scoring; +using osu.Game.Rulesets.UI; -namespace osu.Game.Modes.Osu.Scoring +namespace osu.Game.Rulesets.Osu.Scoring { internal class OsuScoreProcessor : ScoreProcessor { diff --git a/osu.Game.Modes.Osu/UI/OsuHitRenderer.cs b/osu.Game.Rulesets.Osu/UI/OsuHitRenderer.cs similarity index 78% rename from osu.Game.Modes.Osu/UI/OsuHitRenderer.cs rename to osu.Game.Rulesets.Osu/UI/OsuHitRenderer.cs index a514ba6358..687518e6d5 100644 --- a/osu.Game.Modes.Osu/UI/OsuHitRenderer.cs +++ b/osu.Game.Rulesets.Osu/UI/OsuHitRenderer.cs @@ -3,18 +3,18 @@ using OpenTK; using osu.Game.Beatmaps; -using osu.Game.Modes.Beatmaps; -using osu.Game.Modes.Objects.Drawables; -using osu.Game.Modes.Osu.Beatmaps; -using osu.Game.Modes.Osu.Judgements; -using osu.Game.Modes.Osu.Objects; -using osu.Game.Modes.Osu.Objects.Drawables; -using osu.Game.Modes.Osu.Scoring; -using osu.Game.Modes.Scoring; -using osu.Game.Modes.UI; +using osu.Game.Rulesets.Beatmaps; +using osu.Game.Rulesets.Objects.Drawables; +using osu.Game.Rulesets.Osu.Beatmaps; +using osu.Game.Rulesets.Osu.Judgements; +using osu.Game.Rulesets.Osu.Objects; +using osu.Game.Rulesets.Osu.Objects.Drawables; +using osu.Game.Rulesets.Osu.Scoring; +using osu.Game.Rulesets.Scoring; +using osu.Game.Rulesets.UI; using osu.Game.Screens.Play; -namespace osu.Game.Modes.Osu.UI +namespace osu.Game.Rulesets.Osu.UI { public class OsuHitRenderer : HitRenderer { diff --git a/osu.Game.Modes.Osu/UI/OsuPlayfield.cs b/osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs similarity index 88% rename from osu.Game.Modes.Osu/UI/OsuPlayfield.cs rename to osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs index 47e2c1ed16..53eedea073 100644 --- a/osu.Game.Modes.Osu/UI/OsuPlayfield.cs +++ b/osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs @@ -4,16 +4,16 @@ using OpenTK; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Game.Modes.Objects.Drawables; -using osu.Game.Modes.Osu.Objects; -using osu.Game.Modes.Osu.Objects.Drawables; -using osu.Game.Modes.Osu.Objects.Drawables.Connections; -using osu.Game.Modes.UI; +using osu.Game.Rulesets.Objects.Drawables; +using osu.Game.Rulesets.Osu.Objects; +using osu.Game.Rulesets.Osu.Objects.Drawables; +using osu.Game.Rulesets.Osu.Objects.Drawables.Connections; +using osu.Game.Rulesets.UI; using System.Linq; using osu.Game.Graphics.Cursor; -using osu.Game.Modes.Osu.Judgements; +using osu.Game.Rulesets.Osu.Judgements; -namespace osu.Game.Modes.Osu.UI +namespace osu.Game.Rulesets.Osu.UI { public class OsuPlayfield : Playfield { diff --git a/osu.Game.Modes.Osu/osu.Game.Modes.Osu.csproj b/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj similarity index 95% rename from osu.Game.Modes.Osu/osu.Game.Modes.Osu.csproj rename to osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj index c98f554ba5..272a35c286 100644 --- a/osu.Game.Modes.Osu/osu.Game.Modes.Osu.csproj +++ b/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj @@ -7,8 +7,8 @@ {C92A607B-1FDD-4954-9F92-03FF547D9080} Library Properties - osu.Game.Modes.Osu - osu.Game.Modes.Osu + osu.Game.Rulesets.Osu + osu.Game.Rulesets.Osu v4.5 512 diff --git a/osu.Game.Modes.Osu/packages.config b/osu.Game.Rulesets.Osu/packages.config similarity index 100% rename from osu.Game.Modes.Osu/packages.config rename to osu.Game.Rulesets.Osu/packages.config diff --git a/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapConverter.cs b/osu.Game.Rulesets.Taiko/Beatmaps/TaikoBeatmapConverter.cs similarity index 95% rename from osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapConverter.cs rename to osu.Game.Rulesets.Taiko/Beatmaps/TaikoBeatmapConverter.cs index d26cc8ab0b..0b487bfc19 100644 --- a/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapConverter.cs +++ b/osu.Game.Rulesets.Taiko/Beatmaps/TaikoBeatmapConverter.cs @@ -2,18 +2,18 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Beatmaps; -using osu.Game.Modes.Objects; -using osu.Game.Modes.Objects.Types; -using osu.Game.Modes.Taiko.Objects; +using osu.Game.Rulesets.Objects; +using osu.Game.Rulesets.Objects.Types; +using osu.Game.Rulesets.Taiko.Objects; using System; using System.Collections.Generic; using System.Linq; using osu.Game.Database; using osu.Game.IO.Serialization; using osu.Game.Audio; -using osu.Game.Modes.Beatmaps; +using osu.Game.Rulesets.Beatmaps; -namespace osu.Game.Modes.Taiko.Beatmaps +namespace osu.Game.Rulesets.Taiko.Beatmaps { internal class TaikoBeatmapConverter : BeatmapConverter { diff --git a/osu.Game.Modes.Taiko/Judgements/TaikoDrumRollTickJudgement.cs b/osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollTickJudgement.cs similarity index 92% rename from osu.Game.Modes.Taiko/Judgements/TaikoDrumRollTickJudgement.cs rename to osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollTickJudgement.cs index 6ae476b265..78a5b29d36 100644 --- a/osu.Game.Modes.Taiko/Judgements/TaikoDrumRollTickJudgement.cs +++ b/osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollTickJudgement.cs @@ -1,7 +1,7 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -namespace osu.Game.Modes.Taiko.Judgements +namespace osu.Game.Rulesets.Taiko.Judgements { public class TaikoDrumRollTickJudgement : TaikoJudgement { diff --git a/osu.Game.Modes.Taiko/Judgements/TaikoHitResult.cs b/osu.Game.Rulesets.Taiko/Judgements/TaikoHitResult.cs similarity index 84% rename from osu.Game.Modes.Taiko/Judgements/TaikoHitResult.cs rename to osu.Game.Rulesets.Taiko/Judgements/TaikoHitResult.cs index cbc3919c4f..5fd850d6b0 100644 --- a/osu.Game.Modes.Taiko/Judgements/TaikoHitResult.cs +++ b/osu.Game.Rulesets.Taiko/Judgements/TaikoHitResult.cs @@ -3,7 +3,7 @@ using System.ComponentModel; -namespace osu.Game.Modes.Taiko.Judgements +namespace osu.Game.Rulesets.Taiko.Judgements { public enum TaikoHitResult { diff --git a/osu.Game.Modes.Taiko/Judgements/TaikoJudgement.cs b/osu.Game.Rulesets.Taiko/Judgements/TaikoJudgement.cs similarity index 93% rename from osu.Game.Modes.Taiko/Judgements/TaikoJudgement.cs rename to osu.Game.Rulesets.Taiko/Judgements/TaikoJudgement.cs index 7676ef8c29..7bca59bf11 100644 --- a/osu.Game.Modes.Taiko/Judgements/TaikoJudgement.cs +++ b/osu.Game.Rulesets.Taiko/Judgements/TaikoJudgement.cs @@ -1,11 +1,11 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Game.Modes.Judgements; +using osu.Game.Rulesets.Judgements; using osu.Framework.Extensions; -using osu.Game.Modes.Objects.Drawables; +using osu.Game.Rulesets.Objects.Drawables; -namespace osu.Game.Modes.Taiko.Judgements +namespace osu.Game.Rulesets.Taiko.Judgements { public class TaikoJudgement : Judgement { diff --git a/osu.Game.Modes.Taiko/Judgements/TaikoStrongHitJudgement.cs b/osu.Game.Rulesets.Taiko/Judgements/TaikoStrongHitJudgement.cs similarity index 84% rename from osu.Game.Modes.Taiko/Judgements/TaikoStrongHitJudgement.cs rename to osu.Game.Rulesets.Taiko/Judgements/TaikoStrongHitJudgement.cs index ee978d0026..4996cac39e 100644 --- a/osu.Game.Modes.Taiko/Judgements/TaikoStrongHitJudgement.cs +++ b/osu.Game.Rulesets.Taiko/Judgements/TaikoStrongHitJudgement.cs @@ -1,9 +1,9 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Game.Modes.Judgements; +using osu.Game.Rulesets.Judgements; -namespace osu.Game.Modes.Taiko.Judgements +namespace osu.Game.Rulesets.Taiko.Judgements { public class TaikoStrongHitJudgement : TaikoJudgement, IPartialJudgement { diff --git a/osu.Game.Modes.Taiko/Mods/TaikoMod.cs b/osu.Game.Rulesets.Taiko/Mods/TaikoMod.cs similarity index 87% rename from osu.Game.Modes.Taiko/Mods/TaikoMod.cs rename to osu.Game.Rulesets.Taiko/Mods/TaikoMod.cs index 422f0ec250..0b8492ef8c 100644 --- a/osu.Game.Modes.Taiko/Mods/TaikoMod.cs +++ b/osu.Game.Rulesets.Taiko/Mods/TaikoMod.cs @@ -2,13 +2,13 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Beatmaps; -using osu.Game.Modes.Mods; -using osu.Game.Modes.Scoring; -using osu.Game.Modes.Taiko.Objects; -using osu.Game.Modes.Taiko.Replays; +using osu.Game.Rulesets.Mods; +using osu.Game.Rulesets.Scoring; +using osu.Game.Rulesets.Taiko.Objects; +using osu.Game.Rulesets.Taiko.Replays; using osu.Game.Users; -namespace osu.Game.Modes.Taiko.Mods +namespace osu.Game.Rulesets.Taiko.Mods { public class TaikoModNoFail : ModNoFail { diff --git a/osu.Game.Modes.Taiko/Objects/BarLine.cs b/osu.Game.Rulesets.Taiko/Objects/BarLine.cs similarity index 80% rename from osu.Game.Modes.Taiko/Objects/BarLine.cs rename to osu.Game.Rulesets.Taiko/Objects/BarLine.cs index ae3c03de5e..0e6ff9f758 100644 --- a/osu.Game.Modes.Taiko/Objects/BarLine.cs +++ b/osu.Game.Rulesets.Taiko/Objects/BarLine.cs @@ -1,7 +1,7 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -namespace osu.Game.Modes.Taiko.Objects +namespace osu.Game.Rulesets.Taiko.Objects { public class BarLine : TaikoHitObject { diff --git a/osu.Game.Modes.Taiko/Objects/CentreHit.cs b/osu.Game.Rulesets.Taiko/Objects/CentreHit.cs similarity index 79% rename from osu.Game.Modes.Taiko/Objects/CentreHit.cs rename to osu.Game.Rulesets.Taiko/Objects/CentreHit.cs index 258112f045..f82058fe01 100644 --- a/osu.Game.Modes.Taiko/Objects/CentreHit.cs +++ b/osu.Game.Rulesets.Taiko/Objects/CentreHit.cs @@ -1,7 +1,7 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -namespace osu.Game.Modes.Taiko.Objects +namespace osu.Game.Rulesets.Taiko.Objects { public class CentreHit : Hit { diff --git a/osu.Game.Modes.Taiko/Objects/Drawables/DrawableBarLine.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableBarLine.cs similarity index 94% rename from osu.Game.Modes.Taiko/Objects/Drawables/DrawableBarLine.cs rename to osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableBarLine.cs index 59f8aca867..4c83e08bab 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawables/DrawableBarLine.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableBarLine.cs @@ -6,7 +6,7 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; using OpenTK; -namespace osu.Game.Modes.Taiko.Objects.Drawables +namespace osu.Game.Rulesets.Taiko.Objects.Drawables { /// /// A line that scrolls alongside hit objects in the playfield and visualises control points. diff --git a/osu.Game.Modes.Taiko/Objects/Drawables/DrawableBarLineMajor.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableBarLineMajor.cs similarity index 94% rename from osu.Game.Modes.Taiko/Objects/Drawables/DrawableBarLineMajor.cs rename to osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableBarLineMajor.cs index 73565e6948..e64682a1e4 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawables/DrawableBarLineMajor.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableBarLineMajor.cs @@ -6,7 +6,7 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; using OpenTK; -namespace osu.Game.Modes.Taiko.Objects.Drawables +namespace osu.Game.Rulesets.Taiko.Objects.Drawables { public class DrawableBarLineMajor : DrawableBarLine { diff --git a/osu.Game.Modes.Taiko/Objects/Drawables/DrawableCentreHit.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableCentreHit.cs similarity index 83% rename from osu.Game.Modes.Taiko/Objects/Drawables/DrawableCentreHit.cs rename to osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableCentreHit.cs index ff5ac859b4..8bb78669ca 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawables/DrawableCentreHit.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableCentreHit.cs @@ -3,10 +3,10 @@ using osu.Framework.Allocation; using osu.Game.Graphics; -using osu.Game.Modes.Taiko.Objects.Drawables.Pieces; +using osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces; using OpenTK.Input; -namespace osu.Game.Modes.Taiko.Objects.Drawables +namespace osu.Game.Rulesets.Taiko.Objects.Drawables { public class DrawableCentreHit : DrawableHit { diff --git a/osu.Game.Modes.Taiko/Objects/Drawables/DrawableCentreHitStrong.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableCentreHitStrong.cs similarity index 83% rename from osu.Game.Modes.Taiko/Objects/Drawables/DrawableCentreHitStrong.cs rename to osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableCentreHitStrong.cs index bc24e2aa65..434fb9377f 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawables/DrawableCentreHitStrong.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableCentreHitStrong.cs @@ -3,10 +3,10 @@ using osu.Framework.Allocation; using osu.Game.Graphics; -using osu.Game.Modes.Taiko.Objects.Drawables.Pieces; +using osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces; using OpenTK.Input; -namespace osu.Game.Modes.Taiko.Objects.Drawables +namespace osu.Game.Rulesets.Taiko.Objects.Drawables { public class DrawableCentreHitStrong : DrawableHitStrong { diff --git a/osu.Game.Modes.Taiko/Objects/Drawables/DrawableDrumRoll.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRoll.cs similarity index 92% rename from osu.Game.Modes.Taiko/Objects/Drawables/DrawableDrumRoll.cs rename to osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRoll.cs index 0a0098dd34..4562501ed1 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawables/DrawableDrumRoll.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRoll.cs @@ -5,13 +5,13 @@ using System.Linq; using osu.Framework.Allocation; using osu.Framework.MathUtils; using osu.Game.Graphics; -using osu.Game.Modes.Objects.Drawables; -using osu.Game.Modes.Taiko.Judgements; +using osu.Game.Rulesets.Objects.Drawables; +using osu.Game.Rulesets.Taiko.Judgements; using OpenTK; using OpenTK.Graphics; -using osu.Game.Modes.Taiko.Objects.Drawables.Pieces; +using osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces; -namespace osu.Game.Modes.Taiko.Objects.Drawables +namespace osu.Game.Rulesets.Taiko.Objects.Drawables { public class DrawableDrumRoll : DrawableTaikoHitObject { diff --git a/osu.Game.Modes.Taiko/Objects/Drawables/DrawableDrumRollTick.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRollTick.cs similarity index 87% rename from osu.Game.Modes.Taiko/Objects/Drawables/DrawableDrumRollTick.cs rename to osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRollTick.cs index 296affedaf..ad4fd30a53 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawables/DrawableDrumRollTick.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRollTick.cs @@ -3,12 +3,12 @@ using System; using osu.Framework.Graphics; -using osu.Game.Modes.Objects.Drawables; -using osu.Game.Modes.Taiko.Judgements; +using osu.Game.Rulesets.Objects.Drawables; +using osu.Game.Rulesets.Taiko.Judgements; using OpenTK.Input; -using osu.Game.Modes.Taiko.Objects.Drawables.Pieces; +using osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces; -namespace osu.Game.Modes.Taiko.Objects.Drawables +namespace osu.Game.Rulesets.Taiko.Objects.Drawables { public class DrawableDrumRollTick : DrawableTaikoHitObject { diff --git a/osu.Game.Modes.Taiko/Objects/Drawables/DrawableHit.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs similarity index 91% rename from osu.Game.Modes.Taiko/Objects/Drawables/DrawableHit.cs rename to osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs index 167fbebd7b..a4a46e3b48 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawables/DrawableHit.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs @@ -4,12 +4,12 @@ using System; using System.Linq; using osu.Framework.Graphics; -using osu.Game.Modes.Objects.Drawables; -using osu.Game.Modes.Taiko.Judgements; -using osu.Game.Modes.Taiko.Objects.Drawables.Pieces; +using osu.Game.Rulesets.Objects.Drawables; +using osu.Game.Rulesets.Taiko.Judgements; +using osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces; using OpenTK.Input; -namespace osu.Game.Modes.Taiko.Objects.Drawables +namespace osu.Game.Rulesets.Taiko.Objects.Drawables { public abstract class DrawableHit : DrawableTaikoHitObject { diff --git a/osu.Game.Modes.Taiko/Objects/Drawables/DrawableHitStrong.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHitStrong.cs similarity index 90% rename from osu.Game.Modes.Taiko/Objects/Drawables/DrawableHitStrong.cs rename to osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHitStrong.cs index 4ab029acb3..1c6b12ea43 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawables/DrawableHitStrong.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHitStrong.cs @@ -4,12 +4,12 @@ using System; using System.Linq; using osu.Framework.Input; -using osu.Game.Modes.Objects.Drawables; -using osu.Game.Modes.Taiko.Judgements; +using osu.Game.Rulesets.Objects.Drawables; +using osu.Game.Rulesets.Taiko.Judgements; using OpenTK.Input; -using osu.Game.Modes.Taiko.Objects.Drawables.Pieces; +using osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces; -namespace osu.Game.Modes.Taiko.Objects.Drawables +namespace osu.Game.Rulesets.Taiko.Objects.Drawables { public abstract class DrawableHitStrong : DrawableHit { diff --git a/osu.Game.Modes.Taiko/Objects/Drawables/DrawableRimHit.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableRimHit.cs similarity index 83% rename from osu.Game.Modes.Taiko/Objects/Drawables/DrawableRimHit.cs rename to osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableRimHit.cs index 5a311d51ef..20e8d36105 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawables/DrawableRimHit.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableRimHit.cs @@ -3,10 +3,10 @@ using osu.Framework.Allocation; using osu.Game.Graphics; -using osu.Game.Modes.Taiko.Objects.Drawables.Pieces; +using osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces; using OpenTK.Input; -namespace osu.Game.Modes.Taiko.Objects.Drawables +namespace osu.Game.Rulesets.Taiko.Objects.Drawables { public class DrawableRimHit : DrawableHit { diff --git a/osu.Game.Modes.Taiko/Objects/Drawables/DrawableRimHitStrong.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableRimHitStrong.cs similarity index 83% rename from osu.Game.Modes.Taiko/Objects/Drawables/DrawableRimHitStrong.cs rename to osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableRimHitStrong.cs index 5789dfb140..4b1bb62bab 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawables/DrawableRimHitStrong.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableRimHitStrong.cs @@ -3,10 +3,10 @@ using osu.Framework.Allocation; using osu.Game.Graphics; -using osu.Game.Modes.Taiko.Objects.Drawables.Pieces; +using osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces; using OpenTK.Input; -namespace osu.Game.Modes.Taiko.Objects.Drawables +namespace osu.Game.Rulesets.Taiko.Objects.Drawables { public class DrawableRimHitStrong : DrawableHitStrong { diff --git a/osu.Game.Modes.Taiko/Objects/Drawables/DrawableSwell.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwell.cs similarity index 95% rename from osu.Game.Modes.Taiko/Objects/Drawables/DrawableSwell.cs rename to osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwell.cs index 1e440df69a..57b2576a8b 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawables/DrawableSwell.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwell.cs @@ -9,14 +9,14 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; using osu.Game.Graphics; -using osu.Game.Modes.Objects.Drawables; -using osu.Game.Modes.Taiko.Judgements; -using osu.Game.Modes.Taiko.Objects.Drawables.Pieces; +using osu.Game.Rulesets.Objects.Drawables; +using osu.Game.Rulesets.Taiko.Judgements; +using osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces; using OpenTK; using OpenTK.Graphics; using OpenTK.Input; -namespace osu.Game.Modes.Taiko.Objects.Drawables +namespace osu.Game.Rulesets.Taiko.Objects.Drawables { public class DrawableSwell : DrawableTaikoHitObject { diff --git a/osu.Game.Modes.Taiko/Objects/Drawables/DrawableTaikoHitObject.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableTaikoHitObject.cs similarity index 91% rename from osu.Game.Modes.Taiko/Objects/Drawables/DrawableTaikoHitObject.cs rename to osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableTaikoHitObject.cs index f15f2bd152..24aa366944 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawables/DrawableTaikoHitObject.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableTaikoHitObject.cs @@ -5,13 +5,13 @@ using System.Collections.Generic; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Input; -using osu.Game.Modes.Objects.Drawables; -using osu.Game.Modes.Taiko.Judgements; -using osu.Game.Modes.Taiko.Objects.Drawables.Pieces; +using osu.Game.Rulesets.Objects.Drawables; +using osu.Game.Rulesets.Taiko.Judgements; +using osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces; using OpenTK; using OpenTK.Input; -namespace osu.Game.Modes.Taiko.Objects.Drawables +namespace osu.Game.Rulesets.Taiko.Objects.Drawables { public abstract class DrawableTaikoHitObject : DrawableHitObject where TaikoHitType : TaikoHitObject diff --git a/osu.Game.Modes.Taiko/Objects/Drawables/Pieces/CentreHitSymbolPiece.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/CentreHitSymbolPiece.cs similarity index 90% rename from osu.Game.Modes.Taiko/Objects/Drawables/Pieces/CentreHitSymbolPiece.cs rename to osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/CentreHitSymbolPiece.cs index 0cf4e97b41..ddf1492ecc 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawables/Pieces/CentreHitSymbolPiece.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/CentreHitSymbolPiece.cs @@ -6,7 +6,7 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; using OpenTK; -namespace osu.Game.Modes.Taiko.Objects.Drawables.Pieces +namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces { /// /// The symbol used for centre hit pieces. diff --git a/osu.Game.Modes.Taiko/Objects/Drawables/Pieces/CirclePiece.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/CirclePiece.cs similarity index 95% rename from osu.Game.Modes.Taiko/Objects/Drawables/Pieces/CirclePiece.cs rename to osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/CirclePiece.cs index 216e05ebc4..9f91488fe3 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawables/Pieces/CirclePiece.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/CirclePiece.cs @@ -8,7 +8,7 @@ using osu.Framework.Graphics.Sprites; using osu.Game.Graphics.Backgrounds; using OpenTK.Graphics; -namespace osu.Game.Modes.Taiko.Objects.Drawables.Pieces +namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces { /// /// A circle piece which is used uniformly through osu!taiko to visualise hitobjects. diff --git a/osu.Game.Modes.Taiko/Objects/Drawables/Pieces/ElongatedCirclePiece.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/ElongatedCirclePiece.cs similarity index 89% rename from osu.Game.Modes.Taiko/Objects/Drawables/Pieces/ElongatedCirclePiece.cs rename to osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/ElongatedCirclePiece.cs index 5431507614..1af3705694 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawables/Pieces/ElongatedCirclePiece.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/ElongatedCirclePiece.cs @@ -3,9 +3,9 @@ using System; using osu.Framework.Graphics.Primitives; -using osu.Game.Modes.Taiko.UI; +using osu.Game.Rulesets.Taiko.UI; -namespace osu.Game.Modes.Taiko.Objects.Drawables.Pieces +namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces { public class ElongatedCirclePiece : CirclePiece { diff --git a/osu.Game.Modes.Taiko/Objects/Drawables/Pieces/RimHitSymbolPiece.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/RimHitSymbolPiece.cs similarity index 91% rename from osu.Game.Modes.Taiko/Objects/Drawables/Pieces/RimHitSymbolPiece.cs rename to osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/RimHitSymbolPiece.cs index 6e19497978..4146edbdf7 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawables/Pieces/RimHitSymbolPiece.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/RimHitSymbolPiece.cs @@ -7,7 +7,7 @@ using osu.Framework.Graphics.Sprites; using OpenTK; using OpenTK.Graphics; -namespace osu.Game.Modes.Taiko.Objects.Drawables.Pieces +namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces { /// /// The symbol used for rim hit pieces. diff --git a/osu.Game.Modes.Taiko/Objects/Drawables/Pieces/SwellSymbolPiece.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/SwellSymbolPiece.cs similarity index 88% rename from osu.Game.Modes.Taiko/Objects/Drawables/Pieces/SwellSymbolPiece.cs rename to osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/SwellSymbolPiece.cs index e491793902..0f703837a9 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawables/Pieces/SwellSymbolPiece.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/SwellSymbolPiece.cs @@ -4,7 +4,7 @@ using osu.Framework.Graphics; using osu.Game.Graphics; -namespace osu.Game.Modes.Taiko.Objects.Drawables.Pieces +namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces { /// /// The symbol used for swell pieces. diff --git a/osu.Game.Modes.Taiko/Objects/Drawables/Pieces/TaikoPiece.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/TaikoPiece.cs similarity index 91% rename from osu.Game.Modes.Taiko/Objects/Drawables/Pieces/TaikoPiece.cs rename to osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/TaikoPiece.cs index 2220438a4a..83b2e59e44 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawables/Pieces/TaikoPiece.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/TaikoPiece.cs @@ -6,7 +6,7 @@ using osu.Game.Graphics; using OpenTK; using OpenTK.Graphics; -namespace osu.Game.Modes.Taiko.Objects.Drawables.Pieces +namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces { public class TaikoPiece : Container, IHasAccentColour { diff --git a/osu.Game.Modes.Taiko/Objects/Drawables/Pieces/TickPiece.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/TickPiece.cs similarity index 93% rename from osu.Game.Modes.Taiko/Objects/Drawables/Pieces/TickPiece.cs rename to osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/TickPiece.cs index 53e795e2e2..c3bc52796c 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawables/Pieces/TickPiece.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/TickPiece.cs @@ -7,7 +7,7 @@ using osu.Framework.Graphics.Sprites; using OpenTK; using OpenTK.Graphics; -namespace osu.Game.Modes.Taiko.Objects.Drawables.Pieces +namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces { public class TickPiece : TaikoPiece { diff --git a/osu.Game.Modes.Taiko/Objects/DrumRoll.cs b/osu.Game.Rulesets.Taiko/Objects/DrumRoll.cs similarity index 94% rename from osu.Game.Modes.Taiko/Objects/DrumRoll.cs rename to osu.Game.Rulesets.Taiko/Objects/DrumRoll.cs index 4f26ffd3a1..4f89fb8248 100644 --- a/osu.Game.Modes.Taiko/Objects/DrumRoll.cs +++ b/osu.Game.Rulesets.Taiko/Objects/DrumRoll.cs @@ -1,7 +1,7 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Game.Modes.Objects.Types; +using osu.Game.Rulesets.Objects.Types; using System; using System.Collections.Generic; using System.Linq; @@ -9,7 +9,7 @@ using osu.Game.Beatmaps.Timing; using osu.Game.Database; using osu.Game.Audio; -namespace osu.Game.Modes.Taiko.Objects +namespace osu.Game.Rulesets.Taiko.Objects { public class DrumRoll : TaikoHitObject, IHasEndTime { diff --git a/osu.Game.Modes.Taiko/Objects/DrumRollTick.cs b/osu.Game.Rulesets.Taiko/Objects/DrumRollTick.cs similarity index 91% rename from osu.Game.Modes.Taiko/Objects/DrumRollTick.cs rename to osu.Game.Rulesets.Taiko/Objects/DrumRollTick.cs index 32e8851b66..01f9caf215 100644 --- a/osu.Game.Modes.Taiko/Objects/DrumRollTick.cs +++ b/osu.Game.Rulesets.Taiko/Objects/DrumRollTick.cs @@ -1,7 +1,7 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -namespace osu.Game.Modes.Taiko.Objects +namespace osu.Game.Rulesets.Taiko.Objects { public class DrumRollTick : TaikoHitObject { diff --git a/osu.Game.Modes.Taiko/Objects/Hit.cs b/osu.Game.Rulesets.Taiko/Objects/Hit.cs similarity index 93% rename from osu.Game.Modes.Taiko/Objects/Hit.cs rename to osu.Game.Rulesets.Taiko/Objects/Hit.cs index ad8d07d901..136e89124c 100644 --- a/osu.Game.Modes.Taiko/Objects/Hit.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Hit.cs @@ -4,7 +4,7 @@ using osu.Game.Beatmaps.Timing; using osu.Game.Database; -namespace osu.Game.Modes.Taiko.Objects +namespace osu.Game.Rulesets.Taiko.Objects { public class Hit : TaikoHitObject { diff --git a/osu.Game.Modes.Taiko/Objects/RimHit.cs b/osu.Game.Rulesets.Taiko/Objects/RimHit.cs similarity index 79% rename from osu.Game.Modes.Taiko/Objects/RimHit.cs rename to osu.Game.Rulesets.Taiko/Objects/RimHit.cs index aae93ec10d..8e09842294 100644 --- a/osu.Game.Modes.Taiko/Objects/RimHit.cs +++ b/osu.Game.Rulesets.Taiko/Objects/RimHit.cs @@ -1,7 +1,7 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -namespace osu.Game.Modes.Taiko.Objects +namespace osu.Game.Rulesets.Taiko.Objects { public class RimHit : Hit { diff --git a/osu.Game.Modes.Taiko/Objects/Swell.cs b/osu.Game.Rulesets.Taiko/Objects/Swell.cs similarity index 82% rename from osu.Game.Modes.Taiko/Objects/Swell.cs rename to osu.Game.Rulesets.Taiko/Objects/Swell.cs index 97101ea797..f74a543ca9 100644 --- a/osu.Game.Modes.Taiko/Objects/Swell.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Swell.cs @@ -1,9 +1,9 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Game.Modes.Objects.Types; +using osu.Game.Rulesets.Objects.Types; -namespace osu.Game.Modes.Taiko.Objects +namespace osu.Game.Rulesets.Taiko.Objects { public class Swell : TaikoHitObject, IHasEndTime { diff --git a/osu.Game.Modes.Taiko/Objects/TaikoHitObject.cs b/osu.Game.Rulesets.Taiko/Objects/TaikoHitObject.cs similarity index 93% rename from osu.Game.Modes.Taiko/Objects/TaikoHitObject.cs rename to osu.Game.Rulesets.Taiko/Objects/TaikoHitObject.cs index ebc9b19d3a..6a6353fde2 100644 --- a/osu.Game.Modes.Taiko/Objects/TaikoHitObject.cs +++ b/osu.Game.Rulesets.Taiko/Objects/TaikoHitObject.cs @@ -3,10 +3,10 @@ using osu.Game.Beatmaps.Timing; using osu.Game.Database; -using osu.Game.Modes.Objects; -using osu.Game.Modes.Taiko.UI; +using osu.Game.Rulesets.Objects; +using osu.Game.Rulesets.Taiko.UI; -namespace osu.Game.Modes.Taiko.Objects +namespace osu.Game.Rulesets.Taiko.Objects { public abstract class TaikoHitObject : HitObject { diff --git a/osu.Game.Modes.Taiko/OpenTK.dll.config b/osu.Game.Rulesets.Taiko/OpenTK.dll.config similarity index 100% rename from osu.Game.Modes.Taiko/OpenTK.dll.config rename to osu.Game.Rulesets.Taiko/OpenTK.dll.config diff --git a/osu.Game.Modes.Taiko/Properties/AssemblyInfo.cs b/osu.Game.Rulesets.Taiko/Properties/AssemblyInfo.cs similarity index 90% rename from osu.Game.Modes.Taiko/Properties/AssemblyInfo.cs rename to osu.Game.Rulesets.Taiko/Properties/AssemblyInfo.cs index 94ec895707..89c07517ca 100644 --- a/osu.Game.Modes.Taiko/Properties/AssemblyInfo.cs +++ b/osu.Game.Rulesets.Taiko/Properties/AssemblyInfo.cs @@ -7,11 +7,11 @@ using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly: AssemblyTitle("osu.Game.Modes.Taiko")] +[assembly: AssemblyTitle("osu.Game.Rulesets.Taiko")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("osu.Game.Modes.Taiko")] +[assembly: AssemblyProduct("osu.Game.Rulesets.Taiko")] [assembly: AssemblyCopyright("Copyright © 2016")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/osu.Game.Modes.Taiko/Replays/TaikoAutoReplay.cs b/osu.Game.Rulesets.Taiko/Replays/TaikoAutoReplay.cs similarity index 93% rename from osu.Game.Modes.Taiko/Replays/TaikoAutoReplay.cs rename to osu.Game.Rulesets.Taiko/Replays/TaikoAutoReplay.cs index 89d974baf9..b44c789be5 100644 --- a/osu.Game.Modes.Taiko/Replays/TaikoAutoReplay.cs +++ b/osu.Game.Rulesets.Taiko/Replays/TaikoAutoReplay.cs @@ -3,11 +3,11 @@ using System; using osu.Game.Beatmaps; -using osu.Game.Modes.Objects.Types; -using osu.Game.Modes.Taiko.Objects; -using osu.Game.Modes.Replays; +using osu.Game.Rulesets.Objects.Types; +using osu.Game.Rulesets.Taiko.Objects; +using osu.Game.Rulesets.Replays; -namespace osu.Game.Modes.Taiko.Replays +namespace osu.Game.Rulesets.Taiko.Replays { public class TaikoAutoReplay : Replay { diff --git a/osu.Game.Modes.Taiko/Replays/TaikoFramedReplayInputHandler.cs b/osu.Game.Rulesets.Taiko/Replays/TaikoFramedReplayInputHandler.cs similarity index 90% rename from osu.Game.Modes.Taiko/Replays/TaikoFramedReplayInputHandler.cs rename to osu.Game.Rulesets.Taiko/Replays/TaikoFramedReplayInputHandler.cs index 44fca4abe7..f6425dd66f 100644 --- a/osu.Game.Modes.Taiko/Replays/TaikoFramedReplayInputHandler.cs +++ b/osu.Game.Rulesets.Taiko/Replays/TaikoFramedReplayInputHandler.cs @@ -1,12 +1,12 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Game.Modes.Replays; +using osu.Game.Rulesets.Replays; using System.Collections.Generic; using osu.Framework.Input; using OpenTK.Input; -namespace osu.Game.Modes.Taiko.Replays +namespace osu.Game.Rulesets.Taiko.Replays { internal class TaikoFramedReplayInputHandler : FramedReplayInputHandler { diff --git a/osu.Game.Modes.Taiko/Scoring/TaikoScoreProcessor.cs b/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs similarity index 95% rename from osu.Game.Modes.Taiko/Scoring/TaikoScoreProcessor.cs rename to osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs index 987c3181a4..f5e2094cbf 100644 --- a/osu.Game.Modes.Taiko/Scoring/TaikoScoreProcessor.cs +++ b/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs @@ -4,14 +4,14 @@ using System; using osu.Game.Beatmaps; using osu.Game.Database; -using osu.Game.Modes.Objects.Drawables; -using osu.Game.Modes.Scoring; -using osu.Game.Modes.Taiko.Judgements; -using osu.Game.Modes.Taiko.Objects; -using osu.Game.Modes.UI; +using osu.Game.Rulesets.Objects.Drawables; +using osu.Game.Rulesets.Scoring; +using osu.Game.Rulesets.Taiko.Judgements; +using osu.Game.Rulesets.Taiko.Objects; +using osu.Game.Rulesets.UI; using OpenTK; -namespace osu.Game.Modes.Taiko.Scoring +namespace osu.Game.Rulesets.Taiko.Scoring { internal class TaikoScoreProcessor : ScoreProcessor { diff --git a/osu.Game.Modes.Taiko/TaikoDifficultyCalculator.cs b/osu.Game.Rulesets.Taiko/TaikoDifficultyCalculator.cs similarity index 79% rename from osu.Game.Modes.Taiko/TaikoDifficultyCalculator.cs rename to osu.Game.Rulesets.Taiko/TaikoDifficultyCalculator.cs index 453a937b9e..cd61709db8 100644 --- a/osu.Game.Modes.Taiko/TaikoDifficultyCalculator.cs +++ b/osu.Game.Rulesets.Taiko/TaikoDifficultyCalculator.cs @@ -2,12 +2,12 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Beatmaps; -using osu.Game.Modes.Beatmaps; -using osu.Game.Modes.Taiko.Beatmaps; -using osu.Game.Modes.Taiko.Objects; +using osu.Game.Rulesets.Beatmaps; +using osu.Game.Rulesets.Taiko.Beatmaps; +using osu.Game.Rulesets.Taiko.Objects; using System.Collections.Generic; -namespace osu.Game.Modes.Taiko +namespace osu.Game.Rulesets.Taiko { public class TaikoDifficultyCalculator : DifficultyCalculator { diff --git a/osu.Game.Modes.Taiko/TaikoRuleset.cs b/osu.Game.Rulesets.Taiko/TaikoRuleset.cs similarity index 90% rename from osu.Game.Modes.Taiko/TaikoRuleset.cs rename to osu.Game.Rulesets.Taiko/TaikoRuleset.cs index b93c25c55d..3fb2cf6c28 100644 --- a/osu.Game.Modes.Taiko/TaikoRuleset.cs +++ b/osu.Game.Rulesets.Taiko/TaikoRuleset.cs @@ -4,16 +4,16 @@ using OpenTK.Input; using osu.Game.Beatmaps; using osu.Game.Graphics; -using osu.Game.Modes.Mods; -using osu.Game.Modes.Taiko.Mods; -using osu.Game.Modes.Taiko.UI; -using osu.Game.Modes.UI; +using osu.Game.Rulesets.Mods; +using osu.Game.Rulesets.Taiko.Mods; +using osu.Game.Rulesets.Taiko.UI; +using osu.Game.Rulesets.UI; using osu.Game.Screens.Play; using System.Collections.Generic; -using osu.Game.Modes.Scoring; -using osu.Game.Modes.Taiko.Scoring; +using osu.Game.Rulesets.Scoring; +using osu.Game.Rulesets.Taiko.Scoring; -namespace osu.Game.Modes.Taiko +namespace osu.Game.Rulesets.Taiko { public class TaikoRuleset : Ruleset { diff --git a/osu.Game.Modes.Taiko/UI/DrawableTaikoJudgement.cs b/osu.Game.Rulesets.Taiko/UI/DrawableTaikoJudgement.cs similarity index 87% rename from osu.Game.Modes.Taiko/UI/DrawableTaikoJudgement.cs rename to osu.Game.Rulesets.Taiko/UI/DrawableTaikoJudgement.cs index 78c9657b40..08fd8dbecc 100644 --- a/osu.Game.Modes.Taiko/UI/DrawableTaikoJudgement.cs +++ b/osu.Game.Rulesets.Taiko/UI/DrawableTaikoJudgement.cs @@ -1,13 +1,13 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Game.Modes.Taiko.Judgements; -using osu.Game.Modes.Objects.Drawables; +using osu.Game.Rulesets.Taiko.Judgements; +using osu.Game.Rulesets.Objects.Drawables; using osu.Framework.Allocation; using osu.Game.Graphics; -using osu.Game.Modes.Judgements; +using osu.Game.Rulesets.Judgements; -namespace osu.Game.Modes.Taiko.UI +namespace osu.Game.Rulesets.Taiko.UI { /// /// Text that is shown as judgement when a hit object is hit or missed. diff --git a/osu.Game.Modes.Taiko/UI/HitExplosion.cs b/osu.Game.Rulesets.Taiko/UI/HitExplosion.cs similarity index 91% rename from osu.Game.Modes.Taiko/UI/HitExplosion.cs rename to osu.Game.Rulesets.Taiko/UI/HitExplosion.cs index e4e329523f..2ebdeaa5b0 100644 --- a/osu.Game.Modes.Taiko/UI/HitExplosion.cs +++ b/osu.Game.Rulesets.Taiko/UI/HitExplosion.cs @@ -8,10 +8,10 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; using osu.Game.Graphics; -using osu.Game.Modes.Taiko.Judgements; -using osu.Game.Modes.Taiko.Objects; +using osu.Game.Rulesets.Taiko.Judgements; +using osu.Game.Rulesets.Taiko.Objects; -namespace osu.Game.Modes.Taiko.UI +namespace osu.Game.Rulesets.Taiko.UI { /// /// A circle explodes from the hit target to indicate a hitobject has been hit. diff --git a/osu.Game.Modes.Taiko/UI/HitTarget.cs b/osu.Game.Rulesets.Taiko/UI/HitTarget.cs similarity index 95% rename from osu.Game.Modes.Taiko/UI/HitTarget.cs rename to osu.Game.Rulesets.Taiko/UI/HitTarget.cs index b22dc1d647..fde2623246 100644 --- a/osu.Game.Modes.Taiko/UI/HitTarget.cs +++ b/osu.Game.Rulesets.Taiko/UI/HitTarget.cs @@ -6,9 +6,9 @@ using OpenTK.Graphics; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; -using osu.Game.Modes.Taiko.Objects; +using osu.Game.Rulesets.Taiko.Objects; -namespace osu.Game.Modes.Taiko.UI +namespace osu.Game.Rulesets.Taiko.UI { /// /// A component that is displayed at the hit position in the taiko playfield. diff --git a/osu.Game.Modes.Taiko/UI/InputDrum.cs b/osu.Game.Rulesets.Taiko/UI/InputDrum.cs similarity index 96% rename from osu.Game.Modes.Taiko/UI/InputDrum.cs rename to osu.Game.Rulesets.Taiko/UI/InputDrum.cs index d238c38e74..999d76ab0b 100644 --- a/osu.Game.Modes.Taiko/UI/InputDrum.cs +++ b/osu.Game.Rulesets.Taiko/UI/InputDrum.cs @@ -12,7 +12,7 @@ using osu.Framework.Graphics.Textures; using osu.Framework.Input; using osu.Game.Graphics; -namespace osu.Game.Modes.Taiko.UI +namespace osu.Game.Rulesets.Taiko.UI { /// /// A component of the playfield that captures input and displays input as a drum. diff --git a/osu.Game.Modes.Taiko/UI/TaikoHitRenderer.cs b/osu.Game.Rulesets.Taiko/UI/TaikoHitRenderer.cs similarity index 88% rename from osu.Game.Modes.Taiko/UI/TaikoHitRenderer.cs rename to osu.Game.Rulesets.Taiko/UI/TaikoHitRenderer.cs index 48d4457a53..e42a8432fd 100644 --- a/osu.Game.Modes.Taiko/UI/TaikoHitRenderer.cs +++ b/osu.Game.Rulesets.Taiko/UI/TaikoHitRenderer.cs @@ -6,21 +6,21 @@ using osu.Framework.MathUtils; using osu.Framework.Graphics; using osu.Game.Beatmaps; using osu.Game.Beatmaps.Timing; -using osu.Game.Modes.Objects.Drawables; -using osu.Game.Modes.Objects.Types; -using osu.Game.Modes.Replays; -using osu.Game.Modes.Scoring; -using osu.Game.Modes.Taiko.Beatmaps; -using osu.Game.Modes.Taiko.Judgements; -using osu.Game.Modes.Taiko.Objects; -using osu.Game.Modes.Taiko.Objects.Drawables; -using osu.Game.Modes.Taiko.Scoring; -using osu.Game.Modes.UI; -using osu.Game.Modes.Taiko.Replays; +using osu.Game.Rulesets.Objects.Drawables; +using osu.Game.Rulesets.Objects.Types; +using osu.Game.Rulesets.Replays; +using osu.Game.Rulesets.Scoring; +using osu.Game.Rulesets.Taiko.Beatmaps; +using osu.Game.Rulesets.Taiko.Judgements; +using osu.Game.Rulesets.Taiko.Objects; +using osu.Game.Rulesets.Taiko.Objects.Drawables; +using osu.Game.Rulesets.Taiko.Scoring; +using osu.Game.Rulesets.UI; +using osu.Game.Rulesets.Taiko.Replays; using OpenTK; -using osu.Game.Modes.Beatmaps; +using osu.Game.Rulesets.Beatmaps; -namespace osu.Game.Modes.Taiko.UI +namespace osu.Game.Rulesets.Taiko.UI { public class TaikoHitRenderer : HitRenderer { diff --git a/osu.Game.Modes.Taiko/UI/TaikoPlayfield.cs b/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs similarity index 95% rename from osu.Game.Modes.Taiko/UI/TaikoPlayfield.cs rename to osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs index db3a1bc84e..8e6f1c8556 100644 --- a/osu.Game.Modes.Taiko/UI/TaikoPlayfield.cs +++ b/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs @@ -4,21 +4,21 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; -using osu.Game.Modes.Taiko.Objects; -using osu.Game.Modes.UI; +using osu.Game.Rulesets.Taiko.Objects; +using osu.Game.Rulesets.UI; using OpenTK; using OpenTK.Graphics; -using osu.Game.Modes.Taiko.Judgements; -using osu.Game.Modes.Objects.Drawables; +using osu.Game.Rulesets.Taiko.Judgements; +using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics.Primitives; using System.Linq; -using osu.Game.Modes.Taiko.Objects.Drawables; +using osu.Game.Rulesets.Taiko.Objects.Drawables; using System; -namespace osu.Game.Modes.Taiko.UI +namespace osu.Game.Rulesets.Taiko.UI { public class TaikoPlayfield : Playfield { diff --git a/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj b/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj similarity index 95% rename from osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj rename to osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj index ee7cb73431..c668b90ec4 100644 --- a/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj +++ b/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj @@ -7,8 +7,8 @@ {F167E17A-7DE6-4AF5-B920-A5112296C695} Library Properties - osu.Game.Modes.Taiko - osu.Game.Modes.Taiko + osu.Game.Rulesets.Taiko + osu.Game.Rulesets.Taiko v4.5 512 diff --git a/osu.Game.Modes.Taiko/packages.config b/osu.Game.Rulesets.Taiko/packages.config similarity index 100% rename from osu.Game.Modes.Taiko/packages.config rename to osu.Game.Rulesets.Taiko/packages.config diff --git a/osu.Game.Tests/Beatmaps/Formats/OsuLegacyDecoderTest.cs b/osu.Game.Tests/Beatmaps/Formats/OsuLegacyDecoderTest.cs index f7a62fe999..4814af984e 100644 --- a/osu.Game.Tests/Beatmaps/Formats/OsuLegacyDecoderTest.cs +++ b/osu.Game.Tests/Beatmaps/Formats/OsuLegacyDecoderTest.cs @@ -9,7 +9,7 @@ using osu.Game.Beatmaps.Formats; using osu.Game.Tests.Resources; using System.Linq; using osu.Game.Audio; -using osu.Game.Modes.Objects.Types; +using osu.Game.Rulesets.Objects.Types; namespace osu.Game.Tests.Beatmaps.Formats { diff --git a/osu.Game.Tests/osu.Game.Tests.csproj b/osu.Game.Tests/osu.Game.Tests.csproj index ddaf33c0fc..b8fcb80aaf 100644 --- a/osu.Game.Tests/osu.Game.Tests.csproj +++ b/osu.Game.Tests/osu.Game.Tests.csproj @@ -63,21 +63,21 @@ {c76bf5b3-985e-4d39-95fe-97c9c879b83a} osu.Framework - + {c92a607b-1fdd-4954-9f92-03ff547d9080} - osu.Game.Modes.Osu + osu.Game.Rulesets.Osu - + {58f6c80c-1253-4a0e-a465-b8c85ebeadf3} - osu.Game.Modes.Catch + osu.Game.Rulesets.Catch - + {48f4582b-7687-4621-9cbe-5c24197cb536} - osu.Game.Modes.Mania + osu.Game.Rulesets.Mania - + {f167e17a-7de6-4af5-b920-a5112296c695} - osu.Game.Modes.Taiko + osu.Game.Rulesets.Taiko {0D3FBF8A-7464-4CF7-8C90-3E7886DF2D4D} diff --git a/osu.Game/Beatmaps/Beatmap.cs b/osu.Game/Beatmaps/Beatmap.cs index 7ed0546747..3964fd25a7 100644 --- a/osu.Game/Beatmaps/Beatmap.cs +++ b/osu.Game/Beatmaps/Beatmap.cs @@ -4,7 +4,7 @@ using OpenTK.Graphics; using osu.Game.Beatmaps.Timing; using osu.Game.Database; -using osu.Game.Modes.Objects; +using osu.Game.Rulesets.Objects; using System.Collections.Generic; namespace osu.Game.Beatmaps diff --git a/osu.Game/Beatmaps/DifficultyCalculator.cs b/osu.Game/Beatmaps/DifficultyCalculator.cs index 911aaa7189..727c89049f 100644 --- a/osu.Game/Beatmaps/DifficultyCalculator.cs +++ b/osu.Game/Beatmaps/DifficultyCalculator.cs @@ -1,8 +1,8 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Game.Modes.Beatmaps; -using osu.Game.Modes.Objects; +using osu.Game.Rulesets.Beatmaps; +using osu.Game.Rulesets.Objects; using System.Collections.Generic; namespace osu.Game.Beatmaps diff --git a/osu.Game/Beatmaps/Formats/BeatmapDecoder.cs b/osu.Game/Beatmaps/Formats/BeatmapDecoder.cs index 452bd595c7..cc9d367a59 100644 --- a/osu.Game/Beatmaps/Formats/BeatmapDecoder.cs +++ b/osu.Game/Beatmaps/Formats/BeatmapDecoder.cs @@ -4,7 +4,7 @@ using System; using System.Collections.Generic; using System.IO; -using osu.Game.Modes.Objects; +using osu.Game.Rulesets.Objects; using osu.Game.Database; namespace osu.Game.Beatmaps.Formats diff --git a/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs b/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs index 758d2205ac..74a5be698e 100644 --- a/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs +++ b/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs @@ -8,7 +8,7 @@ using OpenTK.Graphics; using osu.Game.Beatmaps.Events; using osu.Game.Beatmaps.Timing; using osu.Game.Beatmaps.Legacy; -using osu.Game.Modes.Objects.Legacy; +using osu.Game.Rulesets.Objects.Legacy; namespace osu.Game.Beatmaps.Formats { @@ -90,16 +90,16 @@ namespace osu.Game.Beatmaps.Formats switch (beatmap.BeatmapInfo.RulesetID) { case 0: - parser = new Modes.Objects.Legacy.Osu.HitObjectParser(); + parser = new Rulesets.Objects.Legacy.Osu.HitObjectParser(); break; case 1: - parser = new Modes.Objects.Legacy.Taiko.HitObjectParser(); + parser = new Rulesets.Objects.Legacy.Taiko.HitObjectParser(); break; case 2: - parser = new Modes.Objects.Legacy.Catch.HitObjectParser(); + parser = new Rulesets.Objects.Legacy.Catch.HitObjectParser(); break; case 3: - parser = new Modes.Objects.Legacy.Mania.HitObjectParser(); + parser = new Rulesets.Objects.Legacy.Mania.HitObjectParser(); break; } break; diff --git a/osu.Game/Beatmaps/WorkingBeatmap.cs b/osu.Game/Beatmaps/WorkingBeatmap.cs index 8ffec25882..894719ac6e 100644 --- a/osu.Game/Beatmaps/WorkingBeatmap.cs +++ b/osu.Game/Beatmaps/WorkingBeatmap.cs @@ -5,7 +5,7 @@ using osu.Framework.Audio.Track; using osu.Framework.Configuration; using osu.Framework.Graphics.Textures; using osu.Game.Database; -using osu.Game.Modes.Mods; +using osu.Game.Rulesets.Mods; using System; using System.Collections.Generic; diff --git a/osu.Game/Database/RulesetDatabase.cs b/osu.Game/Database/RulesetDatabase.cs index d19fe56345..b78ca5ffc6 100644 --- a/osu.Game/Database/RulesetDatabase.cs +++ b/osu.Game/Database/RulesetDatabase.cs @@ -7,7 +7,7 @@ using System.IO; using System.Linq; using System.Reflection; using osu.Framework.Platform; -using osu.Game.Modes; +using osu.Game.Rulesets; using SQLite.Net; namespace osu.Game.Database @@ -35,7 +35,7 @@ namespace osu.Game.Database List instances = new List(); - foreach (string file in Directory.GetFiles(Environment.CurrentDirectory, @"osu.Game.Modes.*.dll")) + foreach (string file in Directory.GetFiles(Environment.CurrentDirectory, @"osu.Game.Rulesets.*.dll")) { try { diff --git a/osu.Game/Database/RulesetInfo.cs b/osu.Game/Database/RulesetInfo.cs index c3c0d4343d..322cb10c33 100644 --- a/osu.Game/Database/RulesetInfo.cs +++ b/osu.Game/Database/RulesetInfo.cs @@ -2,7 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; -using osu.Game.Modes; +using osu.Game.Rulesets; using SQLite.Net.Attributes; namespace osu.Game.Database diff --git a/osu.Game/Database/ScoreDatabase.cs b/osu.Game/Database/ScoreDatabase.cs index a2fff7f795..359728070f 100644 --- a/osu.Game/Database/ScoreDatabase.cs +++ b/osu.Game/Database/ScoreDatabase.cs @@ -7,7 +7,7 @@ using System.Linq; using osu.Framework.Platform; using osu.Game.IO.Legacy; using osu.Game.IPC; -using osu.Game.Modes.Scoring; +using osu.Game.Rulesets.Scoring; using SharpCompress.Compressors.LZMA; using SQLite.Net; diff --git a/osu.Game/Graphics/TextAwesome.cs b/osu.Game/Graphics/TextAwesome.cs index 1bae165e45..69b0217444 100644 --- a/osu.Game/Graphics/TextAwesome.cs +++ b/osu.Game/Graphics/TextAwesome.cs @@ -817,13 +817,13 @@ namespace osu.Game.Graphics fa_youtube_play = 0xf16a, fa_youtube_square = 0xf166, - // gamemode icons in circles + // ruleset icons in circles fa_osu_osu_o = 0xe000, fa_osu_mania_o = 0xe001, fa_osu_fruits_o = 0xe002, fa_osu_taiko_o = 0xe003, - // gamemode icons without circles + // ruleset icons without circles fa_osu_filled_circle = 0xe004, fa_osu_cross_o = 0xe005, fa_osu_logo = 0xe006, diff --git a/osu.Game/Online/API/Requests/GetScoresRequest.cs b/osu.Game/Online/API/Requests/GetScoresRequest.cs index 66c5e6c72d..3685d0b9e3 100644 --- a/osu.Game/Online/API/Requests/GetScoresRequest.cs +++ b/osu.Game/Online/API/Requests/GetScoresRequest.cs @@ -5,7 +5,7 @@ using System.Collections.Generic; using Newtonsoft.Json; using osu.Framework.IO.Network; using osu.Game.Database; -using osu.Game.Modes.Scoring; +using osu.Game.Rulesets.Scoring; namespace osu.Game.Online.API.Requests { diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 1006008afc..cd89f4bdc7 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -25,7 +25,7 @@ using System.Threading.Tasks; using osu.Framework.Threading; using osu.Game.Database; using osu.Game.Graphics; -using osu.Game.Modes.Scoring; +using osu.Game.Rulesets.Scoring; using osu.Game.Overlays.Notifications; using osu.Game.Screens.Play; @@ -205,7 +205,7 @@ namespace osu.Game OnRulesetChange = r => Ruleset.Value = r, }, t => { - Ruleset.ValueChanged += delegate { Toolbar.SetGameMode(Ruleset.Value); }; + Ruleset.ValueChanged += delegate { Toolbar.SetRuleset(Ruleset.Value); }; Ruleset.TriggerChange(); overlayContent.Add(Toolbar); }); @@ -279,7 +279,7 @@ namespace osu.Game return; } - //central game mode change logic. + //central game screen change logic. if (!currentScreen.ShowOverlays) { options.State = Visibility.Hidden; diff --git a/osu.Game/Overlays/Mods/AssistedSection.cs b/osu.Game/Overlays/Mods/AssistedSection.cs index a1ec7a3fdc..b4263fa309 100644 --- a/osu.Game/Overlays/Mods/AssistedSection.cs +++ b/osu.Game/Overlays/Mods/AssistedSection.cs @@ -4,7 +4,7 @@ using OpenTK.Input; using osu.Framework.Allocation; using osu.Game.Graphics; -using osu.Game.Modes.Mods; +using osu.Game.Rulesets.Mods; namespace osu.Game.Overlays.Mods { diff --git a/osu.Game/Overlays/Mods/DifficultyIncreaseSection.cs b/osu.Game/Overlays/Mods/DifficultyIncreaseSection.cs index 13df5aabfb..0a293416dc 100644 --- a/osu.Game/Overlays/Mods/DifficultyIncreaseSection.cs +++ b/osu.Game/Overlays/Mods/DifficultyIncreaseSection.cs @@ -4,7 +4,7 @@ using OpenTK.Input; using osu.Framework.Allocation; using osu.Game.Graphics; -using osu.Game.Modes.Mods; +using osu.Game.Rulesets.Mods; namespace osu.Game.Overlays.Mods { diff --git a/osu.Game/Overlays/Mods/DifficultyReductionSection.cs b/osu.Game/Overlays/Mods/DifficultyReductionSection.cs index f8ac4551ef..3a373e6f09 100644 --- a/osu.Game/Overlays/Mods/DifficultyReductionSection.cs +++ b/osu.Game/Overlays/Mods/DifficultyReductionSection.cs @@ -4,7 +4,7 @@ using OpenTK.Input; using osu.Framework.Allocation; using osu.Game.Graphics; -using osu.Game.Modes.Mods; +using osu.Game.Rulesets.Mods; namespace osu.Game.Overlays.Mods { diff --git a/osu.Game/Overlays/Mods/ModButton.cs b/osu.Game/Overlays/Mods/ModButton.cs index b787935d57..f380c19d8a 100644 --- a/osu.Game/Overlays/Mods/ModButton.cs +++ b/osu.Game/Overlays/Mods/ModButton.cs @@ -12,8 +12,8 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; using osu.Framework.Input; using osu.Game.Graphics.Sprites; -using osu.Game.Modes.Mods; -using osu.Game.Modes.UI; +using osu.Game.Rulesets.Mods; +using osu.Game.Rulesets.UI; using System; using System.Linq; diff --git a/osu.Game/Overlays/Mods/ModSection.cs b/osu.Game/Overlays/Mods/ModSection.cs index 0e93a5520d..c2af12f49e 100644 --- a/osu.Game/Overlays/Mods/ModSection.cs +++ b/osu.Game/Overlays/Mods/ModSection.cs @@ -9,7 +9,7 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Primitives; using osu.Framework.Input; using osu.Game.Graphics.Sprites; -using osu.Game.Modes.Mods; +using osu.Game.Rulesets.Mods; using System; namespace osu.Game.Overlays.Mods diff --git a/osu.Game/Overlays/Mods/ModSelectOverlay.cs b/osu.Game/Overlays/Mods/ModSelectOverlay.cs index bf7117edf1..dadfb808f7 100644 --- a/osu.Game/Overlays/Mods/ModSelectOverlay.cs +++ b/osu.Game/Overlays/Mods/ModSelectOverlay.cs @@ -13,7 +13,7 @@ using osu.Framework.Graphics.Sprites; using osu.Game.Graphics; using osu.Game.Graphics.Backgrounds; using osu.Game.Graphics.Sprites; -using osu.Game.Modes.Mods; +using osu.Game.Rulesets.Mods; using System; using System.Collections.Generic; using System.Linq; diff --git a/osu.Game/Overlays/Toolbar/Toolbar.cs b/osu.Game/Overlays/Toolbar/Toolbar.cs index 4632b55775..86ec6b37e2 100644 --- a/osu.Game/Overlays/Toolbar/Toolbar.cs +++ b/osu.Game/Overlays/Toolbar/Toolbar.cs @@ -129,7 +129,7 @@ namespace osu.Game.Overlays.Toolbar } } - public void SetGameMode(RulesetInfo ruleset) => modeSelector.SetGameMode(ruleset); + public void SetRuleset(RulesetInfo ruleset) => modeSelector.SetRuleset(ruleset); protected override void PopIn() { diff --git a/osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs b/osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs index e4c9db7c5d..1d3260bb23 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs @@ -75,7 +75,7 @@ namespace osu.Game.Overlays.Toolbar Ruleset = ruleset, Action = delegate { - SetGameMode(ruleset); + SetRuleset(ruleset); OnRulesetChange?.Invoke(ruleset); } }); @@ -89,7 +89,7 @@ namespace osu.Game.Overlays.Toolbar Size = new Vector2(modeButtons.DrawSize.X, 1); } - public void SetGameMode(RulesetInfo ruleset) + public void SetRuleset(RulesetInfo ruleset) { foreach (ToolbarModeButton m in modeButtons.Children.Cast()) { diff --git a/osu.Game/Modes/BeatmapStatistic.cs b/osu.Game/Rulesets/BeatmapStatistic.cs similarity index 88% rename from osu.Game/Modes/BeatmapStatistic.cs rename to osu.Game/Rulesets/BeatmapStatistic.cs index d598b81ff4..11ac698851 100644 --- a/osu.Game/Modes/BeatmapStatistic.cs +++ b/osu.Game/Rulesets/BeatmapStatistic.cs @@ -3,7 +3,7 @@ using osu.Game.Graphics; -namespace osu.Game.Modes +namespace osu.Game.Rulesets { public class BeatmapStatistic { diff --git a/osu.Game/Modes/Beatmaps/BeatmapConverter.cs b/osu.Game/Rulesets/Beatmaps/BeatmapConverter.cs similarity index 95% rename from osu.Game/Modes/Beatmaps/BeatmapConverter.cs rename to osu.Game/Rulesets/Beatmaps/BeatmapConverter.cs index c2e5b0affa..07aae6a26e 100644 --- a/osu.Game/Modes/Beatmaps/BeatmapConverter.cs +++ b/osu.Game/Rulesets/Beatmaps/BeatmapConverter.cs @@ -4,10 +4,10 @@ using System; using System.Collections.Generic; using System.Linq; -using osu.Game.Modes.Objects; +using osu.Game.Rulesets.Objects; using osu.Game.Beatmaps; -namespace osu.Game.Modes.Beatmaps +namespace osu.Game.Rulesets.Beatmaps { /// /// Converts a Beatmap for another mode. diff --git a/osu.Game/Modes/Beatmaps/BeatmapProcessor.cs b/osu.Game/Rulesets/Beatmaps/BeatmapProcessor.cs similarity index 89% rename from osu.Game/Modes/Beatmaps/BeatmapProcessor.cs rename to osu.Game/Rulesets/Beatmaps/BeatmapProcessor.cs index ff675a4e5e..ee9fc30f7b 100644 --- a/osu.Game/Modes/Beatmaps/BeatmapProcessor.cs +++ b/osu.Game/Rulesets/Beatmaps/BeatmapProcessor.cs @@ -2,9 +2,9 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Beatmaps; -using osu.Game.Modes.Objects; +using osu.Game.Rulesets.Objects; -namespace osu.Game.Modes.Beatmaps +namespace osu.Game.Rulesets.Beatmaps { /// /// Processes a post-converted Beatmap. diff --git a/osu.Game/Modes/Judgements/DrawableJudgement.cs b/osu.Game/Rulesets/Judgements/DrawableJudgement.cs similarity index 94% rename from osu.Game/Modes/Judgements/DrawableJudgement.cs rename to osu.Game/Rulesets/Judgements/DrawableJudgement.cs index eabcb5c161..3a82827497 100644 --- a/osu.Game/Modes/Judgements/DrawableJudgement.cs +++ b/osu.Game/Rulesets/Judgements/DrawableJudgement.cs @@ -9,9 +9,9 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; -using osu.Game.Modes.Objects.Drawables; +using osu.Game.Rulesets.Objects.Drawables; -namespace osu.Game.Modes.Judgements +namespace osu.Game.Rulesets.Judgements { /// /// A drawable object which visualises the hit result of a . diff --git a/osu.Game/Modes/Judgements/IPartialJudgement.cs b/osu.Game/Rulesets/Judgements/IPartialJudgement.cs similarity index 87% rename from osu.Game/Modes/Judgements/IPartialJudgement.cs rename to osu.Game/Rulesets/Judgements/IPartialJudgement.cs index 2ca1ffce4d..e11270a8c0 100644 --- a/osu.Game/Modes/Judgements/IPartialJudgement.cs +++ b/osu.Game/Rulesets/Judgements/IPartialJudgement.cs @@ -1,10 +1,10 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Game.Modes.Objects.Drawables; -using osu.Game.Modes.Scoring; +using osu.Game.Rulesets.Objects.Drawables; +using osu.Game.Rulesets.Scoring; -namespace osu.Game.Modes.Judgements +namespace osu.Game.Rulesets.Judgements { /// /// Inidicates that the judgement this is attached to is a partial judgement and the scoring value may change. diff --git a/osu.Game/Modes/Judgements/Judgement.cs b/osu.Game/Rulesets/Judgements/Judgement.cs similarity index 88% rename from osu.Game/Modes/Judgements/Judgement.cs rename to osu.Game/Rulesets/Judgements/Judgement.cs index 1bf898d25c..ed33cee5d4 100644 --- a/osu.Game/Modes/Judgements/Judgement.cs +++ b/osu.Game/Rulesets/Judgements/Judgement.cs @@ -1,9 +1,9 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Game.Modes.Objects.Drawables; +using osu.Game.Rulesets.Objects.Drawables; -namespace osu.Game.Modes.Judgements +namespace osu.Game.Rulesets.Judgements { public abstract class Judgement { diff --git a/osu.Game/Modes/Mods/IApplicableMod.cs b/osu.Game/Rulesets/Mods/IApplicableMod.cs similarity index 85% rename from osu.Game/Modes/Mods/IApplicableMod.cs rename to osu.Game/Rulesets/Mods/IApplicableMod.cs index 90547f4402..66f3fc5da6 100644 --- a/osu.Game/Modes/Mods/IApplicableMod.cs +++ b/osu.Game/Rulesets/Mods/IApplicableMod.cs @@ -1,10 +1,10 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Game.Modes.Objects; -using osu.Game.Modes.UI; +using osu.Game.Rulesets.Objects; +using osu.Game.Rulesets.UI; -namespace osu.Game.Modes.Mods +namespace osu.Game.Rulesets.Mods { /// /// An interface for mods that are applied to a HitRenderer. diff --git a/osu.Game/Modes/Mods/Mod.cs b/osu.Game/Rulesets/Mods/Mod.cs similarity index 95% rename from osu.Game/Modes/Mods/Mod.cs rename to osu.Game/Rulesets/Mods/Mod.cs index b6f09b8506..cfb4d8b8ab 100644 --- a/osu.Game/Modes/Mods/Mod.cs +++ b/osu.Game/Rulesets/Mods/Mod.cs @@ -3,12 +3,12 @@ using osu.Game.Beatmaps; using osu.Game.Graphics; -using osu.Game.Modes.Objects; -using osu.Game.Modes.UI; +using osu.Game.Rulesets.Objects; +using osu.Game.Rulesets.UI; using System; -using osu.Game.Modes.Scoring; +using osu.Game.Rulesets.Scoring; -namespace osu.Game.Modes.Mods +namespace osu.Game.Rulesets.Mods { /// /// The base class for gameplay modifiers. diff --git a/osu.Game/Modes/Mods/ModType.cs b/osu.Game/Rulesets/Mods/ModType.cs similarity index 85% rename from osu.Game/Modes/Mods/ModType.cs rename to osu.Game/Rulesets/Mods/ModType.cs index b1d0e781e1..15ffc4ad63 100644 --- a/osu.Game/Modes/Mods/ModType.cs +++ b/osu.Game/Rulesets/Mods/ModType.cs @@ -1,7 +1,7 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -namespace osu.Game.Modes.Mods +namespace osu.Game.Rulesets.Mods { public enum ModType { diff --git a/osu.Game/Modes/Objects/BezierApproximator.cs b/osu.Game/Rulesets/Objects/BezierApproximator.cs similarity index 97% rename from osu.Game/Modes/Objects/BezierApproximator.cs rename to osu.Game/Rulesets/Objects/BezierApproximator.cs index 6688e6b2ce..12be591aab 100644 --- a/osu.Game/Modes/Objects/BezierApproximator.cs +++ b/osu.Game/Rulesets/Objects/BezierApproximator.cs @@ -4,7 +4,7 @@ using System.Collections.Generic; using OpenTK; -namespace osu.Game.Modes.Objects +namespace osu.Game.Rulesets.Objects { public class BezierApproximator { diff --git a/osu.Game/Modes/Objects/CircularArcApproximator.cs b/osu.Game/Rulesets/Objects/CircularArcApproximator.cs similarity index 96% rename from osu.Game/Modes/Objects/CircularArcApproximator.cs rename to osu.Game/Rulesets/Objects/CircularArcApproximator.cs index 73db5fab29..642793fa3f 100644 --- a/osu.Game/Modes/Objects/CircularArcApproximator.cs +++ b/osu.Game/Rulesets/Objects/CircularArcApproximator.cs @@ -6,7 +6,7 @@ using System.Collections.Generic; using osu.Framework.MathUtils; using OpenTK; -namespace osu.Game.Modes.Objects +namespace osu.Game.Rulesets.Objects { public class CircularArcApproximator { diff --git a/osu.Game/Modes/Objects/CurvedHitObject.cs b/osu.Game/Rulesets/Objects/CurvedHitObject.cs similarity index 91% rename from osu.Game/Modes/Objects/CurvedHitObject.cs rename to osu.Game/Rulesets/Objects/CurvedHitObject.cs index ccb3d2497d..517c276242 100644 --- a/osu.Game/Modes/Objects/CurvedHitObject.cs +++ b/osu.Game/Rulesets/Objects/CurvedHitObject.cs @@ -2,10 +2,10 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; -using osu.Game.Modes.Objects.Types; +using osu.Game.Rulesets.Objects.Types; using System.Collections.Generic; -namespace osu.Game.Modes.Objects +namespace osu.Game.Rulesets.Objects { public class CurvedHitObject : HitObject, IHasCurve { diff --git a/osu.Game/Modes/Objects/Drawables/ArmedState.cs b/osu.Game/Rulesets/Objects/Drawables/ArmedState.cs similarity index 80% rename from osu.Game/Modes/Objects/Drawables/ArmedState.cs rename to osu.Game/Rulesets/Objects/Drawables/ArmedState.cs index 2f8d3ad07a..5e57c57f4d 100644 --- a/osu.Game/Modes/Objects/Drawables/ArmedState.cs +++ b/osu.Game/Rulesets/Objects/Drawables/ArmedState.cs @@ -1,7 +1,7 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -namespace osu.Game.Modes.Objects.Drawables +namespace osu.Game.Rulesets.Objects.Drawables { public enum ArmedState { diff --git a/osu.Game/Modes/Objects/Drawables/DrawableHitObject.cs b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs similarity index 94% rename from osu.Game/Modes/Objects/Drawables/DrawableHitObject.cs rename to osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs index e346a22813..a300eeab31 100644 --- a/osu.Game/Modes/Objects/Drawables/DrawableHitObject.cs +++ b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs @@ -7,13 +7,13 @@ using osu.Framework; using osu.Framework.Allocation; using osu.Framework.Audio; using osu.Framework.Audio.Sample; -using osu.Game.Modes.Judgements; +using osu.Game.Rulesets.Judgements; using Container = osu.Framework.Graphics.Containers.Container; -using osu.Game.Modes.Objects.Types; +using osu.Game.Rulesets.Objects.Types; using OpenTK.Graphics; using osu.Game.Audio; -namespace osu.Game.Modes.Objects.Drawables +namespace osu.Game.Rulesets.Objects.Drawables { public abstract class DrawableHitObject : Container, IStateful where TJudgement : Judgement diff --git a/osu.Game/Modes/Objects/Drawables/HitResult.cs b/osu.Game/Rulesets/Objects/Drawables/HitResult.cs similarity index 90% rename from osu.Game/Modes/Objects/Drawables/HitResult.cs rename to osu.Game/Rulesets/Objects/Drawables/HitResult.cs index e036610ae2..7492c0ab96 100644 --- a/osu.Game/Modes/Objects/Drawables/HitResult.cs +++ b/osu.Game/Rulesets/Objects/Drawables/HitResult.cs @@ -3,7 +3,7 @@ using System.ComponentModel; -namespace osu.Game.Modes.Objects.Drawables +namespace osu.Game.Rulesets.Objects.Drawables { public enum HitResult { diff --git a/osu.Game/Modes/Objects/Drawables/IDrawableHitObjectWithProxiedApproach.cs b/osu.Game/Rulesets/Objects/Drawables/IDrawableHitObjectWithProxiedApproach.cs similarity index 83% rename from osu.Game/Modes/Objects/Drawables/IDrawableHitObjectWithProxiedApproach.cs rename to osu.Game/Rulesets/Objects/Drawables/IDrawableHitObjectWithProxiedApproach.cs index 33a1f51414..0314ef3037 100644 --- a/osu.Game/Modes/Objects/Drawables/IDrawableHitObjectWithProxiedApproach.cs +++ b/osu.Game/Rulesets/Objects/Drawables/IDrawableHitObjectWithProxiedApproach.cs @@ -3,7 +3,7 @@ using osu.Framework.Graphics; -namespace osu.Game.Modes.Objects.Drawables +namespace osu.Game.Rulesets.Objects.Drawables { public interface IDrawableHitObjectWithProxiedApproach { diff --git a/osu.Game/Modes/Objects/HitObject.cs b/osu.Game/Rulesets/Objects/HitObject.cs similarity index 95% rename from osu.Game/Modes/Objects/HitObject.cs rename to osu.Game/Rulesets/Objects/HitObject.cs index f362d6de63..240d110976 100644 --- a/osu.Game/Modes/Objects/HitObject.cs +++ b/osu.Game/Rulesets/Objects/HitObject.cs @@ -6,7 +6,7 @@ using osu.Game.Beatmaps.Timing; using osu.Game.Database; using System.Collections.Generic; -namespace osu.Game.Modes.Objects +namespace osu.Game.Rulesets.Objects { /// /// A HitObject describes an object in a Beatmap. diff --git a/osu.Game/Modes/Objects/HitObjectParser.cs b/osu.Game/Rulesets/Objects/HitObjectParser.cs similarity index 85% rename from osu.Game/Modes/Objects/HitObjectParser.cs rename to osu.Game/Rulesets/Objects/HitObjectParser.cs index 5aa9f08589..ea0b5e0d2e 100644 --- a/osu.Game/Modes/Objects/HitObjectParser.cs +++ b/osu.Game/Rulesets/Objects/HitObjectParser.cs @@ -1,7 +1,7 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -namespace osu.Game.Modes.Objects +namespace osu.Game.Rulesets.Objects { public abstract class HitObjectParser { diff --git a/osu.Game/Modes/Objects/Legacy/Catch/Hit.cs b/osu.Game/Rulesets/Objects/Legacy/Catch/Hit.cs similarity index 79% rename from osu.Game/Modes/Objects/Legacy/Catch/Hit.cs rename to osu.Game/Rulesets/Objects/Legacy/Catch/Hit.cs index dba7926a79..41dacd1265 100644 --- a/osu.Game/Modes/Objects/Legacy/Catch/Hit.cs +++ b/osu.Game/Rulesets/Objects/Legacy/Catch/Hit.cs @@ -1,9 +1,9 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Game.Modes.Objects.Types; +using osu.Game.Rulesets.Objects.Types; -namespace osu.Game.Modes.Objects.Legacy.Catch +namespace osu.Game.Rulesets.Objects.Legacy.Catch { /// /// Legacy osu!catch Hit-type, used for parsing Beatmaps. diff --git a/osu.Game/Modes/Objects/Legacy/Catch/HitObjectParser.cs b/osu.Game/Rulesets/Objects/Legacy/Catch/HitObjectParser.cs similarity index 90% rename from osu.Game/Modes/Objects/Legacy/Catch/HitObjectParser.cs rename to osu.Game/Rulesets/Objects/Legacy/Catch/HitObjectParser.cs index 0ef4ed0646..a27244e5bd 100644 --- a/osu.Game/Modes/Objects/Legacy/Catch/HitObjectParser.cs +++ b/osu.Game/Rulesets/Objects/Legacy/Catch/HitObjectParser.cs @@ -2,10 +2,10 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; -using osu.Game.Modes.Objects.Types; +using osu.Game.Rulesets.Objects.Types; using System.Collections.Generic; -namespace osu.Game.Modes.Objects.Legacy.Catch +namespace osu.Game.Rulesets.Objects.Legacy.Catch { /// /// A HitObjectParser to parse legacy osu!catch Beatmaps. diff --git a/osu.Game/Modes/Objects/Legacy/Catch/Slider.cs b/osu.Game/Rulesets/Objects/Legacy/Catch/Slider.cs similarity index 80% rename from osu.Game/Modes/Objects/Legacy/Catch/Slider.cs rename to osu.Game/Rulesets/Objects/Legacy/Catch/Slider.cs index de71198851..865e56c847 100644 --- a/osu.Game/Modes/Objects/Legacy/Catch/Slider.cs +++ b/osu.Game/Rulesets/Objects/Legacy/Catch/Slider.cs @@ -1,9 +1,9 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Game.Modes.Objects.Types; +using osu.Game.Rulesets.Objects.Types; -namespace osu.Game.Modes.Objects.Legacy.Catch +namespace osu.Game.Rulesets.Objects.Legacy.Catch { /// /// Legacy osu!catch Slider-type, used for parsing Beatmaps. diff --git a/osu.Game/Modes/Objects/Legacy/Catch/Spinner.cs b/osu.Game/Rulesets/Objects/Legacy/Catch/Spinner.cs similarity index 80% rename from osu.Game/Modes/Objects/Legacy/Catch/Spinner.cs rename to osu.Game/Rulesets/Objects/Legacy/Catch/Spinner.cs index a99804a243..7690f42e76 100644 --- a/osu.Game/Modes/Objects/Legacy/Catch/Spinner.cs +++ b/osu.Game/Rulesets/Objects/Legacy/Catch/Spinner.cs @@ -1,9 +1,9 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Game.Modes.Objects.Types; +using osu.Game.Rulesets.Objects.Types; -namespace osu.Game.Modes.Objects.Legacy.Catch +namespace osu.Game.Rulesets.Objects.Legacy.Catch { /// /// Legacy osu!catch Spinner-type, used for parsing Beatmaps. diff --git a/osu.Game/Modes/Objects/Legacy/HitObjectParser.cs b/osu.Game/Rulesets/Objects/Legacy/HitObjectParser.cs similarity index 96% rename from osu.Game/Modes/Objects/Legacy/HitObjectParser.cs rename to osu.Game/Rulesets/Objects/Legacy/HitObjectParser.cs index ec89a63c7a..c915e67ead 100644 --- a/osu.Game/Modes/Objects/Legacy/HitObjectParser.cs +++ b/osu.Game/Rulesets/Objects/Legacy/HitObjectParser.cs @@ -2,14 +2,14 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; -using osu.Game.Modes.Objects.Types; +using osu.Game.Rulesets.Objects.Types; using System; using System.Collections.Generic; using System.Globalization; using osu.Game.Beatmaps.Formats; using osu.Game.Audio; -namespace osu.Game.Modes.Objects.Legacy +namespace osu.Game.Rulesets.Objects.Legacy { /// /// A HitObjectParser to parse legacy Beatmaps. diff --git a/osu.Game/Modes/Objects/Legacy/HitObjectType.cs b/osu.Game/Rulesets/Objects/Legacy/HitObjectType.cs similarity index 86% rename from osu.Game/Modes/Objects/Legacy/HitObjectType.cs rename to osu.Game/Rulesets/Objects/Legacy/HitObjectType.cs index e203b57c62..9111e6bd12 100644 --- a/osu.Game/Modes/Objects/Legacy/HitObjectType.cs +++ b/osu.Game/Rulesets/Objects/Legacy/HitObjectType.cs @@ -3,7 +3,7 @@ using System; -namespace osu.Game.Modes.Objects.Legacy +namespace osu.Game.Rulesets.Objects.Legacy { [Flags] public enum HitObjectType diff --git a/osu.Game/Modes/Objects/Legacy/Hold.cs b/osu.Game/Rulesets/Objects/Legacy/Hold.cs similarity index 83% rename from osu.Game/Modes/Objects/Legacy/Hold.cs rename to osu.Game/Rulesets/Objects/Legacy/Hold.cs index 6014bf7201..a0a741e8e7 100644 --- a/osu.Game/Modes/Objects/Legacy/Hold.cs +++ b/osu.Game/Rulesets/Objects/Legacy/Hold.cs @@ -2,9 +2,9 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; -using osu.Game.Modes.Objects.Types; +using osu.Game.Rulesets.Objects.Types; -namespace osu.Game.Modes.Objects.Legacy +namespace osu.Game.Rulesets.Objects.Legacy { /// /// Legacy Hold-type, used for parsing "specials" in beatmaps. diff --git a/osu.Game/Modes/Objects/Legacy/Mania/Hit.cs b/osu.Game/Rulesets/Objects/Legacy/Mania/Hit.cs similarity index 79% rename from osu.Game/Modes/Objects/Legacy/Mania/Hit.cs rename to osu.Game/Rulesets/Objects/Legacy/Mania/Hit.cs index 3131bbd89d..8e407fcf92 100644 --- a/osu.Game/Modes/Objects/Legacy/Mania/Hit.cs +++ b/osu.Game/Rulesets/Objects/Legacy/Mania/Hit.cs @@ -1,9 +1,9 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Game.Modes.Objects.Types; +using osu.Game.Rulesets.Objects.Types; -namespace osu.Game.Modes.Objects.Legacy.Mania +namespace osu.Game.Rulesets.Objects.Legacy.Mania { /// /// Legacy osu!mania Hit-type, used for parsing Beatmaps. diff --git a/osu.Game/Modes/Objects/Legacy/Mania/HitObjectParser.cs b/osu.Game/Rulesets/Objects/Legacy/Mania/HitObjectParser.cs similarity index 90% rename from osu.Game/Modes/Objects/Legacy/Mania/HitObjectParser.cs rename to osu.Game/Rulesets/Objects/Legacy/Mania/HitObjectParser.cs index 1ef01a06b9..98f0459e0a 100644 --- a/osu.Game/Modes/Objects/Legacy/Mania/HitObjectParser.cs +++ b/osu.Game/Rulesets/Objects/Legacy/Mania/HitObjectParser.cs @@ -2,10 +2,10 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; -using osu.Game.Modes.Objects.Types; +using osu.Game.Rulesets.Objects.Types; using System.Collections.Generic; -namespace osu.Game.Modes.Objects.Legacy.Mania +namespace osu.Game.Rulesets.Objects.Legacy.Mania { /// /// A HitObjectParser to parse legacy osu!mania Beatmaps. diff --git a/osu.Game/Modes/Objects/Legacy/Mania/Slider.cs b/osu.Game/Rulesets/Objects/Legacy/Mania/Slider.cs similarity index 80% rename from osu.Game/Modes/Objects/Legacy/Mania/Slider.cs rename to osu.Game/Rulesets/Objects/Legacy/Mania/Slider.cs index bf8eaa561a..c884ed324b 100644 --- a/osu.Game/Modes/Objects/Legacy/Mania/Slider.cs +++ b/osu.Game/Rulesets/Objects/Legacy/Mania/Slider.cs @@ -1,9 +1,9 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Game.Modes.Objects.Types; +using osu.Game.Rulesets.Objects.Types; -namespace osu.Game.Modes.Objects.Legacy.Mania +namespace osu.Game.Rulesets.Objects.Legacy.Mania { /// /// Legacy osu!mania Slider-type, used for parsing Beatmaps. diff --git a/osu.Game/Modes/Objects/Legacy/Mania/Spinner.cs b/osu.Game/Rulesets/Objects/Legacy/Mania/Spinner.cs similarity index 81% rename from osu.Game/Modes/Objects/Legacy/Mania/Spinner.cs rename to osu.Game/Rulesets/Objects/Legacy/Mania/Spinner.cs index 8183f1129b..3937eb003e 100644 --- a/osu.Game/Modes/Objects/Legacy/Mania/Spinner.cs +++ b/osu.Game/Rulesets/Objects/Legacy/Mania/Spinner.cs @@ -1,9 +1,9 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Game.Modes.Objects.Types; +using osu.Game.Rulesets.Objects.Types; -namespace osu.Game.Modes.Objects.Legacy.Mania +namespace osu.Game.Rulesets.Objects.Legacy.Mania { /// /// Legacy osu!mania Spinner-type, used for parsing Beatmaps. diff --git a/osu.Game/Modes/Objects/Legacy/Osu/Hit.cs b/osu.Game/Rulesets/Objects/Legacy/Osu/Hit.cs similarity index 82% rename from osu.Game/Modes/Objects/Legacy/Osu/Hit.cs rename to osu.Game/Rulesets/Objects/Legacy/Osu/Hit.cs index 397273391a..a30ba9b265 100644 --- a/osu.Game/Modes/Objects/Legacy/Osu/Hit.cs +++ b/osu.Game/Rulesets/Objects/Legacy/Osu/Hit.cs @@ -1,10 +1,10 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Game.Modes.Objects.Types; +using osu.Game.Rulesets.Objects.Types; using OpenTK; -namespace osu.Game.Modes.Objects.Legacy.Osu +namespace osu.Game.Rulesets.Objects.Legacy.Osu { /// /// Legacy osu! Hit-type, used for parsing Beatmaps. diff --git a/osu.Game/Modes/Objects/Legacy/Osu/HitObjectParser.cs b/osu.Game/Rulesets/Objects/Legacy/Osu/HitObjectParser.cs similarity index 90% rename from osu.Game/Modes/Objects/Legacy/Osu/HitObjectParser.cs rename to osu.Game/Rulesets/Objects/Legacy/Osu/HitObjectParser.cs index d063ef8c48..227a4412c4 100644 --- a/osu.Game/Modes/Objects/Legacy/Osu/HitObjectParser.cs +++ b/osu.Game/Rulesets/Objects/Legacy/Osu/HitObjectParser.cs @@ -2,10 +2,10 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; -using osu.Game.Modes.Objects.Types; +using osu.Game.Rulesets.Objects.Types; using System.Collections.Generic; -namespace osu.Game.Modes.Objects.Legacy.Osu +namespace osu.Game.Rulesets.Objects.Legacy.Osu { /// /// A HitObjectParser to parse legacy osu! Beatmaps. diff --git a/osu.Game/Modes/Objects/Legacy/Osu/Slider.cs b/osu.Game/Rulesets/Objects/Legacy/Osu/Slider.cs similarity index 82% rename from osu.Game/Modes/Objects/Legacy/Osu/Slider.cs rename to osu.Game/Rulesets/Objects/Legacy/Osu/Slider.cs index 24deda85bf..7d90c6d41e 100644 --- a/osu.Game/Modes/Objects/Legacy/Osu/Slider.cs +++ b/osu.Game/Rulesets/Objects/Legacy/Osu/Slider.cs @@ -1,10 +1,10 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Game.Modes.Objects.Types; +using osu.Game.Rulesets.Objects.Types; using OpenTK; -namespace osu.Game.Modes.Objects.Legacy.Osu +namespace osu.Game.Rulesets.Objects.Legacy.Osu { /// /// Legacy osu! Slider-type, used for parsing Beatmaps. diff --git a/osu.Game/Modes/Objects/Legacy/Osu/Spinner.cs b/osu.Game/Rulesets/Objects/Legacy/Osu/Spinner.cs similarity index 84% rename from osu.Game/Modes/Objects/Legacy/Osu/Spinner.cs rename to osu.Game/Rulesets/Objects/Legacy/Osu/Spinner.cs index c1c2b34b7c..ad3f9637a7 100644 --- a/osu.Game/Modes/Objects/Legacy/Osu/Spinner.cs +++ b/osu.Game/Rulesets/Objects/Legacy/Osu/Spinner.cs @@ -1,10 +1,10 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Game.Modes.Objects.Types; +using osu.Game.Rulesets.Objects.Types; using OpenTK; -namespace osu.Game.Modes.Objects.Legacy.Osu +namespace osu.Game.Rulesets.Objects.Legacy.Osu { /// /// Legacy osu! Spinner-type, used for parsing Beatmaps. diff --git a/osu.Game/Modes/Objects/Legacy/Taiko/Hit.cs b/osu.Game/Rulesets/Objects/Legacy/Taiko/Hit.cs similarity index 78% rename from osu.Game/Modes/Objects/Legacy/Taiko/Hit.cs rename to osu.Game/Rulesets/Objects/Legacy/Taiko/Hit.cs index 73f9b67630..0a9a8ac64c 100644 --- a/osu.Game/Modes/Objects/Legacy/Taiko/Hit.cs +++ b/osu.Game/Rulesets/Objects/Legacy/Taiko/Hit.cs @@ -1,9 +1,9 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Game.Modes.Objects.Types; +using osu.Game.Rulesets.Objects.Types; -namespace osu.Game.Modes.Objects.Legacy.Taiko +namespace osu.Game.Rulesets.Objects.Legacy.Taiko { /// /// Legacy osu!taiko Hit-type, used for parsing Beatmaps. diff --git a/osu.Game/Modes/Objects/Legacy/Taiko/HitObjectParser.cs b/osu.Game/Rulesets/Objects/Legacy/Taiko/HitObjectParser.cs similarity index 90% rename from osu.Game/Modes/Objects/Legacy/Taiko/HitObjectParser.cs rename to osu.Game/Rulesets/Objects/Legacy/Taiko/HitObjectParser.cs index 80b5b9d1cb..669ee34910 100644 --- a/osu.Game/Modes/Objects/Legacy/Taiko/HitObjectParser.cs +++ b/osu.Game/Rulesets/Objects/Legacy/Taiko/HitObjectParser.cs @@ -2,10 +2,10 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; -using osu.Game.Modes.Objects.Types; +using osu.Game.Rulesets.Objects.Types; using System.Collections.Generic; -namespace osu.Game.Modes.Objects.Legacy.Taiko +namespace osu.Game.Rulesets.Objects.Legacy.Taiko { /// /// A HitObjectParser to parse legacy osu!taiko Beatmaps. diff --git a/osu.Game/Modes/Objects/Legacy/Taiko/Slider.cs b/osu.Game/Rulesets/Objects/Legacy/Taiko/Slider.cs similarity index 78% rename from osu.Game/Modes/Objects/Legacy/Taiko/Slider.cs rename to osu.Game/Rulesets/Objects/Legacy/Taiko/Slider.cs index b173101fce..18d2d4039d 100644 --- a/osu.Game/Modes/Objects/Legacy/Taiko/Slider.cs +++ b/osu.Game/Rulesets/Objects/Legacy/Taiko/Slider.cs @@ -1,9 +1,9 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Game.Modes.Objects.Types; +using osu.Game.Rulesets.Objects.Types; -namespace osu.Game.Modes.Objects.Legacy.Taiko +namespace osu.Game.Rulesets.Objects.Legacy.Taiko { /// /// Legacy osu!taiko Slider-type, used for parsing Beatmaps. diff --git a/osu.Game/Modes/Objects/Legacy/Taiko/Spinner.cs b/osu.Game/Rulesets/Objects/Legacy/Taiko/Spinner.cs similarity index 80% rename from osu.Game/Modes/Objects/Legacy/Taiko/Spinner.cs rename to osu.Game/Rulesets/Objects/Legacy/Taiko/Spinner.cs index b22f4600c9..1b296b9533 100644 --- a/osu.Game/Modes/Objects/Legacy/Taiko/Spinner.cs +++ b/osu.Game/Rulesets/Objects/Legacy/Taiko/Spinner.cs @@ -1,9 +1,9 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Game.Modes.Objects.Types; +using osu.Game.Rulesets.Objects.Types; -namespace osu.Game.Modes.Objects.Legacy.Taiko +namespace osu.Game.Rulesets.Objects.Legacy.Taiko { /// /// Legacy osu!taiko Spinner-type, used for parsing Beatmaps. diff --git a/osu.Game/Modes/Objects/SliderCurve.cs b/osu.Game/Rulesets/Objects/SliderCurve.cs similarity index 96% rename from osu.Game/Modes/Objects/SliderCurve.cs rename to osu.Game/Rulesets/Objects/SliderCurve.cs index 642a65af21..8bf85e498c 100644 --- a/osu.Game/Modes/Objects/SliderCurve.cs +++ b/osu.Game/Rulesets/Objects/SliderCurve.cs @@ -4,10 +4,10 @@ using System.Collections.Generic; using System.Linq; using osu.Framework.MathUtils; -using osu.Game.Modes.Objects.Types; +using osu.Game.Rulesets.Objects.Types; using OpenTK; -namespace osu.Game.Modes.Objects +namespace osu.Game.Rulesets.Objects { public class SliderCurve { diff --git a/osu.Game/Modes/Objects/Types/CurveType.cs b/osu.Game/Rulesets/Objects/Types/CurveType.cs similarity index 82% rename from osu.Game/Modes/Objects/Types/CurveType.cs rename to osu.Game/Rulesets/Objects/Types/CurveType.cs index ba5d3f37ac..18db712a65 100644 --- a/osu.Game/Modes/Objects/Types/CurveType.cs +++ b/osu.Game/Rulesets/Objects/Types/CurveType.cs @@ -1,7 +1,7 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -namespace osu.Game.Modes.Objects.Types +namespace osu.Game.Rulesets.Objects.Types { public enum CurveType { diff --git a/osu.Game/Modes/Objects/Types/IHasCombo.cs b/osu.Game/Rulesets/Objects/Types/IHasCombo.cs similarity index 87% rename from osu.Game/Modes/Objects/Types/IHasCombo.cs rename to osu.Game/Rulesets/Objects/Types/IHasCombo.cs index 1ca381372d..f053fdcf49 100644 --- a/osu.Game/Modes/Objects/Types/IHasCombo.cs +++ b/osu.Game/Rulesets/Objects/Types/IHasCombo.cs @@ -1,7 +1,7 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -namespace osu.Game.Modes.Objects.Types +namespace osu.Game.Rulesets.Objects.Types { /// /// A HitObject that is part of a combo. diff --git a/osu.Game/Modes/Objects/Types/IHasCurve.cs b/osu.Game/Rulesets/Objects/Types/IHasCurve.cs similarity index 95% rename from osu.Game/Modes/Objects/Types/IHasCurve.cs rename to osu.Game/Rulesets/Objects/Types/IHasCurve.cs index 0db799a15f..5ff6d03f6d 100644 --- a/osu.Game/Modes/Objects/Types/IHasCurve.cs +++ b/osu.Game/Rulesets/Objects/Types/IHasCurve.cs @@ -4,7 +4,7 @@ using System.Collections.Generic; using OpenTK; -namespace osu.Game.Modes.Objects.Types +namespace osu.Game.Rulesets.Objects.Types { /// /// A HitObject that has a curve. diff --git a/osu.Game/Modes/Objects/Types/IHasDistance.cs b/osu.Game/Rulesets/Objects/Types/IHasDistance.cs similarity index 88% rename from osu.Game/Modes/Objects/Types/IHasDistance.cs rename to osu.Game/Rulesets/Objects/Types/IHasDistance.cs index 87863e64e6..a5e487a0ba 100644 --- a/osu.Game/Modes/Objects/Types/IHasDistance.cs +++ b/osu.Game/Rulesets/Objects/Types/IHasDistance.cs @@ -1,7 +1,7 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -namespace osu.Game.Modes.Objects.Types +namespace osu.Game.Rulesets.Objects.Types { /// /// A HitObject that has a positional length. diff --git a/osu.Game/Modes/Objects/Types/IHasEndTime.cs b/osu.Game/Rulesets/Objects/Types/IHasEndTime.cs similarity index 89% rename from osu.Game/Modes/Objects/Types/IHasEndTime.cs rename to osu.Game/Rulesets/Objects/Types/IHasEndTime.cs index e96258812c..ac30afe5fb 100644 --- a/osu.Game/Modes/Objects/Types/IHasEndTime.cs +++ b/osu.Game/Rulesets/Objects/Types/IHasEndTime.cs @@ -1,7 +1,7 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -namespace osu.Game.Modes.Objects.Types +namespace osu.Game.Rulesets.Objects.Types { /// /// A HitObject that ends at a different time than its start time. diff --git a/osu.Game/Modes/Objects/Types/IHasHold.cs b/osu.Game/Rulesets/Objects/Types/IHasHold.cs similarity index 85% rename from osu.Game/Modes/Objects/Types/IHasHold.cs rename to osu.Game/Rulesets/Objects/Types/IHasHold.cs index b9f4939091..82ec790524 100644 --- a/osu.Game/Modes/Objects/Types/IHasHold.cs +++ b/osu.Game/Rulesets/Objects/Types/IHasHold.cs @@ -1,7 +1,7 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -namespace osu.Game.Modes.Objects.Types +namespace osu.Game.Rulesets.Objects.Types { /// /// A special type of HitObject, mostly used for legacy conversion of "holds". diff --git a/osu.Game/Modes/Objects/Types/IHasPosition.cs b/osu.Game/Rulesets/Objects/Types/IHasPosition.cs similarity index 88% rename from osu.Game/Modes/Objects/Types/IHasPosition.cs rename to osu.Game/Rulesets/Objects/Types/IHasPosition.cs index 094370a090..6eca86656d 100644 --- a/osu.Game/Modes/Objects/Types/IHasPosition.cs +++ b/osu.Game/Rulesets/Objects/Types/IHasPosition.cs @@ -3,7 +3,7 @@ using OpenTK; -namespace osu.Game.Modes.Objects.Types +namespace osu.Game.Rulesets.Objects.Types { /// /// A HitObject that has a starting position. diff --git a/osu.Game/Modes/Objects/Types/IHasRepeats.cs b/osu.Game/Rulesets/Objects/Types/IHasRepeats.cs similarity index 88% rename from osu.Game/Modes/Objects/Types/IHasRepeats.cs rename to osu.Game/Rulesets/Objects/Types/IHasRepeats.cs index a34774d0ef..f7058fd3c9 100644 --- a/osu.Game/Modes/Objects/Types/IHasRepeats.cs +++ b/osu.Game/Rulesets/Objects/Types/IHasRepeats.cs @@ -1,7 +1,7 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -namespace osu.Game.Modes.Objects.Types +namespace osu.Game.Rulesets.Objects.Types { /// /// A HitObject that spans some length. diff --git a/osu.Game/Modes/Objects/Types/IHasXPosition.cs b/osu.Game/Rulesets/Objects/Types/IHasXPosition.cs similarity index 87% rename from osu.Game/Modes/Objects/Types/IHasXPosition.cs rename to osu.Game/Rulesets/Objects/Types/IHasXPosition.cs index 1f75625e93..b0ad3af7d2 100644 --- a/osu.Game/Modes/Objects/Types/IHasXPosition.cs +++ b/osu.Game/Rulesets/Objects/Types/IHasXPosition.cs @@ -2,7 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -namespace osu.Game.Modes.Objects.Types +namespace osu.Game.Rulesets.Objects.Types { /// /// A HitObject that has a starting X-position. diff --git a/osu.Game/Modes/Objects/Types/IHasYPosition.cs b/osu.Game/Rulesets/Objects/Types/IHasYPosition.cs similarity index 87% rename from osu.Game/Modes/Objects/Types/IHasYPosition.cs rename to osu.Game/Rulesets/Objects/Types/IHasYPosition.cs index f746acb939..222e8f762f 100644 --- a/osu.Game/Modes/Objects/Types/IHasYPosition.cs +++ b/osu.Game/Rulesets/Objects/Types/IHasYPosition.cs @@ -2,7 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -namespace osu.Game.Modes.Objects.Types +namespace osu.Game.Rulesets.Objects.Types { /// /// A HitObject that has a starting Y-position. diff --git a/osu.Game/Modes/Replays/FramedReplayInputHandler.cs b/osu.Game/Rulesets/Replays/FramedReplayInputHandler.cs similarity index 96% rename from osu.Game/Modes/Replays/FramedReplayInputHandler.cs rename to osu.Game/Rulesets/Replays/FramedReplayInputHandler.cs index 0c1e140ce4..60da35fd91 100644 --- a/osu.Game/Modes/Replays/FramedReplayInputHandler.cs +++ b/osu.Game/Rulesets/Replays/FramedReplayInputHandler.cs @@ -12,7 +12,7 @@ using OpenTK.Input; using KeyboardState = osu.Framework.Input.KeyboardState; using MouseState = osu.Framework.Input.MouseState; -namespace osu.Game.Modes.Replays +namespace osu.Game.Rulesets.Replays { /// /// The ReplayHandler will take a replay and handle the propagation of updates to the input stack. diff --git a/osu.Game/Modes/Replays/Replay.cs b/osu.Game/Rulesets/Replays/Replay.cs similarity index 85% rename from osu.Game/Modes/Replays/Replay.cs rename to osu.Game/Rulesets/Replays/Replay.cs index 62f60358e0..8e9d7cdaad 100644 --- a/osu.Game/Modes/Replays/Replay.cs +++ b/osu.Game/Rulesets/Replays/Replay.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; -namespace osu.Game.Modes.Replays +namespace osu.Game.Rulesets.Replays { public class Replay { diff --git a/osu.Game/Modes/Replays/ReplayButtonState.cs b/osu.Game/Rulesets/Replays/ReplayButtonState.cs similarity index 86% rename from osu.Game/Modes/Replays/ReplayButtonState.cs rename to osu.Game/Rulesets/Replays/ReplayButtonState.cs index d49139226c..be55a153cb 100644 --- a/osu.Game/Modes/Replays/ReplayButtonState.cs +++ b/osu.Game/Rulesets/Replays/ReplayButtonState.cs @@ -3,7 +3,7 @@ using System; -namespace osu.Game.Modes.Replays +namespace osu.Game.Rulesets.Replays { [Flags] public enum ReplayButtonState diff --git a/osu.Game/Modes/Replays/ReplayFrame.cs b/osu.Game/Rulesets/Replays/ReplayFrame.cs similarity index 95% rename from osu.Game/Modes/Replays/ReplayFrame.cs rename to osu.Game/Rulesets/Replays/ReplayFrame.cs index 4cd681beaf..31f952abdf 100644 --- a/osu.Game/Modes/Replays/ReplayFrame.cs +++ b/osu.Game/Rulesets/Replays/ReplayFrame.cs @@ -3,7 +3,7 @@ using OpenTK; -namespace osu.Game.Modes.Replays +namespace osu.Game.Rulesets.Replays { public class ReplayFrame { diff --git a/osu.Game/Modes/Ruleset.cs b/osu.Game/Rulesets/Ruleset.cs similarity index 87% rename from osu.Game/Modes/Ruleset.cs rename to osu.Game/Rulesets/Ruleset.cs index cf0fbe5b6a..5e92d25297 100644 --- a/osu.Game/Modes/Ruleset.cs +++ b/osu.Game/Rulesets/Ruleset.cs @@ -3,13 +3,13 @@ using osu.Game.Beatmaps; using osu.Game.Graphics; -using osu.Game.Modes.Mods; -using osu.Game.Modes.UI; +using osu.Game.Rulesets.Mods; +using osu.Game.Rulesets.UI; using osu.Game.Screens.Play; using System.Collections.Generic; -using osu.Game.Modes.Scoring; +using osu.Game.Rulesets.Scoring; -namespace osu.Game.Modes +namespace osu.Game.Rulesets { public abstract class Ruleset { diff --git a/osu.Game/Modes/Scoring/Score.cs b/osu.Game/Rulesets/Scoring/Score.cs similarity index 93% rename from osu.Game/Modes/Scoring/Score.cs rename to osu.Game/Rulesets/Scoring/Score.cs index b0c123f438..cb7831b04a 100644 --- a/osu.Game/Modes/Scoring/Score.cs +++ b/osu.Game/Rulesets/Scoring/Score.cs @@ -5,12 +5,12 @@ using System; using System.Collections.Generic; using Newtonsoft.Json; using osu.Game.Database; -using osu.Game.Modes.Mods; +using osu.Game.Rulesets.Mods; using osu.Game.Users; using System.IO; -using osu.Game.Modes.Replays; +using osu.Game.Rulesets.Replays; -namespace osu.Game.Modes.Scoring +namespace osu.Game.Rulesets.Scoring { public class Score { diff --git a/osu.Game/Modes/Scoring/ScoreProcessor.cs b/osu.Game/Rulesets/Scoring/ScoreProcessor.cs similarity index 92% rename from osu.Game/Modes/Scoring/ScoreProcessor.cs rename to osu.Game/Rulesets/Scoring/ScoreProcessor.cs index ba845b84dc..b2c5d8319e 100644 --- a/osu.Game/Modes/Scoring/ScoreProcessor.cs +++ b/osu.Game/Rulesets/Scoring/ScoreProcessor.cs @@ -5,12 +5,12 @@ using System; using System.Collections.Generic; using osu.Framework.Configuration; using osu.Game.Beatmaps; -using osu.Game.Modes.Judgements; -using osu.Game.Modes.Objects; -using osu.Game.Modes.UI; -using osu.Game.Modes.Objects.Drawables; +using osu.Game.Rulesets.Judgements; +using osu.Game.Rulesets.Objects; +using osu.Game.Rulesets.UI; +using osu.Game.Rulesets.Objects.Drawables; -namespace osu.Game.Modes.Scoring +namespace osu.Game.Rulesets.Scoring { public abstract class ScoreProcessor { @@ -62,7 +62,7 @@ namespace osu.Game.Modes.Scoring } /// - /// Creates a Score applicable to the game mode in which this ScoreProcessor resides. + /// Creates a Score applicable to the ruleset in which this ScoreProcessor resides. /// /// The Score. public virtual Score CreateScore() => new Score @@ -193,4 +193,4 @@ namespace osu.Game.Modes.Scoring /// The judgement that triggered this calculation. protected virtual void OnJudgementChanged(TJudgement judgement) { } } -} \ No newline at end of file +} diff --git a/osu.Game/Modes/Scoring/ScoreRank.cs b/osu.Game/Rulesets/Scoring/ScoreRank.cs similarity index 90% rename from osu.Game/Modes/Scoring/ScoreRank.cs rename to osu.Game/Rulesets/Scoring/ScoreRank.cs index 743f24ecd6..f4a6a1e03c 100644 --- a/osu.Game/Modes/Scoring/ScoreRank.cs +++ b/osu.Game/Rulesets/Scoring/ScoreRank.cs @@ -3,7 +3,7 @@ using System.ComponentModel; -namespace osu.Game.Modes.Scoring +namespace osu.Game.Rulesets.Scoring { public enum ScoreRank { diff --git a/osu.Game/Modes/UI/ComboCounter.cs b/osu.Game/Rulesets/UI/ComboCounter.cs similarity index 96% rename from osu.Game/Modes/UI/ComboCounter.cs rename to osu.Game/Rulesets/UI/ComboCounter.cs index 8c0327fa04..d21059cbdb 100644 --- a/osu.Game/Modes/UI/ComboCounter.cs +++ b/osu.Game/Rulesets/UI/ComboCounter.cs @@ -10,7 +10,7 @@ using osu.Framework.Graphics.Transforms; using osu.Framework.MathUtils; using osu.Game.Graphics.Sprites; -namespace osu.Game.Modes.UI +namespace osu.Game.Rulesets.UI { public abstract class ComboCounter : Container { diff --git a/osu.Game/Modes/UI/ComboResultCounter.cs b/osu.Game/Rulesets/UI/ComboResultCounter.cs similarity index 95% rename from osu.Game/Modes/UI/ComboResultCounter.cs rename to osu.Game/Rulesets/UI/ComboResultCounter.cs index 63009c5351..4b19b2c1ff 100644 --- a/osu.Game/Modes/UI/ComboResultCounter.cs +++ b/osu.Game/Rulesets/UI/ComboResultCounter.cs @@ -7,7 +7,7 @@ using osu.Framework.MathUtils; using osu.Game.Graphics.UserInterface; using System; -namespace osu.Game.Modes.UI +namespace osu.Game.Rulesets.UI { /// /// Used to display combo with a roll-up animation in results screen. diff --git a/osu.Game/Modes/UI/HealthDisplay.cs b/osu.Game/Rulesets/UI/HealthDisplay.cs similarity index 91% rename from osu.Game/Modes/UI/HealthDisplay.cs rename to osu.Game/Rulesets/UI/HealthDisplay.cs index 4c8d7e4ab8..5c6b9d2fe3 100644 --- a/osu.Game/Modes/UI/HealthDisplay.cs +++ b/osu.Game/Rulesets/UI/HealthDisplay.cs @@ -4,7 +4,7 @@ using osu.Framework.Configuration; using osu.Framework.Graphics.Containers; -namespace osu.Game.Modes.UI +namespace osu.Game.Rulesets.UI { public abstract class HealthDisplay : Container { diff --git a/osu.Game/Modes/UI/HitRenderer.cs b/osu.Game/Rulesets/UI/HitRenderer.cs similarity index 94% rename from osu.Game/Modes/UI/HitRenderer.cs rename to osu.Game/Rulesets/UI/HitRenderer.cs index 3e51b2b44f..098a4d5f03 100644 --- a/osu.Game/Modes/UI/HitRenderer.cs +++ b/osu.Game/Rulesets/UI/HitRenderer.cs @@ -5,21 +5,21 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Beatmaps; -using osu.Game.Modes.Judgements; -using osu.Game.Modes.Mods; -using osu.Game.Modes.Objects; -using osu.Game.Modes.Objects.Drawables; +using osu.Game.Rulesets.Judgements; +using osu.Game.Rulesets.Mods; +using osu.Game.Rulesets.Objects; +using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Screens.Play; using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; -using osu.Game.Modes.Replays; -using osu.Game.Modes.Scoring; +using osu.Game.Rulesets.Replays; +using osu.Game.Rulesets.Scoring; using OpenTK; -using osu.Game.Modes.Beatmaps; +using osu.Game.Rulesets.Beatmaps; -namespace osu.Game.Modes.UI +namespace osu.Game.Rulesets.UI { /// /// Base HitRenderer. Doesn't hold objects. diff --git a/osu.Game/Modes/UI/HudOverlay.cs b/osu.Game/Rulesets/UI/HudOverlay.cs similarity index 95% rename from osu.Game/Modes/UI/HudOverlay.cs rename to osu.Game/Rulesets/UI/HudOverlay.cs index 4902baf9b9..d2169aa32f 100644 --- a/osu.Game/Modes/UI/HudOverlay.cs +++ b/osu.Game/Rulesets/UI/HudOverlay.cs @@ -8,13 +8,13 @@ using osu.Framework.Graphics.Containers; using osu.Game.Configuration; using osu.Game.Graphics.UserInterface; using osu.Game.Screens.Play; -using osu.Game.Modes.Scoring; +using osu.Game.Rulesets.Scoring; using osu.Framework.Input; using OpenTK.Input; using osu.Game.Overlays; using osu.Game.Overlays.Notifications; -namespace osu.Game.Modes.UI +namespace osu.Game.Rulesets.UI { public abstract class HudOverlay : Container { diff --git a/osu.Game/Modes/UI/ModIcon.cs b/osu.Game/Rulesets/UI/ModIcon.cs similarity index 94% rename from osu.Game/Modes/UI/ModIcon.cs rename to osu.Game/Rulesets/UI/ModIcon.cs index 1e0aa89a41..8301796c1f 100644 --- a/osu.Game/Modes/UI/ModIcon.cs +++ b/osu.Game/Rulesets/UI/ModIcon.cs @@ -6,7 +6,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Graphics; -namespace osu.Game.Modes.UI +namespace osu.Game.Rulesets.UI { public class ModIcon : Container { diff --git a/osu.Game/Modes/UI/Playfield.cs b/osu.Game/Rulesets/UI/Playfield.cs similarity index 93% rename from osu.Game/Modes/UI/Playfield.cs rename to osu.Game/Rulesets/UI/Playfield.cs index 1e7cf6579c..44d15e42c4 100644 --- a/osu.Game/Modes/UI/Playfield.cs +++ b/osu.Game/Rulesets/UI/Playfield.cs @@ -4,13 +4,13 @@ using System; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Game.Modes.Objects; -using osu.Game.Modes.Objects.Drawables; +using osu.Game.Rulesets.Objects; +using osu.Game.Rulesets.Objects.Drawables; using OpenTK; -using osu.Game.Modes.Judgements; +using osu.Game.Rulesets.Judgements; using osu.Framework.Allocation; -namespace osu.Game.Modes.UI +namespace osu.Game.Rulesets.UI { public abstract class Playfield : Container where TObject : HitObject diff --git a/osu.Game/Modes/UI/StandardComboCounter.cs b/osu.Game/Rulesets/UI/StandardComboCounter.cs similarity index 96% rename from osu.Game/Modes/UI/StandardComboCounter.cs rename to osu.Game/Rulesets/UI/StandardComboCounter.cs index 08bb3add84..ad05c83839 100644 --- a/osu.Game/Modes/UI/StandardComboCounter.cs +++ b/osu.Game/Rulesets/UI/StandardComboCounter.cs @@ -3,7 +3,7 @@ using OpenTK; -namespace osu.Game.Modes.UI +namespace osu.Game.Rulesets.UI { /// /// Uses the 'x' symbol and has a pop-out effect while rolling over. diff --git a/osu.Game/Modes/UI/StandardHealthDisplay.cs b/osu.Game/Rulesets/UI/StandardHealthDisplay.cs similarity index 95% rename from osu.Game/Modes/UI/StandardHealthDisplay.cs rename to osu.Game/Rulesets/UI/StandardHealthDisplay.cs index 12d0f841a2..9294cc3a1a 100644 --- a/osu.Game/Modes/UI/StandardHealthDisplay.cs +++ b/osu.Game/Rulesets/UI/StandardHealthDisplay.cs @@ -8,7 +8,7 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; using osu.Game.Graphics; -namespace osu.Game.Modes.UI +namespace osu.Game.Rulesets.UI { public class StandardHealthDisplay : HealthDisplay, IHasAccentColour { diff --git a/osu.Game/Modes/UI/StandardHudOverlay.cs b/osu.Game/Rulesets/UI/StandardHudOverlay.cs similarity index 96% rename from osu.Game/Modes/UI/StandardHudOverlay.cs rename to osu.Game/Rulesets/UI/StandardHudOverlay.cs index 161a700bef..2e2cb739f5 100644 --- a/osu.Game/Modes/UI/StandardHudOverlay.cs +++ b/osu.Game/Rulesets/UI/StandardHudOverlay.cs @@ -10,7 +10,7 @@ using osu.Game.Graphics; using osu.Game.Graphics.UserInterface; using osu.Game.Screens.Play; -namespace osu.Game.Modes.UI +namespace osu.Game.Rulesets.UI { public class StandardHudOverlay : HudOverlay { diff --git a/osu.Game/Screens/BackgroundScreen.cs b/osu.Game/Screens/BackgroundScreen.cs index fd40141fcb..a9cb93876c 100644 --- a/osu.Game/Screens/BackgroundScreen.cs +++ b/osu.Game/Screens/BackgroundScreen.cs @@ -28,7 +28,7 @@ namespace osu.Game.Screens public override bool Push(Screen screen) { - // When trying to push a non-loaded GameMode, load it asynchronously and re-invoke Push + // When trying to push a non-loaded screen, load it asynchronously and re-invoke Push // once it's done. if (screen.LoadState == LoadState.NotLoaded) { @@ -36,7 +36,7 @@ namespace osu.Game.Screens return true; } - // Make sure the in-progress loading is complete before pushing the GameMode. + // Make sure the in-progress loading is complete before pushing the screen. while (screen.LoadState < LoadState.Loaded) Thread.Sleep(1); diff --git a/osu.Game/Screens/OsuScreen.cs b/osu.Game/Screens/OsuScreen.cs index 3e832b36fa..d0856bfe3e 100644 --- a/osu.Game/Screens/OsuScreen.cs +++ b/osu.Game/Screens/OsuScreen.cs @@ -14,7 +14,7 @@ namespace osu.Game.Screens internal BackgroundScreen Background { get; private set; } /// - /// Override to create a BackgroundMode for the current GameMode. + /// Override to create a BackgroundMode for the current screen. /// Note that the instance created may not be the used instance if it matches the BackgroundMode equality clause. /// protected virtual BackgroundScreen CreateBackground() => null; @@ -99,7 +99,7 @@ namespace osu.Game.Screens if (Background != null && !Background.Equals(nextOsu?.Background)) { if (nextOsu != null) - //We need to use MakeCurrent in case we are jumping up multiple game modes. + //We need to use MakeCurrent in case we are jumping up multiple game screens. nextOsu.Background?.MakeCurrent(); else Background.Exit(); diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index eea6775063..6918cdb3a4 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -14,14 +14,14 @@ using osu.Framework.Screens; using osu.Framework.Timing; using osu.Game.Configuration; using osu.Game.Database; -using osu.Game.Modes; -using osu.Game.Modes.UI; +using osu.Game.Rulesets; +using osu.Game.Rulesets.UI; using osu.Game.Screens.Backgrounds; using osu.Game.Screens.Ranking; using System; using System.Linq; using osu.Framework.Threading; -using osu.Game.Modes.Scoring; +using osu.Game.Rulesets.Scoring; namespace osu.Game.Screens.Play { diff --git a/osu.Game/Screens/Play/ReplayPlayer.cs b/osu.Game/Screens/Play/ReplayPlayer.cs index 4593656a2e..860675b62a 100644 --- a/osu.Game/Screens/Play/ReplayPlayer.cs +++ b/osu.Game/Screens/Play/ReplayPlayer.cs @@ -1,7 +1,7 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Game.Modes.Replays; +using osu.Game.Rulesets.Replays; namespace osu.Game.Screens.Play { diff --git a/osu.Game/Screens/Play/SongProgress.cs b/osu.Game/Screens/Play/SongProgress.cs index 52f3b9e1ae..19212ec2f4 100644 --- a/osu.Game/Screens/Play/SongProgress.cs +++ b/osu.Game/Screens/Play/SongProgress.cs @@ -11,8 +11,8 @@ using osu.Game.Graphics; using osu.Framework.Allocation; using System.Linq; using osu.Framework.Timing; -using osu.Game.Modes.Objects; -using osu.Game.Modes.Objects.Types; +using osu.Game.Rulesets.Objects; +using osu.Game.Rulesets.Objects.Types; namespace osu.Game.Screens.Play { diff --git a/osu.Game/Screens/Ranking/Results.cs b/osu.Game/Screens/Ranking/Results.cs index 37770bea3e..3db070d33c 100644 --- a/osu.Game/Screens/Ranking/Results.cs +++ b/osu.Game/Screens/Ranking/Results.cs @@ -5,7 +5,7 @@ using osu.Framework.Screens; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Graphics.Sprites; -using osu.Game.Modes.Scoring; +using osu.Game.Rulesets.Scoring; using osu.Game.Screens.Backgrounds; using OpenTK; using OpenTK.Graphics; diff --git a/osu.Game/Screens/ScreenWhiteBox.cs b/osu.Game/Screens/ScreenWhiteBox.cs index bebdbb8c2a..dca5e17efa 100644 --- a/osu.Game/Screens/ScreenWhiteBox.cs +++ b/osu.Game/Screens/ScreenWhiteBox.cs @@ -33,7 +33,7 @@ namespace osu.Game.Screens { base.OnEntering(last); - //only show the pop button if we are entered form another gamemode. + //only show the pop button if we are entered form another screen. if (last != null) popButton.Alpha = 1; diff --git a/osu.Game/Screens/Select/BeatmapInfoWedge.cs b/osu.Game/Screens/Select/BeatmapInfoWedge.cs index d15e5a9bb8..c37609acd0 100644 --- a/osu.Game/Screens/Select/BeatmapInfoWedge.cs +++ b/osu.Game/Screens/Select/BeatmapInfoWedge.cs @@ -18,9 +18,9 @@ using osu.Game.Beatmaps.Drawables; using osu.Game.Database; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; -using osu.Game.Modes; -using osu.Game.Modes.Objects; -using osu.Game.Modes.Objects.Types; +using osu.Game.Rulesets; +using osu.Game.Rulesets.Objects; +using osu.Game.Rulesets.Objects.Types; namespace osu.Game.Screens.Select { diff --git a/osu.Game/Screens/Select/Leaderboards/DrawableRank.cs b/osu.Game/Screens/Select/Leaderboards/DrawableRank.cs index 1e9d6dc831..647398db9e 100644 --- a/osu.Game/Screens/Select/Leaderboards/DrawableRank.cs +++ b/osu.Game/Screens/Select/Leaderboards/DrawableRank.cs @@ -7,7 +7,7 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Textures; using osu.Framework.Extensions; -using osu.Game.Modes.Scoring; +using osu.Game.Rulesets.Scoring; namespace osu.Game.Screens.Select.Leaderboards { diff --git a/osu.Game/Screens/Select/Leaderboards/Leaderboard.cs b/osu.Game/Screens/Select/Leaderboards/Leaderboard.cs index 315611a60c..2abf3c3175 100644 --- a/osu.Game/Screens/Select/Leaderboards/Leaderboard.cs +++ b/osu.Game/Screens/Select/Leaderboards/Leaderboard.cs @@ -12,7 +12,7 @@ using osu.Framework.Graphics.Primitives; using System; using osu.Framework.Allocation; using osu.Game.Database; -using osu.Game.Modes.Scoring; +using osu.Game.Rulesets.Scoring; using osu.Game.Online.API; using osu.Game.Online.API.Requests; diff --git a/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs b/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs index 493f351b75..321067d18e 100644 --- a/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs +++ b/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs @@ -10,10 +10,10 @@ using osu.Framework.Graphics.Sprites; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Framework.Extensions.Color4Extensions; -using osu.Game.Modes.Mods; +using osu.Game.Rulesets.Mods; using osu.Game.Users; using osu.Framework; -using osu.Game.Modes.Scoring; +using osu.Game.Rulesets.Scoring; namespace osu.Game.Screens.Select.Leaderboards { diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 05fd0502ab..5096323540 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -72,8 +72,8 @@ - - + + @@ -103,60 +103,60 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + + + + @@ -168,8 +168,8 @@ - - + + @@ -223,7 +223,7 @@ - + @@ -236,16 +236,16 @@ - + - - + + - - + + @@ -362,9 +362,9 @@ - + - + @@ -383,7 +383,7 @@ - + diff --git a/osu.sln b/osu.sln index c200d2e586..317cfe7da4 100644 --- a/osu.sln +++ b/osu.sln @@ -21,13 +21,13 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Desktop.VisualTests", " EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Game.Tests", "osu.Game.Tests\osu.Game.Tests.csproj", "{54377672-20B1-40AF-8087-5CF73BF3953A}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Game.Modes.Osu", "osu.Game.Modes.Osu\osu.Game.Modes.Osu.csproj", "{C92A607B-1FDD-4954-9F92-03FF547D9080}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Game.Rulesets.Osu", "osu.Game.Rulesets.Osu\osu.Game.Rulesets.Osu.csproj", "{C92A607B-1FDD-4954-9F92-03FF547D9080}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Game.Modes.Catch", "osu.Game.Modes.Catch\osu.Game.Modes.Catch.csproj", "{58F6C80C-1253-4A0E-A465-B8C85EBEADF3}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Game.Rulesets.Catch", "osu.Game.Rulesets.Catch\osu.Game.Rulesets.Catch.csproj", "{58F6C80C-1253-4A0E-A465-B8C85EBEADF3}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Game.Modes.Taiko", "osu.Game.Modes.Taiko\osu.Game.Modes.Taiko.csproj", "{F167E17A-7DE6-4AF5-B920-A5112296C695}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Game.Rulesets.Taiko", "osu.Game.Rulesets.Taiko\osu.Game.Rulesets.Taiko.csproj", "{F167E17A-7DE6-4AF5-B920-A5112296C695}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Game.Modes.Mania", "osu.Game.Modes.Mania\osu.Game.Modes.Mania.csproj", "{48F4582B-7687-4621-9CBE-5C24197CB536}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Game.Rulesets.Mania", "osu.Game.Rulesets.Mania\osu.Game.Rulesets.Mania.csproj", "{48F4582B-7687-4621-9CBE-5C24197CB536}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Desktop.Tests", "osu.Desktop.Tests\osu.Desktop.Tests.csproj", "{230AC4F3-7783-49FB-9AEC-B83CDA3B9F3D}" EndProject From 6dc15963e09fdab3b149ac03d9486010f978a1ab Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 18 Apr 2017 16:15:16 +0900 Subject: [PATCH 45/45] Update framework. --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 979fb1ffdf..21a97586f7 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 979fb1ffdfaa08c39ff4f0cdda42e5b313d70534 +Subproject commit 21a97586f7fa8d9aa65b4131824151d88a70b520