-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1428 from andy840119/clean-up-the-fucking-code
Clean some bad code.
- Loading branch information
Showing
52 changed files
with
134 additions
and
156 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 0 additions & 2 deletions
2
osu.Game.Rulesets.Karaoke.Tests/Editor/KaraokeEditorScreenTestScene.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
// Copyright (c) andy840119 <[email protected]>. Licensed under the GPL Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
#nullable disable | ||
|
||
using System; | ||
using osu.Framework.Allocation; | ||
using osu.Framework.Graphics; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
// Copyright (c) andy840119 <[email protected]>. Licensed under the GPL Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
#nullable disable | ||
|
||
using NUnit.Framework; | ||
using osu.Game.Beatmaps; | ||
using osu.Game.Rulesets.Karaoke.Tests.Beatmaps; | ||
|
2 changes: 0 additions & 2 deletions
2
osu.Game.Rulesets.Karaoke.Tests/Editor/TestSceneEditorMenuBar.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
// Copyright (c) andy840119 <[email protected]>. Licensed under the GPL Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
#nullable disable | ||
|
||
using NUnit.Framework; | ||
using osu.Framework.Allocation; | ||
using osu.Framework.Bindables; | ||
|
2 changes: 0 additions & 2 deletions
2
osu.Game.Rulesets.Karaoke.Tests/Editor/TestSceneGeneratorConfigDialog.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
// Copyright (c) andy840119 <[email protected]>. Licensed under the GPL Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
#nullable disable | ||
|
||
using System; | ||
using NUnit.Framework; | ||
using osu.Framework.Allocation; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
// Copyright (c) andy840119 <[email protected]>. Licensed under the GPL Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
#nullable disable | ||
|
||
using System.Collections.Generic; | ||
using NUnit.Framework; | ||
using osu.Framework.Graphics; | ||
using osu.Framework.Graphics.Sprites; | ||
using osu.Game.Rulesets.Edit; | ||
using osu.Game.Rulesets.Edit.Checks.Components; | ||
using osu.Game.Rulesets.Karaoke.Edit.Checks.Components; | ||
using osu.Game.Rulesets.Karaoke.Edit.Components.Cursor; | ||
|
@@ -18,7 +17,7 @@ namespace osu.Game.Rulesets.Karaoke.Tests.Editor | |
[TestFixture] | ||
public class TestSceneInvalidLyricToolTip : OsuTestScene | ||
{ | ||
private InvalidLyricToolTip toolTip; | ||
private InvalidLyricToolTip toolTip = null!; | ||
|
||
[SetUp] | ||
public void SetUp() => Schedule(() => | ||
|
@@ -101,7 +100,7 @@ public void TestRubyTagInvalidLyric() | |
{ | ||
StartIndex = 2, | ||
EndIndex = 3, | ||
Text = null, | ||
Text = string.Empty, | ||
} | ||
} | ||
} | ||
|
@@ -153,7 +152,7 @@ public void TestRomajiTagInvalidLyric() | |
{ | ||
StartIndex = 2, | ||
EndIndex = 3, | ||
Text = null, | ||
Text = string.Empty, | ||
} | ||
} | ||
} | ||
|
@@ -197,9 +196,9 @@ public void TestTimeTagInvalidLyric() | |
} | ||
})); | ||
|
||
setTooltip("missing start time-tag", new TestTimeTagIssue(null, true)); | ||
setTooltip("missing end time-tag", new TestTimeTagIssue(null, false, true)); | ||
setTooltip("missing start and end time-tag", new TestTimeTagIssue(null, true, true)); | ||
setTooltip("missing start time-tag", new TestTimeTagIssue(new Dictionary<TimeTagInvalid, TimeTag[]>(), true)); | ||
setTooltip("missing end time-tag", new TestTimeTagIssue(new Dictionary<TimeTagInvalid, TimeTag[]>(), false, true)); | ||
setTooltip("missing start and end time-tag", new TestTimeTagIssue(new Dictionary<TimeTagInvalid, TimeTag[]>(), true, true)); | ||
} | ||
|
||
[Test] | ||
|
@@ -281,34 +280,54 @@ private void setTooltip(string testName, params Issue[] issues) | |
}); | ||
} | ||
|
||
internal class Check : ICheck | ||
{ | ||
public IEnumerable<Issue> Run(BeatmapVerifierContext context) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
|
||
public CheckMetadata Metadata { get; } = null!; | ||
|
||
public IEnumerable<IssueTemplate> PossibleTemplates { get; } = null!; | ||
} | ||
|
||
internal class TestIssueTemplate : IssueTemplate | ||
{ | ||
public TestIssueTemplate() | ||
: base(new Check(), IssueType.Error, string.Empty) | ||
{ | ||
} | ||
} | ||
|
||
internal class TestLyricTimeIssue : LyricTimeIssue | ||
{ | ||
public TestLyricTimeIssue(TimeInvalid[] invalidLyricTime) | ||
: base(new Lyric(), null, invalidLyricTime) | ||
: base(new Lyric(), new TestIssueTemplate(), invalidLyricTime) | ||
{ | ||
} | ||
} | ||
|
||
internal class TestRubyTagIssue : RubyTagIssue | ||
{ | ||
public TestRubyTagIssue(Dictionary<RubyTagInvalid, RubyTag[]> invalidRubyTags) | ||
: base(new Lyric(), null, invalidRubyTags) | ||
: base(new Lyric(), new TestIssueTemplate(), invalidRubyTags) | ||
{ | ||
} | ||
} | ||
|
||
internal class TestRomajiTagIssue : RomajiTagIssue | ||
{ | ||
public TestRomajiTagIssue(Dictionary<RomajiTagInvalid, RomajiTag[]> invalidRomajiTags) | ||
: base(new Lyric(), null, invalidRomajiTags) | ||
: base(new Lyric(), new TestIssueTemplate(), invalidRomajiTags) | ||
{ | ||
} | ||
} | ||
|
||
internal class TestTimeTagIssue : TimeTagIssue | ||
{ | ||
public TestTimeTagIssue(Dictionary<TimeTagInvalid, TimeTag[]> invalidTimeTags, bool missingStartTimeTag = false, bool missingEndTimeTag = false) | ||
: base(new Lyric(), null, invalidTimeTags, missingStartTimeTag, missingEndTimeTag) | ||
: base(new Lyric(), new TestIssueTemplate(), invalidTimeTags, missingStartTimeTag, missingEndTimeTag) | ||
{ | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
// Copyright (c) andy840119 <[email protected]>. Licensed under the GPL Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
#nullable disable | ||
|
||
using osu.Framework.Allocation; | ||
using osu.Framework.Graphics; | ||
using osu.Framework.Graphics.Containers; | ||
|
@@ -31,8 +29,8 @@ public class TestSceneKaraokeEditor : ScreenTestScene<KaraokeEditor> | |
|
||
protected override KaraokeEditor CreateScreen() => new(); | ||
|
||
private DialogOverlay dialogOverlay; | ||
private LyricCheckerManager lyricCheckerManager; | ||
private DialogOverlay dialogOverlay = null!; | ||
private LyricCheckerManager lyricCheckerManager = null!; | ||
|
||
public TestSceneKaraokeEditor() | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
// Copyright (c) andy840119 <[email protected]>. Licensed under the GPL Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
#nullable disable | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using NUnit.Framework; | ||
|
@@ -19,7 +17,7 @@ namespace osu.Game.Rulesets.Karaoke.Tests.Editor | |
public class TestSceneLayoutToolTip : OsuTestScene | ||
{ | ||
private readonly ISkin skin = new DefaultKaraokeSkin(null); | ||
private LayoutToolTip toolTip; | ||
private LayoutToolTip toolTip = null!; | ||
|
||
[SetUp] | ||
public void SetUp() => Schedule(() => | ||
|
@@ -60,7 +58,7 @@ private void setTooltip(string testName, Action<Lyric> callBack) | |
{ | ||
Text = "karaoke!" | ||
}; | ||
callBack?.Invoke(singer); | ||
callBack.Invoke(singer); | ||
toolTip.SetContent(singer); | ||
}); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
// Copyright (c) andy840119 <[email protected]>. Licensed under the GPL Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
#nullable disable | ||
|
||
using System; | ||
using System.Linq; | ||
using NUnit.Framework; | ||
|
@@ -31,9 +29,9 @@ public class TestSceneLyricEditorScreen : KaraokeEditorScreenTestScene<LyricEdit | |
|
||
protected override LyricEditorScreen CreateEditorScreen() => new(); | ||
|
||
private DialogOverlay dialogOverlay; | ||
private LyricsProvider lyricsProvider; | ||
private LyricCheckerManager lyricCheckManager; | ||
private DialogOverlay dialogOverlay = null!; | ||
private LyricsProvider lyricsProvider = null!; | ||
private LyricCheckerManager lyricCheckManager = null!; | ||
|
||
[BackgroundDependencyLoader] | ||
private void load() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
// Copyright (c) andy840119 <[email protected]>. Licensed under the GPL Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
#nullable disable | ||
|
||
using System; | ||
using System.IO; | ||
using System.Linq; | ||
|
@@ -39,7 +37,7 @@ protected override TestLyricImporter CreateScreen() | |
return new TestLyricImporter(new FileInfo(temp)); | ||
} | ||
|
||
private DialogOverlay dialogOverlay; | ||
private DialogOverlay dialogOverlay = null!; | ||
|
||
public TestSceneLyricImporter() | ||
{ | ||
|
2 changes: 0 additions & 2 deletions
2
osu.Game.Rulesets.Karaoke.Tests/Editor/TestSceneSetupScreen.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
// Copyright (c) andy840119 <[email protected]>. Licensed under the GPL Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
#nullable disable | ||
|
||
using NUnit.Framework; | ||
using osu.Framework.Allocation; | ||
using osu.Framework.Graphics.Containers; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
// Copyright (c) andy840119 <[email protected]>. Licensed under the GPL Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
#nullable disable | ||
|
||
using System.Collections.Generic; | ||
using NUnit.Framework; | ||
using osu.Framework.Allocation; | ||
|
@@ -64,9 +62,9 @@ protected override KaraokeBeatmap CreateBeatmap() | |
return karaokeBeatmap; | ||
} | ||
|
||
private DialogOverlay dialogOverlay; | ||
private LyricsProvider lyricsProvider; | ||
private KaraokeBeatmapResourcesProvider karaokeBeatmapResourcesProvider; | ||
private DialogOverlay dialogOverlay = null!; | ||
private LyricsProvider lyricsProvider = null!; | ||
private KaraokeBeatmapResourcesProvider karaokeBeatmapResourcesProvider = null!; | ||
|
||
[BackgroundDependencyLoader] | ||
private void load() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
// Copyright (c) andy840119 <[email protected]>. Licensed under the GPL Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
#nullable disable | ||
|
||
using NUnit.Framework; | ||
using osu.Framework.Graphics; | ||
using osu.Framework.Graphics.Sprites; | ||
|
@@ -15,7 +13,7 @@ namespace osu.Game.Rulesets.Karaoke.Tests.Editor | |
[TestFixture] | ||
public class TestSceneTimeTagTooltip : OsuTestScene | ||
{ | ||
private TimeTagTooltip toolTip; | ||
private TimeTagTooltip toolTip = null!; | ||
|
||
[SetUp] | ||
public void SetUp() => Schedule(() => | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
// Copyright (c) andy840119 <[email protected]>. Licensed under the GPL Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
#nullable disable | ||
|
||
using System.Collections.Generic; | ||
using System.Globalization; | ||
using NUnit.Framework; | ||
|
@@ -37,8 +35,8 @@ protected override KaraokeBeatmap CreateBeatmap() | |
return karaokeBeatmap; | ||
} | ||
|
||
private DialogOverlay dialogOverlay; | ||
private LyricsProvider lyricsProvider; | ||
private DialogOverlay dialogOverlay = null!; | ||
private LyricsProvider lyricsProvider = null!; | ||
|
||
[BackgroundDependencyLoader] | ||
private void load() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.