1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 14:57:52 +08:00

Add a base interface for applicable mods

This commit is contained in:
Dean Herbert 2017-12-31 04:09:51 +09:00
parent d18b6aada9
commit fea4e1ff68
9 changed files with 24 additions and 8 deletions

View File

@ -0,0 +1,10 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
namespace osu.Game.Rulesets.Mods
{
// The base interface for a mod which can be applied in some way.
public interface IApplicableMod
{
}
}

View File

@ -8,8 +8,8 @@ namespace osu.Game.Rulesets.Mods
/// <summary>
/// An interface for mods that make adjustments to the track.
/// </summary>
public interface IApplicableToClock
public interface IApplicableToClock : IApplicableMod
{
void ApplyToClock(IAdjustableClock clock);
}
}
}

View File

@ -8,8 +8,8 @@ namespace osu.Game.Rulesets.Mods
/// <summary>
/// An interface for mods that make general adjustments to difficulty.
/// </summary>
public interface IApplicableToDifficulty
public interface IApplicableToDifficulty : IApplicableMod
{
void ApplyToDifficulty(BeatmapDifficulty difficulty);
}
}
}

View File

@ -9,7 +9,7 @@ namespace osu.Game.Rulesets.Mods
/// <summary>
/// An interface for <see cref="Mod"/>s that can be applied to <see cref="DrawableHitObject"/>s.
/// </summary>
public interface IApplicableToDrawableHitObjects
public interface IApplicableToDrawableHitObjects : IApplicableMod
{
/// <summary>
/// Applies this <see cref="IApplicableToDrawableHitObjects"/> to a list of <see cref="DrawableHitObject"/>s.

View File

@ -8,7 +8,7 @@ namespace osu.Game.Rulesets.Mods
/// <summary>
/// An interface for <see cref="Mod"/>s that can be applied to <see cref="HitObject"/>s.
/// </summary>
public interface IApplicableToHitObject<in TObject>
public interface IApplicableToHitObject<in TObject> : IApplicableMod
where TObject : HitObject
{
/// <summary>

View File

@ -9,7 +9,7 @@ namespace osu.Game.Rulesets.Mods
/// <summary>
/// An interface for <see cref="Mod"/>s that can be applied to <see cref="RulesetContainer"/>s.
/// </summary>
public interface IApplicableToRulesetContainer<TObject>
public interface IApplicableToRulesetContainer<TObject> : IApplicableMod
where TObject : HitObject
{
/// <summary>

View File

@ -8,7 +8,7 @@ namespace osu.Game.Rulesets.Mods
/// <summary>
/// An interface for mods that make general adjustments to score processor.
/// </summary>
public interface IApplicableToScoreProcessor
public interface IApplicableToScoreProcessor : IApplicableMod
{
void ApplyToScoreProcessor(ScoreProcessor scoreProcessor);
}

View File

@ -41,6 +41,11 @@ namespace osu.Game.Rulesets.Mods
/// </summary>
public abstract double ScoreMultiplier { get; }
/// <summary>
/// Returns true if this mod is implemented (and playable).
/// </summary>
public virtual bool HasImplementation => this is IApplicableMod;
/// <summary>
/// Returns if this mod is ranked.
/// </summary>

View File

@ -310,6 +310,7 @@
<Compile Include="Overlays\Profile\Sections\Ranks\DrawableTotalScore.cs" />
<Compile Include="Overlays\Profile\Sections\Ranks\ScoreModsContainer.cs" />
<Compile Include="Overlays\Settings\Sections\Maintenance\DeleteAllBeatmapsDialog.cs" />
<Compile Include="Rulesets\Mods\IApplicableMod.cs" />
<Compile Include="Rulesets\Mods\IApplicableToDrawableHitObject.cs" />
<Compile Include="Screens\Select\ImportFromStablePopup.cs" />
<Compile Include="Overlays\Settings\SettingsButton.cs" />