mirror of
https://github.com/ppy/osu.git
synced 2025-01-15 09:22:54 +08:00
Remove all unnecessary parenthesis where object initialisers are used
Enforces at CI.
This commit is contained in:
parent
80f88cf5bb
commit
de46f3ab07
@ -198,7 +198,7 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
AutoSizeAxes = Axes.Both;
|
AutoSizeAxes = Axes.Both;
|
||||||
Direction = FillDirection.Horizontal;
|
Direction = FillDirection.Horizontal;
|
||||||
Add(new OsuSpriteText { Text = header + @": ", TextSize = text_size });
|
Add(new OsuSpriteText { Text = header + @": ", TextSize = text_size });
|
||||||
Add(valueText = new OsuSpriteText() { TextSize = text_size });
|
Add(valueText = new OsuSpriteText { TextSize = text_size });
|
||||||
Margin = new MarginPadding(margin);
|
Margin = new MarginPadding(margin);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,7 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
MaxCombo = 123,
|
MaxCombo = 123,
|
||||||
Rank = ScoreRank.A,
|
Rank = ScoreRank.A,
|
||||||
Date = DateTimeOffset.Now,
|
Date = DateTimeOffset.Now,
|
||||||
Statistics = new Dictionary<string, dynamic>()
|
Statistics = new Dictionary<string, dynamic>
|
||||||
{
|
{
|
||||||
{ "300", 50 },
|
{ "300", 50 },
|
||||||
{ "100", 20 },
|
{ "100", 20 },
|
||||||
|
@ -186,7 +186,7 @@ namespace osu.Desktop.Overlays
|
|||||||
{
|
{
|
||||||
private OsuGame game;
|
private OsuGame game;
|
||||||
|
|
||||||
protected override Notification CreateCompletionNotification() => new ProgressCompletionNotification()
|
protected override Notification CreateCompletionNotification() => new ProgressCompletionNotification
|
||||||
{
|
{
|
||||||
Text = @"Update ready to install. Click to restart!",
|
Text = @"Update ready to install. Click to restart!",
|
||||||
Activated = () =>
|
Activated = () =>
|
||||||
|
@ -91,7 +91,7 @@ namespace osu.Game.Beatmaps.ControlPoints
|
|||||||
if (time < list[0].Time)
|
if (time < list[0].Time)
|
||||||
return prePoint ?? new T();
|
return prePoint ?? new T();
|
||||||
|
|
||||||
int index = list.BinarySearch(new T() { Time = time });
|
int index = list.BinarySearch(new T { Time = time });
|
||||||
|
|
||||||
// Check if we've found an exact match (t == time)
|
// Check if we've found an exact match (t == time)
|
||||||
if (index >= 0)
|
if (index >= 0)
|
||||||
|
@ -114,7 +114,7 @@ namespace osu.Game.Graphics.Containers
|
|||||||
|
|
||||||
public SectionsContainer()
|
public SectionsContainer()
|
||||||
{
|
{
|
||||||
Add(ScrollContainer = new ScrollContainer()
|
Add(ScrollContainer = new ScrollContainer
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Masking = false,
|
Masking = false,
|
||||||
|
@ -37,7 +37,7 @@ namespace osu.Game.Overlays.Direct
|
|||||||
{
|
{
|
||||||
DisplayStyleControl.Dropdown.AccentColour = colours.BlueDark;
|
DisplayStyleControl.Dropdown.AccentColour = colours.BlueDark;
|
||||||
|
|
||||||
Ruleset.BindTo(game?.Ruleset ?? new Bindable<RulesetInfo>() { Value = rulesets.GetRuleset(0) });
|
Ruleset.BindTo(game?.Ruleset ?? new Bindable<RulesetInfo> { Value = rulesets.GetRuleset(0) });
|
||||||
foreach (var r in rulesets.AllRulesets)
|
foreach (var r in rulesets.AllRulesets)
|
||||||
{
|
{
|
||||||
modeButtons.Add(new RulesetToggleButton(Ruleset, r));
|
modeButtons.Add(new RulesetToggleButton(Ruleset, r));
|
||||||
|
@ -90,7 +90,7 @@ namespace osu.Game.Overlays.Notifications
|
|||||||
|
|
||||||
private ProgressNotificationState state;
|
private ProgressNotificationState state;
|
||||||
|
|
||||||
protected virtual Notification CreateCompletionNotification() => new ProgressCompletionNotification()
|
protected virtual Notification CreateCompletionNotification() => new ProgressCompletionNotification
|
||||||
{
|
{
|
||||||
Activated = CompletionClickAction,
|
Activated = CompletionClickAction,
|
||||||
Text = $"Task \"{Text}\" has completed!"
|
Text = $"Task \"{Text}\" has completed!"
|
||||||
|
@ -29,7 +29,7 @@ namespace osu.Game.Overlays.Settings
|
|||||||
if (text == null)
|
if (text == null)
|
||||||
{
|
{
|
||||||
// construct lazily for cases where the label is not needed (may be provided by the Control).
|
// construct lazily for cases where the label is not needed (may be provided by the Control).
|
||||||
Add(text = new OsuSpriteText() { Depth = 1 });
|
Add(text = new OsuSpriteText { Depth = 1 });
|
||||||
}
|
}
|
||||||
|
|
||||||
text.Text = value;
|
text.Text = value;
|
||||||
|
@ -17,7 +17,7 @@ namespace osu.Game.Overlays.Settings
|
|||||||
where T : struct, IEquatable<T>
|
where T : struct, IEquatable<T>
|
||||||
where U : SliderBar<T>, new()
|
where U : SliderBar<T>, new()
|
||||||
{
|
{
|
||||||
protected override Drawable CreateControl() => new U()
|
protected override Drawable CreateControl() => new U
|
||||||
{
|
{
|
||||||
Margin = new MarginPadding { Top = 5, Bottom = 5 },
|
Margin = new MarginPadding { Top = 5, Bottom = 5 },
|
||||||
RelativeSizeAxes = Axes.X
|
RelativeSizeAxes = Axes.X
|
||||||
|
@ -16,7 +16,7 @@ namespace osu.Game.Screens.Play.ReplaySettings
|
|||||||
{
|
{
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
new ReplaySliderBar<double>()
|
new ReplaySliderBar<double>
|
||||||
{
|
{
|
||||||
LabelText = "Playback speed",
|
LabelText = "Playback speed",
|
||||||
Bindable = config.GetBindable<double>(OsuSetting.PlaybackSpeed)
|
Bindable = config.GetBindable<double>(OsuSetting.PlaybackSpeed)
|
||||||
|
@ -13,7 +13,7 @@ namespace osu.Game.Screens.Play.ReplaySettings
|
|||||||
public class ReplaySliderBar<T> : SettingsSlider<T>
|
public class ReplaySliderBar<T> : SettingsSlider<T>
|
||||||
where T : struct, IEquatable<T>
|
where T : struct, IEquatable<T>
|
||||||
{
|
{
|
||||||
protected override Drawable CreateControl() => new Sliderbar()
|
protected override Drawable CreateControl() => new Sliderbar
|
||||||
{
|
{
|
||||||
Margin = new MarginPadding { Top = 5, Bottom = 5 },
|
Margin = new MarginPadding { Top = 5, Bottom = 5 },
|
||||||
RelativeSizeAxes = Axes.X
|
RelativeSizeAxes = Axes.X
|
||||||
|
@ -160,7 +160,7 @@ namespace osu.Game.Screens.Select
|
|||||||
Colour = Color4.Black,
|
Colour = Color4.Black,
|
||||||
Alpha = 0.5f,
|
Alpha = 0.5f,
|
||||||
},
|
},
|
||||||
new FillFlowContainer<MetadataSegment>()
|
new FillFlowContainer<MetadataSegment>
|
||||||
{
|
{
|
||||||
Anchor = Anchor.TopRight,
|
Anchor = Anchor.TopRight,
|
||||||
Origin = Anchor.TopRight,
|
Origin = Anchor.TopRight,
|
||||||
|
@ -128,7 +128,7 @@ namespace osu.Game.Screens.Select
|
|||||||
// Bottom = 5
|
// Bottom = 5
|
||||||
// },
|
// },
|
||||||
//},
|
//},
|
||||||
sortTabs = new OsuTabControl<SortMode>()
|
sortTabs = new OsuTabControl<SortMode>
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
Width = 0.5f,
|
Width = 0.5f,
|
||||||
|
@ -66,8 +66,8 @@
|
|||||||
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantCommaInAttributeList/@EntryIndexedValue">DO_NOT_SHOW</s:String>
|
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantCommaInAttributeList/@EntryIndexedValue">DO_NOT_SHOW</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantCommaInEnumDeclaration/@EntryIndexedValue">DO_NOT_SHOW</s:String>
|
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantCommaInEnumDeclaration/@EntryIndexedValue">DO_NOT_SHOW</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantCommaInInitializer/@EntryIndexedValue">DO_NOT_SHOW</s:String>
|
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantCommaInInitializer/@EntryIndexedValue">DO_NOT_SHOW</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantEmptyObjectCreationArgumentList/@EntryIndexedValue"></s:String>
|
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantEmptyObjectCreationArgumentList/@EntryIndexedValue">WARNING</s:String>
|
||||||
<s:Boolean x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantEmptyObjectCreationArgumentList/@EntryIndexRemoved">True</s:Boolean>
|
|
||||||
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantExplicitParamsArrayCreation/@EntryIndexedValue">WARNING</s:String>
|
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantExplicitParamsArrayCreation/@EntryIndexedValue">WARNING</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantImmediateDelegateInvocation/@EntryIndexedValue">WARNING</s:String>
|
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantImmediateDelegateInvocation/@EntryIndexedValue">WARNING</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantLambdaSignatureParentheses/@EntryIndexedValue">WARNING</s:String>
|
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantLambdaSignatureParentheses/@EntryIndexedValue">WARNING</s:String>
|
||||||
|
Loading…
Reference in New Issue
Block a user