1
0
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:
John 2023-05-12 22:13:39 -07:00
parent 24f07633f3
commit 7a907f7207
2 changed files with 6 additions and 9 deletions

View File

@ -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)

View File

@ -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;
}