mirror of
https://github.com/osukey/osukey.git
synced 2025-08-03 14:46:38 +09:00
Move more logic to base EditorTestScene
This commit is contained in:
@ -14,7 +14,11 @@ namespace osu.Game.Tests.Visual
|
||||
{
|
||||
public abstract class EditorTestScene : ScreenTestScene
|
||||
{
|
||||
protected Editor Editor { get; private set; }
|
||||
protected EditorBeatmap EditorBeatmap;
|
||||
|
||||
protected TestEditor Editor { get; private set; }
|
||||
|
||||
protected EditorClock EditorClock { get; private set; }
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
@ -29,6 +33,8 @@ namespace osu.Game.Tests.Visual
|
||||
AddStep("load editor", () => LoadScreen(Editor = CreateEditor()));
|
||||
AddUntilStep("wait for editor to load", () => Editor.ChildrenOfType<HitObjectComposer>().FirstOrDefault()?.IsLoaded == true
|
||||
&& Editor.ChildrenOfType<TimelineArea>().FirstOrDefault()?.IsLoaded == true);
|
||||
AddStep("get beatmap", () => EditorBeatmap = Editor.ChildrenOfType<EditorBeatmap>().Single());
|
||||
AddStep("get clock", () => EditorClock = Editor.ChildrenOfType<EditorClock>().Single());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -39,6 +45,23 @@ namespace osu.Game.Tests.Visual
|
||||
|
||||
protected sealed override Ruleset CreateRuleset() => CreateEditorRuleset();
|
||||
|
||||
protected virtual Editor CreateEditor() => new Editor();
|
||||
protected virtual TestEditor CreateEditor() => new TestEditor();
|
||||
|
||||
protected class TestEditor : Editor
|
||||
{
|
||||
public new void Undo() => base.Undo();
|
||||
|
||||
public new void Redo() => base.Redo();
|
||||
|
||||
public new void Save() => base.Save();
|
||||
|
||||
public new void Cut() => base.Cut();
|
||||
|
||||
public new void Copy() => base.Copy();
|
||||
|
||||
public new void Paste() => base.Paste();
|
||||
|
||||
public new bool HasUnsavedChanges => base.HasUnsavedChanges;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user