-
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 #2309 from andy840119/use-better-way-to-provide-st…
…age-command Use better way to provide stage command.
- Loading branch information
Showing
7 changed files
with
48 additions
and
30 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
14 changes: 11 additions & 3 deletions
14
osu.Game.Rulesets.Karaoke/Stages/Drawables/StageElementRunner.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,18 +1,26 @@ | ||
// Copyright (c) andy840119 <[email protected]>. Licensed under the GPL Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
using System.Collections.Generic; | ||
using osu.Framework.Graphics.Containers; | ||
using osu.Game.Rulesets.Karaoke.Stages.Infos; | ||
using osu.Game.Rulesets.Mods; | ||
|
||
namespace osu.Game.Rulesets.Karaoke.Stages.Drawables; | ||
|
||
public class StageElementRunner : IStageElementRunner | ||
public class StageElementRunner : StageRunner, IStageElementRunner | ||
{ | ||
private IStageElementProvider? elementProvider; | ||
private Container? elementContainer; | ||
|
||
public void UpdateCommandGenerator(IStageElementProvider provider) | ||
public override void OnStageInfoChanged(StageInfo stageInfo, bool scorable, IReadOnlyList<Mod> mods) | ||
{ | ||
elementProvider = stageInfo.CreateStageElementProvider(scorable); | ||
applyTransforms(); | ||
} | ||
|
||
public override void TriggerUpdateCommand() | ||
{ | ||
elementProvider = provider; | ||
applyTransforms(); | ||
} | ||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Copyright (c) andy840119 <[email protected]>. Licensed under the GPL Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
using System.Collections.Generic; | ||
using osu.Game.Rulesets.Karaoke.Stages.Infos; | ||
using osu.Game.Rulesets.Mods; | ||
|
||
namespace osu.Game.Rulesets.Karaoke.Stages.Drawables; | ||
|
||
public abstract partial class StageRunner | ||
{ | ||
public abstract void OnStageInfoChanged(StageInfo stageInfo, bool scorable, IReadOnlyList<Mod> mods); | ||
|
||
public abstract void TriggerUpdateCommand(); | ||
} |
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