mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 23:24:04 +09:00
Remove unnecessary base class
This commit is contained in:
@ -1,6 +1,8 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using System.Linq;
|
||||||
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Rulesets.Mods;
|
using osu.Game.Rulesets.Mods;
|
||||||
using osu.Game.Rulesets.Osu.Objects;
|
using osu.Game.Rulesets.Osu.Objects;
|
||||||
using osu.Game.Rulesets.Osu.Objects.Drawables;
|
using osu.Game.Rulesets.Osu.Objects.Drawables;
|
||||||
@ -9,30 +11,29 @@ using osu.Game.Rulesets.UI;
|
|||||||
|
|
||||||
namespace osu.Game.Rulesets.Osu.Mods
|
namespace osu.Game.Rulesets.Osu.Mods
|
||||||
{
|
{
|
||||||
public class OsuModBlinds : ModBlinds<OsuHitObject>
|
public class OsuModBlinds : Mod, IApplicableToRulesetContainer<OsuHitObject>, IApplicableToScoreProcessor
|
||||||
{
|
{
|
||||||
|
public override string Name => "Blinds";
|
||||||
|
public override string Acronym => "BL";
|
||||||
|
public override FontAwesome Icon => FontAwesome.fa_adjust;
|
||||||
|
public override ModType Type => ModType.DifficultyIncrease;
|
||||||
|
public override string Description => "Play with blinds on your screen.";
|
||||||
|
public override bool Ranked => false;
|
||||||
|
|
||||||
public override double ScoreMultiplier => 1.12;
|
public override double ScoreMultiplier => 1.12;
|
||||||
private DrawableOsuBlinds flashlight;
|
private DrawableOsuBlinds flashlight;
|
||||||
|
|
||||||
public override void ApplyToRulesetContainer(RulesetContainer<OsuHitObject> rulesetContainer)
|
public void ApplyToRulesetContainer(RulesetContainer<OsuHitObject> rulesetContainer)
|
||||||
{
|
{
|
||||||
bool hasEasy = false;
|
bool hasEasy = rulesetContainer.ActiveMods.Any(m => m is ModEasy);
|
||||||
bool hasHardrock = false;
|
bool hasHardrock = rulesetContainer.ActiveMods.Any(m => m is ModHardRock);
|
||||||
foreach (var mod in rulesetContainer.ActiveMods)
|
|
||||||
{
|
|
||||||
if (mod is ModEasy)
|
|
||||||
hasEasy = true;
|
|
||||||
if (mod is ModHardRock)
|
|
||||||
hasHardrock = true;
|
|
||||||
}
|
|
||||||
rulesetContainer.Overlays.Add(flashlight = new DrawableOsuBlinds(rulesetContainer.Playfield.HitObjectContainer, hasEasy, hasHardrock, rulesetContainer.Beatmap));
|
rulesetContainer.Overlays.Add(flashlight = new DrawableOsuBlinds(rulesetContainer.Playfield.HitObjectContainer, hasEasy, hasHardrock, rulesetContainer.Beatmap));
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void ApplyToScoreProcessor(ScoreProcessor scoreProcessor)
|
public void ApplyToScoreProcessor(ScoreProcessor scoreProcessor)
|
||||||
{
|
{
|
||||||
scoreProcessor.Health.ValueChanged += val => {
|
scoreProcessor.Health.ValueChanged += val => { flashlight.AnimateTarget((float)val); };
|
||||||
flashlight.AnimateTarget((float)val);
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,24 +0,0 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
||||||
|
|
||||||
using osu.Game.Graphics;
|
|
||||||
using osu.Game.Rulesets.Objects;
|
|
||||||
using osu.Game.Rulesets.Scoring;
|
|
||||||
using osu.Game.Rulesets.UI;
|
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Mods
|
|
||||||
{
|
|
||||||
public abstract class ModBlinds<T> : Mod, IApplicableToRulesetContainer<T>, IApplicableToScoreProcessor
|
|
||||||
where T : HitObject
|
|
||||||
{
|
|
||||||
public override string Name => "Blinds";
|
|
||||||
public override string Acronym => "BL";
|
|
||||||
public override FontAwesome Icon => FontAwesome.fa_adjust;
|
|
||||||
public override ModType Type => ModType.DifficultyIncrease;
|
|
||||||
public override string Description => "Play with blinds on your screen.";
|
|
||||||
public override bool Ranked => false;
|
|
||||||
|
|
||||||
public abstract void ApplyToRulesetContainer(RulesetContainer<T> rulesetContainer);
|
|
||||||
public abstract void ApplyToScoreProcessor(ScoreProcessor scoreProcessor);
|
|
||||||
}
|
|
||||||
}
|
|
Reference in New Issue
Block a user