mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 20:13:21 +08:00
Code quality improvements (thanks to ItsShamed): Removed #nullable disable, fixed incorrect LocalisableString, removed incorrect dependency injection for OsuColour, fixed nullable dependency for IBeatmap
Removed unnecessary usage of "this." caught by the CI code quality check
This commit is contained in:
parent
24f07633f3
commit
7a907f7207
@ -1,8 +1,6 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
#nullable disable
|
||||
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Extensions.ObjectExtensions;
|
||||
using osu.Game.Beatmaps;
|
||||
@ -19,17 +17,16 @@ namespace osu.Game.Rulesets.Osu.Mods
|
||||
/// </summary>
|
||||
public class OsuModSnapColour : ModSnapColour, IApplicableToBeatmap, IApplicableToDrawableHitObject
|
||||
{
|
||||
[Resolved]
|
||||
private OsuColour colours { get; set; } = new OsuColour();
|
||||
private readonly OsuColour colours = new OsuColour();
|
||||
|
||||
[Resolved(canBeNull: true)]
|
||||
private IBeatmap currentBeatmap { get; set; }
|
||||
[Resolved]
|
||||
private IBeatmap? currentBeatmap { get; set; }
|
||||
|
||||
public void ApplyToBeatmap(IBeatmap beatmap)
|
||||
{
|
||||
//Store a reference to the current beatmap to look up the beat divisor when notes are drawn
|
||||
if (this.currentBeatmap != beatmap)
|
||||
this.currentBeatmap = beatmap;
|
||||
if (currentBeatmap != beatmap)
|
||||
currentBeatmap = beatmap;
|
||||
}
|
||||
|
||||
public void ApplyToDrawableHitObject(DrawableHitObject drawable)
|
||||
|
@ -12,7 +12,7 @@ namespace osu.Game.Rulesets.Mods
|
||||
{
|
||||
public override string Name => "Snap Colour";
|
||||
public override string Acronym => "SC";
|
||||
public override LocalisableString Description => new LocalisableString("Colours hit objects based on the rhythm.");
|
||||
public override LocalisableString Description => "Colours hit objects based on the rhythm.";
|
||||
public override double ScoreMultiplier => 1;
|
||||
public override ModType Type => ModType.Conversion;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user