1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 10:12:54 +08:00

Enforce using get-only auto property where possible (#7566)

Enforce using get-only auto property where possible
This commit is contained in:
Dean Herbert 2020-01-22 16:38:36 +09:00 committed by GitHub
commit a28934f9f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 15 additions and 18 deletions

View File

@ -10,8 +10,8 @@ namespace osu.Game.Tournament.Screens.Ladder.Components
{
public class ProgressionPath : Path
{
public DrawableTournamentMatch Source { get; private set; }
public DrawableTournamentMatch Destination { get; private set; }
public DrawableTournamentMatch Source { get; }
public DrawableTournamentMatch Destination { get; }
public ProgressionPath(DrawableTournamentMatch source, DrawableTournamentMatch destination)
{

View File

@ -19,6 +19,6 @@ namespace osu.Game.Audio
public IEnumerable<string> LookupNames => new[] { sampleName };
public int Volume { get; set; } = 100;
public int Volume { get; } = 100;
}
}

View File

@ -24,7 +24,7 @@ namespace osu.Game.Graphics.UserInterface
/// <summary>
/// Length of debounce for hover sound playback, in milliseconds. Default is 50ms.
/// </summary>
public double HoverDebounceTime { get; set; } = 50;
public double HoverDebounceTime { get; } = 50;
protected readonly HoverSampleSet SampleSet;

View File

@ -16,11 +16,7 @@ namespace osu.Game.Graphics.UserInterface
/// <summary>
/// How many leading zeroes the counter has.
/// </summary>
public uint LeadingZeroes
{
get;
protected set;
}
public uint LeadingZeroes { get; }
/// <summary>
/// Displays score.

View File

@ -92,6 +92,6 @@ namespace osu.Game.Screens.Ranking
protected override void OnDeactivated() => colouredPart.FadeColour(inactiveColour, 200, Easing.OutQuint);
public string TooltipText { get; private set; }
public string TooltipText { get; }
}
}

View File

@ -363,7 +363,7 @@ namespace osu.Game.Screens.Select
public class InfoLabel : Container, IHasTooltip
{
public string TooltipText { get; private set; }
public string TooltipText { get; }
public InfoLabel(BeatmapStatistic statistic)
{

View File

@ -14,7 +14,7 @@ namespace osu.Game.Storyboards.Drawables
{
public class DrawableStoryboard : Container<DrawableStoryboardLayer>
{
public Storyboard Storyboard { get; private set; }
public Storyboard Storyboard { get; }
protected override Container<DrawableStoryboardLayer> Content { get; }

View File

@ -15,7 +15,7 @@ namespace osu.Game.Storyboards.Drawables
{
public class DrawableStoryboardAnimation : TextureAnimation, IFlippable, IVectorScalable
{
public StoryboardAnimation Animation { get; private set; }
public StoryboardAnimation Animation { get; }
private bool flipH;

View File

@ -10,7 +10,7 @@ namespace osu.Game.Storyboards.Drawables
{
public class DrawableStoryboardLayer : LifetimeManagementContainer
{
public StoryboardLayer Layer { get; private set; }
public StoryboardLayer Layer { get; }
public bool Enabled;
public override bool IsPresent => Enabled && base.IsPresent;

View File

@ -15,7 +15,7 @@ namespace osu.Game.Storyboards.Drawables
{
public class DrawableStoryboardSprite : Sprite, IFlippable, IVectorScalable
{
public StoryboardSprite Sprite { get; private set; }
public StoryboardSprite Sprite { get; }
private bool flipH;

View File

@ -16,7 +16,7 @@ namespace osu.Game.Storyboards
private readonly List<CommandLoop> loops = new List<CommandLoop>();
private readonly List<CommandTrigger> triggers = new List<CommandTrigger>();
public string Path { get; set; }
public string Path { get; }
public bool IsDrawable => HasCommands;
public Anchor Origin;

View File

@ -19,8 +19,8 @@
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=AssignedValueIsNeverUsed/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=AssignmentIsFullyDiscarded/@EntryIndexedValue">DO_NOT_SHOW</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=AssignNullToNotNullAttribute/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=AutoPropertyCanBeMadeGetOnly_002EGlobal/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=AutoPropertyCanBeMadeGetOnly_002ELocal/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=AutoPropertyCanBeMadeGetOnly_002EGlobal/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=AutoPropertyCanBeMadeGetOnly_002ELocal/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=BadAttributeBracketsSpaces/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=BadBracesSpaces/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=BadChildStatementIndent/@EntryIndexedValue">WARNING</s:String>
@ -765,6 +765,7 @@ See the LICENCE file in the repository root for full licence text.&#xD;
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/UserRules/=NAMESPACE_005FALIAS/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/UserRules/=XAML_005FFIELD/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/UserRules/=XAML_005FRESOURCE/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /&gt;</s:String>
<s:String x:Key="/Default/CustomTools/CustomToolsData/@EntryValue"></s:String>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpAttributeForSingleLineMethodUpgrade/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpKeepExistingMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpPlaceEmbeddedOnSameLineMigration/@EntryIndexedValue">True</s:Boolean>