1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 09:27:29 +08:00

Use expression body for property get/set where possible

This commit is contained in:
Dean Herbert 2019-02-28 13:58:19 +09:00
parent 94a389319d
commit 42be7857d1
130 changed files with 297 additions and 403 deletions

View File

@ -34,7 +34,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable
public override Color4 AccentColour
{
get { return base.AccentColour; }
get => base.AccentColour;
set
{
base.AccentColour = value;

View File

@ -25,7 +25,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable.Pieces
private Color4 accentColour;
public Color4 AccentColour
{
get { return accentColour; }
get => accentColour;
set
{
accentColour = value;

View File

@ -33,7 +33,7 @@ namespace osu.Game.Rulesets.Catch.UI
public Container ExplodingFruitTarget
{
set { MovableCatcher.ExplodingFruitTarget = value; }
set => MovableCatcher.ExplodingFruitTarget = value;
}
public CatcherArea(BeatmapDifficulty difficulty = null)
@ -158,7 +158,7 @@ namespace osu.Game.Rulesets.Catch.UI
protected bool Dashing
{
get { return dashing; }
get => dashing;
set
{
if (value == dashing) return;
@ -176,7 +176,7 @@ namespace osu.Game.Rulesets.Catch.UI
/// </summary>
protected bool Trail
{
get { return trail; }
get => trail;
set
{
if (value == trail) return;

View File

@ -85,7 +85,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
public override Color4 AccentColour
{
get { return base.AccentColour; }
get => base.AccentColour;
set
{
base.AccentColour = value;

View File

@ -56,7 +56,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
public override Color4 AccentColour
{
get { return base.AccentColour; }
get => base.AccentColour;
set
{
base.AccentColour = value;

View File

@ -41,7 +41,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
public override Color4 AccentColour
{
get { return base.AccentColour; }
get => base.AccentColour;
set
{
base.AccentColour = value;

View File

@ -77,7 +77,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables.Pieces
public Color4 AccentColour
{
get { return accentColour; }
get => accentColour;
set
{
if (accentColour == value)
@ -90,7 +90,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables.Pieces
public bool Hitting
{
get { return hitting; }
get => hitting;
set
{
hitting = value;

View File

@ -37,7 +37,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables.Pieces
private Color4 accentColour;
public Color4 AccentColour
{
get { return accentColour; }
get => accentColour;
set
{
if (accentColour == value)

View File

@ -78,8 +78,8 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables.Pieces
public Color4 AccentColour
{
get { return Colour; }
set { Colour = value; }
get => Colour;
set => Colour = value;
}
}
}

View File

@ -58,7 +58,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables.Pieces
private Color4 accentColour;
public Color4 AccentColour
{
get { return accentColour; }
get => accentColour;
set
{
if (accentColour == value)

View File

@ -19,7 +19,7 @@ namespace osu.Game.Rulesets.Mania.Objects
private double duration;
public double Duration
{
get { return duration; }
get => duration;
set
{
duration = value;
@ -29,7 +29,7 @@ namespace osu.Game.Rulesets.Mania.Objects
public override double StartTime
{
get { return base.StartTime; }
get => base.StartTime;
set
{
base.StartTime = value;
@ -40,7 +40,7 @@ namespace osu.Game.Rulesets.Mania.Objects
public override int Column
{
get { return base.Column; }
get => base.Column;
set
{
base.Column = value;

View File

@ -99,7 +99,7 @@ namespace osu.Game.Rulesets.Mania.UI
private bool isSpecial;
public bool IsSpecial
{
get { return isSpecial; }
get => isSpecial;
set
{
if (isSpecial == value)
@ -113,7 +113,7 @@ namespace osu.Game.Rulesets.Mania.UI
private Color4 accentColour;
public Color4 AccentColour
{
get { return accentColour; }
get => accentColour;
set
{
if (accentColour == value)

View File

@ -17,7 +17,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Connections
/// </summary>
public int PointDistance
{
get { return pointDistance; }
get => pointDistance;
set
{
if (pointDistance == value) return;
@ -32,7 +32,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Connections
/// </summary>
public int PreEmpt
{
get { return preEmpt; }
get => preEmpt;
set
{
if (preEmpt == value) return;
@ -44,7 +44,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Connections
private IEnumerable<OsuHitObject> hitObjects;
public override IEnumerable<OsuHitObject> HitObjects
{
get { return hitObjects; }
get => hitObjects;
set
{
hitObjects = value;

View File

@ -102,7 +102,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
public override Color4 AccentColour
{
get { return base.AccentColour; }
get => base.AccentColour;
set
{
base.AccentColour = value;

View File

@ -115,7 +115,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
public override Color4 AccentColour
{
get { return base.AccentColour; }
get => base.AccentColour;
set
{
base.AccentColour = value;

View File

@ -18,8 +18,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
public string Text
{
get { return number.Text; }
set { number.Text = value; }
get => number.Text;
set => number.Text = value;
}
public NumberPiece()

View File

@ -27,7 +27,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
/// </summary>
public Color4 AccentColour
{
get { return accentColour; }
get => accentColour;
set
{
accentColour = value;
@ -136,7 +136,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
public bool Tracking
{
get { return tracking; }
get => tracking;
private set
{
if (value == tracking)

View File

@ -15,10 +15,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
public Color4 AccentColour
{
get
{
return Disc.Colour;
}
get => Disc.Colour;
set
{
Disc.Colour = value;

View File

@ -17,8 +17,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
public Color4 AccentColour
{
get { return background.AccentColour; }
set { background.AccentColour = value; }
get => background.AccentColour;
set => background.AccentColour = value;
}
private readonly SpinnerBackground background;
@ -45,7 +45,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
private bool tracking;
public bool Tracking
{
get { return tracking; }
get => tracking;
set
{
if (value == tracking) return;
@ -58,7 +58,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
private bool complete;
public bool Complete
{
get { return complete; }
get => complete;
set
{
if (value == complete) return;

View File

@ -41,7 +41,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
public double SpinsPerMinute
{
get { return spm; }
get => spm;
private set
{
if (value == spm) return;

View File

@ -30,7 +30,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces
/// </summary>
public override Color4 AccentColour
{
get { return base.AccentColour; }
get => base.AccentColour;
set
{
base.AccentColour = value;
@ -46,7 +46,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces
/// </summary>
public override bool KiaiMode
{
get { return base.KiaiMode; }
get => base.KiaiMode;
set
{
base.KiaiMode = value;

View File

@ -16,8 +16,8 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces
/// </summary>
public virtual Color4 AccentColour
{
get { return accentColour; }
set { accentColour = value; }
get => accentColour;
set => accentColour = value;
}
private bool kiaiMode;
@ -26,11 +26,8 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces
/// </summary>
public virtual bool KiaiMode
{
get { return kiaiMode; }
set
{
kiaiMode = value;
}
get => kiaiMode;
set => kiaiMode = value;
}
public TaikoPiece()

View File

@ -25,7 +25,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces
private bool filled;
public bool Filled
{
get { return filled; }
get => filled;
set
{
filled = value;

View File

@ -190,7 +190,7 @@ namespace osu.Game.Tests.Visual
public double Value
{
set { valueText.Text = $"{value:G}"; }
set => valueText.Text = $"{value:G}";
}
public InfoString(string header)

View File

@ -34,8 +34,8 @@ namespace osu.Game.Beatmaps
[Column("Author")]
public string AuthorString
{
get { return Author?.Username; }
set { Author = new User { Username = value }; }
get => Author?.Username;
set => Author = new User { Username = value };
}
/// <summary>

View File

@ -15,7 +15,7 @@ namespace osu.Game.Beatmaps.Drawables
private BeatmapSetInfo beatmapSet;
public BeatmapSetInfo BeatmapSet
{
get { return beatmapSet; }
get => beatmapSet;
set
{
if (value == beatmapSet) return;
@ -29,7 +29,7 @@ namespace osu.Game.Beatmaps.Drawables
private BeatmapSetCoverType coverType = BeatmapSetCoverType.Cover;
public BeatmapSetCoverType CoverType
{
get { return coverType; }
get => coverType;
set
{
if (value == coverType) return;

View File

@ -86,7 +86,7 @@ namespace osu.Game.Graphics.Backgrounds
public float TriangleScale
{
get { return triangleScale; }
get => triangleScale;
set
{
float change = value / triangleScale;

View File

@ -15,15 +15,9 @@ namespace osu.Game.Graphics.Containers
{
public Drawable Icon
{
get
{
return InternalChild;
}
get => InternalChild;
set
{
InternalChild = value;
}
set => InternalChild = value;
}
/// <summary>
@ -33,8 +27,8 @@ namespace osu.Game.Graphics.Containers
/// </summary>
public new EdgeEffectParameters EdgeEffect
{
get { return base.EdgeEffect; }
set { base.EdgeEffect = value; }
get => base.EdgeEffect;
set => base.EdgeEffect = value;
}
protected override void Update()

View File

@ -24,7 +24,7 @@ namespace osu.Game.Graphics.Containers
public Drawable ExpandableHeader
{
get { return expandableHeader; }
get => expandableHeader;
set
{
if (value == expandableHeader) return;
@ -40,7 +40,7 @@ namespace osu.Game.Graphics.Containers
public Drawable FixedHeader
{
get { return fixedHeader; }
get => fixedHeader;
set
{
if (value == fixedHeader) return;
@ -56,7 +56,7 @@ namespace osu.Game.Graphics.Containers
public Drawable Footer
{
get { return footer; }
get => footer;
set
{
if (value == footer) return;
@ -75,7 +75,7 @@ namespace osu.Game.Graphics.Containers
public Drawable HeaderBackground
{
get { return headerBackground; }
get => headerBackground;
set
{
if (value == headerBackground) return;

View File

@ -106,7 +106,7 @@ namespace osu.Game.Graphics
private bool shadow;
public bool Shadow
{
get { return shadow; }
get => shadow;
set
{
shadow = value;
@ -119,10 +119,7 @@ namespace osu.Game.Graphics
public FontAwesome Icon
{
get
{
return icon;
}
get => icon;
set
{

View File

@ -26,10 +26,7 @@ namespace osu.Game.Graphics.UserInterface
/// </summary>
public float Length
{
get
{
return length;
}
get => length;
set
{
length = MathHelper.Clamp(value, 0, 1);
@ -39,35 +36,20 @@ namespace osu.Game.Graphics.UserInterface
public Color4 BackgroundColour
{
get
{
return background.Colour;
}
set
{
background.Colour = value;
}
get => background.Colour;
set => background.Colour = value;
}
public Color4 AccentColour
{
get
{
return bar.Colour;
}
set
{
bar.Colour = value;
}
get => bar.Colour;
set => bar.Colour = value;
}
private BarDirection direction = BarDirection.LeftToRight;
public BarDirection Direction
{
get
{
return direction;
}
get => direction;
set
{
direction = value;

View File

@ -19,10 +19,7 @@ namespace osu.Game.Graphics.UserInterface
private BarDirection direction = BarDirection.BottomToTop;
public new BarDirection Direction
{
get
{
return direction;
}
get => direction;
set
{
direction = value;

View File

@ -57,7 +57,7 @@ namespace osu.Game.Graphics.UserInterface
public Visibility State
{
get { return state; }
get => state;
set
{
if (value == state) return;

View File

@ -156,10 +156,7 @@ namespace osu.Game.Graphics.UserInterface
private Color4 buttonColour;
public Color4 ButtonColour
{
get
{
return buttonColour;
}
get => buttonColour;
set
{
buttonColour = value;
@ -171,10 +168,7 @@ namespace osu.Game.Graphics.UserInterface
private Color4 backgroundColour = OsuColour.Gray(34);
public Color4 BackgroundColour
{
get
{
return backgroundColour;
}
get => backgroundColour;
set
{
backgroundColour = value;
@ -185,10 +179,7 @@ namespace osu.Game.Graphics.UserInterface
private string text;
public string Text
{
get
{
return text;
}
get => text;
set
{
text = value;

View File

@ -19,7 +19,7 @@ namespace osu.Game.Graphics.UserInterface
/// </summary>
public Color4 IconColour
{
get { return iconColour ?? Color4.White; }
get => iconColour ?? Color4.White;
set
{
iconColour = value;
@ -34,8 +34,8 @@ namespace osu.Game.Graphics.UserInterface
/// </summary>
public Color4 IconHoverColour
{
get { return iconHoverColour ?? IconColour; }
set { iconHoverColour = value; }
get => iconHoverColour ?? IconColour;
set => iconHoverColour = value;
}
/// <summary>
@ -43,8 +43,8 @@ namespace osu.Game.Graphics.UserInterface
/// </summary>
public FontAwesome Icon
{
get { return icon.Icon; }
set { icon.Icon = value; }
get => icon.Icon;
set => icon.Icon = value;
}
/// <summary>
@ -52,8 +52,8 @@ namespace osu.Game.Graphics.UserInterface
/// </summary>
public Vector2 IconScale
{
get { return icon.Scale; }
set { icon.Scale = value; }
get => icon.Scale;
set => icon.Scale = value;
}
/// <summary>

View File

@ -44,7 +44,7 @@ namespace osu.Game.Graphics.UserInterface
/// </summary>
public IEnumerable<float> Values
{
get { return values; }
get => values;
set
{
values = value.ToArray();

View File

@ -74,7 +74,7 @@ namespace osu.Game.Graphics.UserInterface
private bool glowing;
public bool Glowing
{
get { return glowing; }
get => glowing;
set
{
glowing = value;
@ -94,10 +94,7 @@ namespace osu.Game.Graphics.UserInterface
public bool Expanded
{
set
{
this.ResizeTo(new Vector2(value ? EXPANDED_SIZE : COLLAPSED_SIZE, 12), 500, Easing.OutQuint);
}
set => this.ResizeTo(new Vector2(value ? EXPANDED_SIZE : COLLAPSED_SIZE, 12), 500, Easing.OutQuint);
}
private readonly Bindable<bool> current = new Bindable<bool>();
@ -118,7 +115,7 @@ namespace osu.Game.Graphics.UserInterface
private Color4 accentColour;
public Color4 AccentColour
{
get { return accentColour; }
get => accentColour;
set
{
accentColour = value;
@ -130,7 +127,7 @@ namespace osu.Game.Graphics.UserInterface
private Color4 glowingAccentColour;
public Color4 GlowingAccentColour
{
get { return glowingAccentColour; }
get => glowingAccentColour;
set
{
glowingAccentColour = value;
@ -142,7 +139,7 @@ namespace osu.Game.Graphics.UserInterface
private Color4 glowColour;
public Color4 GlowColour
{
get { return glowColour; }
get => glowColour;
set
{
glowColour = value;

View File

@ -33,7 +33,7 @@ namespace osu.Game.Graphics.UserInterface
public string LabelText
{
get { return labelSpriteText?.Text; }
get => labelSpriteText?.Text;
set
{
if (labelSpriteText != null)
@ -43,7 +43,7 @@ namespace osu.Game.Graphics.UserInterface
public MarginPadding LabelPadding
{
get { return labelSpriteText?.Padding ?? new MarginPadding(); }
get => labelSpriteText?.Padding ?? new MarginPadding();
set
{
if (labelSpriteText != null)

View File

@ -19,7 +19,7 @@ namespace osu.Game.Graphics.UserInterface
private Color4 accentColour;
public Color4 AccentColour
{
get { return accentColour; }
get => accentColour;
set
{
accentColour = value;
@ -85,7 +85,7 @@ namespace osu.Game.Graphics.UserInterface
private Color4 accentColour;
public Color4 AccentColour
{
get { return accentColour; }
get => accentColour;
set
{
accentColour = value;
@ -105,7 +105,7 @@ namespace osu.Game.Graphics.UserInterface
private Color4? accentColour;
public Color4 AccentColour
{
get { return accentColour ?? nonAccentSelectedColour; }
get => accentColour ?? nonAccentSelectedColour;
set
{
accentColour = value;
@ -159,8 +159,8 @@ namespace osu.Game.Graphics.UserInterface
{
public string Text
{
get { return Label.Text; }
set { Label.Text = value; }
get => Label.Text;
set => Label.Text = value;
}
public readonly OsuSpriteText Label;
@ -203,8 +203,8 @@ namespace osu.Game.Graphics.UserInterface
protected readonly SpriteText Text;
protected override string Label
{
get { return Text.Text; }
set { Text.Text = value; }
get => Text.Text;
set => Text.Text = value;
}
protected readonly SpriteIcon Icon;
@ -212,7 +212,7 @@ namespace osu.Game.Graphics.UserInterface
private Color4 accentColour;
public virtual Color4 AccentColour
{
get { return accentColour; }
get => accentColour;
set
{
accentColour = value;

View File

@ -125,7 +125,7 @@ namespace osu.Game.Graphics.UserInterface
{
public string Text
{
get { return NormalText.Text; }
get => NormalText.Text;
set
{
NormalText.Text = value;

View File

@ -37,7 +37,7 @@ namespace osu.Game.Graphics.UserInterface
private Color4 accentColour;
public Color4 AccentColour
{
get { return accentColour; }
get => accentColour;
set
{
accentColour = value;

View File

@ -60,7 +60,7 @@ namespace osu.Game.Graphics.UserInterface
private Color4 accentColour;
public Color4 AccentColour
{
get { return accentColour; }
get => accentColour;
set
{
accentColour = value;
@ -103,7 +103,7 @@ namespace osu.Game.Graphics.UserInterface
private Color4 accentColour;
public Color4 AccentColour
{
get { return accentColour; }
get => accentColour;
set
{
accentColour = value;
@ -224,10 +224,7 @@ namespace osu.Game.Graphics.UserInterface
{
public override Color4 AccentColour
{
get
{
return base.AccentColour;
}
get => base.AccentColour;
set
{

View File

@ -26,7 +26,7 @@ namespace osu.Game.Graphics.UserInterface
private Color4? accentColour;
public Color4 AccentColour
{
get { return accentColour.GetValueOrDefault(); }
get => accentColour.GetValueOrDefault();
set
{
accentColour = value;
@ -41,8 +41,8 @@ namespace osu.Game.Graphics.UserInterface
public string Text
{
get { return text.Text; }
set { text.Text = value; }
get => text.Text;
set => text.Text = value;
}
private const float transition_length = 500;

View File

@ -18,7 +18,7 @@ namespace osu.Game.Graphics.UserInterface
public Color4 FillColour
{
set { fill.FadeColour(value, 150, Easing.OutQuint); }
set => fill.FadeColour(value, 150, Easing.OutQuint);
}
public Color4 BackgroundColour
@ -32,12 +32,12 @@ namespace osu.Game.Graphics.UserInterface
public double EndTime
{
set { CurrentNumber.MaxValue = value; }
set => CurrentNumber.MaxValue = value;
}
public double CurrentTime
{
set { CurrentNumber.Value = value; }
set => CurrentNumber.Value = value;
}
public ProgressBar()

View File

@ -45,10 +45,7 @@ namespace osu.Game.Graphics.UserInterface
/// </summary>
public virtual T DisplayedCount
{
get
{
return displayedCount;
}
get => displayedCount;
set
{
@ -70,8 +67,8 @@ namespace osu.Game.Graphics.UserInterface
public Color4 AccentColour
{
get { return DisplayedCountSpriteText.Colour; }
set { DisplayedCountSpriteText.Colour = value; }
get => DisplayedCountSpriteText.Colour;
set => DisplayedCountSpriteText.Colour = value;
}
/// <summary>

View File

@ -41,10 +41,7 @@ namespace osu.Game.Graphics.UserInterface
/// </summary>
public float CountStars
{
get
{
return countStars;
}
get => countStars;
set
{

View File

@ -31,10 +31,7 @@ namespace osu.Game.Graphics.UserInterface
public bool MatchingFilter
{
set
{
this.FadeTo(value ? 1 : 0);
}
set => this.FadeTo(value ? 1 : 0);
}
}
}

View File

@ -48,10 +48,7 @@ namespace osu.Game.Graphics.UserInterface
public override Anchor Origin
{
get
{
return base.Origin;
}
get => base.Origin;
set
{
@ -155,18 +152,12 @@ namespace osu.Game.Graphics.UserInterface
public FontAwesome Icon
{
set
{
bouncingIcon.Icon = value;
}
set => bouncingIcon.Icon = value;
}
public string Text
{
set
{
text.Text = value;
}
set => text.Text = value;
}
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => IconLayer.ReceivePositionalInputAt(screenSpacePos) || TextLayer.ReceivePositionalInputAt(screenSpacePos);
@ -217,7 +208,7 @@ namespace osu.Game.Graphics.UserInterface
private readonly SpriteIcon icon;
public FontAwesome Icon { set { icon.Icon = value; } }
public FontAwesome Icon { set => icon.Icon = value; }
public BouncingIcon()
{

View File

@ -19,15 +19,15 @@ namespace osu.Game.Input.Bindings
[Column("Keys")]
public string KeysString
{
get { return KeyCombination.ToString(); }
private set { KeyCombination = value; }
get => KeyCombination.ToString();
private set => KeyCombination = value;
}
[Column("Action")]
public int IntAction
{
get { return (int)Action; }
set { Action = value; }
get => (int)Action;
set => Action = value;
}
}
}

View File

@ -260,7 +260,7 @@ namespace osu.Game.Online.API
public APIState State
{
get { return state; }
get => state;
private set
{
APIState oldState = state;

View File

@ -19,15 +19,9 @@ namespace osu.Game.Online.API
[JsonProperty(@"expires_in")]
public long ExpiresIn
{
get
{
return AccessTokenExpiry - DateTimeOffset.UtcNow.ToUnixTimeSeconds();
}
get => AccessTokenExpiry - DateTimeOffset.UtcNow.ToUnixTimeSeconds();
set
{
AccessTokenExpiry = DateTimeOffset.Now.AddSeconds(value).ToUnixTimeSeconds();
}
set => AccessTokenExpiry = DateTimeOffset.Now.AddSeconds(value).ToUnixTimeSeconds();
}
public bool IsValid => !string.IsNullOrEmpty(AccessToken) && ExpiresIn > 30;

View File

@ -39,7 +39,7 @@ namespace osu.Game.Online.Leaderboards
public IEnumerable<ScoreInfo> Scores
{
get { return scores; }
get => scores;
set
{
scores = value;
@ -98,7 +98,7 @@ namespace osu.Game.Online.Leaderboards
public TScope Scope
{
get { return scope; }
get => scope;
set
{
if (value.Equals(scope))
@ -117,7 +117,7 @@ namespace osu.Game.Online.Leaderboards
/// </summary>
protected PlaceholderState PlaceholderState
{
get { return placeholderState; }
get => placeholderState;
set
{
if (value != PlaceholderState.Successful)

View File

@ -27,7 +27,7 @@ namespace osu.Game.Overlays.BeatmapSet
public BeatmapSetInfo BeatmapSet
{
get { return beatmapSet; }
get => beatmapSet;
set
{
if (value == beatmapSet) return;

View File

@ -21,7 +21,7 @@ namespace osu.Game.Overlays.BeatmapSet
public BeatmapSetInfo BeatmapSet
{
get { return beatmapSet; }
get => beatmapSet;
set
{
if (value == beatmapSet) return;
@ -35,7 +35,7 @@ namespace osu.Game.Overlays.BeatmapSet
public BeatmapInfo Beatmap
{
get { return beatmap; }
get => beatmap;
set
{
if (value == beatmap) return;
@ -95,8 +95,8 @@ namespace osu.Game.Overlays.BeatmapSet
public string Value
{
get { return value.Text; }
set { this.value.Text = value; }
get => value.Text;
set => this.value.Text = value;
}
public Statistic(FontAwesome icon, string name)

View File

@ -35,7 +35,7 @@ namespace osu.Game.Overlays.BeatmapSet
private BeatmapSetInfo beatmapSet;
public BeatmapSetInfo BeatmapSet
{
get { return beatmapSet; }
get => beatmapSet;
set
{
if (value == beatmapSet) return;
@ -196,7 +196,7 @@ namespace osu.Game.Overlays.BeatmapSet
private DifficultySelectorState state;
public DifficultySelectorState State
{
get { return state; }
get => state;
set
{
if (value == state) return;
@ -279,7 +279,7 @@ namespace osu.Game.Overlays.BeatmapSet
private int value;
public int Value
{
get { return value; }
get => value;
set
{
this.value = value;

View File

@ -30,8 +30,8 @@ namespace osu.Game.Overlays.BeatmapSet.Buttons
public BeatmapSetInfo BeatmapSet
{
get { return playButton.BeatmapSet; }
set { playButton.BeatmapSet = value; }
get => playButton.BeatmapSet;
set => playButton.BeatmapSet = value;
}
public PreviewButton()

View File

@ -25,7 +25,7 @@ namespace osu.Game.Overlays.BeatmapSet
public BeatmapSetInfo BeatmapSet
{
get { return beatmapSet; }
get => beatmapSet;
set
{
if (value == beatmapSet) return;
@ -39,7 +39,7 @@ namespace osu.Game.Overlays.BeatmapSet
public BeatmapInfo Beatmap
{
get { return beatmap; }
get => beatmap;
set
{
if (value == beatmap) return;

View File

@ -28,7 +28,7 @@ namespace osu.Game.Overlays.BeatmapSet
private BeatmapSetInfo beatmapSet;
public BeatmapSetInfo BeatmapSet
{
get { return beatmapSet; }
get => beatmapSet;
set
{
if (value == beatmapSet) return;
@ -46,8 +46,8 @@ namespace osu.Game.Overlays.BeatmapSet
public BeatmapInfo Beatmap
{
get { return successRate.Beatmap; }
set { successRate.Beatmap = value; }
get => successRate.Beatmap;
set => successRate.Beatmap = value;
}
public Info()
@ -162,8 +162,8 @@ namespace osu.Game.Overlays.BeatmapSet
public Color4 TextColour
{
get { return textFlow.Colour; }
set { textFlow.Colour = value; }
get => textFlow.Colour;
set => textFlow.Colour = value;
}
public MetadataSection(string title)

View File

@ -19,7 +19,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
private User user;
public User User
{
get { return user; }
get => user;
set
{
if (user == value) return;

View File

@ -46,7 +46,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
private APIScoreInfo score;
public APIScoreInfo Score
{
get { return score; }
get => score;
set
{
if (score == value) return;
@ -209,7 +209,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
return;
valueText.Text = value;
}
get { return valueText.Text; }
get => valueText.Text;
}
public InfoColumn(string header)

View File

@ -34,7 +34,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
public IEnumerable<APIScoreInfo> Scores
{
get { return scores; }
get => scores;
set
{
getScoresRequest?.Cancel();

View File

@ -23,7 +23,7 @@ namespace osu.Game.Overlays.BeatmapSet
private BeatmapInfo beatmap;
public BeatmapInfo Beatmap
{
get { return beatmap; }
get => beatmap;
set
{
if (value == beatmap) return;

View File

@ -38,10 +38,7 @@ namespace osu.Game.Overlays.Chat.Selection
public IEnumerable<string> FilterTerms => new[] { channel.Name };
public bool MatchingFilter
{
set
{
this.FadeTo(value ? 1f : 0f, 100);
}
set => this.FadeTo(value ? 1f : 0f, 100);
}
public Action<Channel> OnRequestJoin;

View File

@ -23,21 +23,18 @@ namespace osu.Game.Overlays.Chat.Selection
public IEnumerable<string> FilterTerms => Array.Empty<string>();
public bool MatchingFilter
{
set
{
this.FadeTo(value ? 1f : 0f, 100);
}
set => this.FadeTo(value ? 1f : 0f, 100);
}
public string Header
{
get { return header.Text; }
set { header.Text = value.ToUpperInvariant(); }
get => header.Text;
set => header.Text = value.ToUpperInvariant();
}
public IEnumerable<Channel> Channels
{
set { ChannelFlow.ChildrenEnumerable = value.Select(c => new ChannelListItem(c)); }
set => ChannelFlow.ChildrenEnumerable = value.Select(c => new ChannelListItem(c));
}
public ChannelSection()

View File

@ -158,7 +158,7 @@ namespace osu.Game.Overlays.Direct
public int Value
{
get { return value; }
get => value;
set
{
this.value = value;

View File

@ -24,7 +24,7 @@ namespace osu.Game.Overlays.Direct
public BeatmapSetInfo BeatmapSet
{
get { return beatmapSet; }
get => beatmapSet;
set
{
if (value == beatmapSet) return;

View File

@ -45,7 +45,7 @@ namespace osu.Game.Overlays
public IEnumerable<BeatmapSetInfo> BeatmapSets
{
get { return beatmapSets; }
get => beatmapSets;
set
{
if (beatmapSets?.Equals(value) ?? false) return;
@ -72,7 +72,7 @@ namespace osu.Game.Overlays
public ResultCounts ResultAmounts
{
get { return resultAmounts; }
get => resultAmounts;
set
{
if (value == ResultAmounts) return;

View File

@ -35,7 +35,7 @@ namespace osu.Game.Overlays.KeyBinding
public bool MatchingFilter
{
get { return matchingFilter; }
get => matchingFilter;
set
{
matchingFilter = value;
@ -309,7 +309,7 @@ namespace osu.Game.Overlays.KeyBinding
public bool IsBinding
{
get { return isBinding; }
get => isBinding;
set
{
if (value == isBinding) return;

View File

@ -132,7 +132,7 @@ namespace osu.Game.Overlays.MedalSplash
public DisplayState State
{
get { return state; }
get => state;
set
{
if (state == value) return;

View File

@ -107,7 +107,7 @@ namespace osu.Game.Overlays.Mods
public Color4 SelectedColour
{
get { return selectedColour; }
get => selectedColour;
set
{
if (value == selectedColour) return;
@ -121,7 +121,7 @@ namespace osu.Game.Overlays.Mods
public Mod Mod
{
get { return mod; }
get => mod;
set
{
mod = value;

View File

@ -52,7 +52,7 @@ namespace osu.Game.Overlays.Music
private bool selected;
public bool Selected
{
get { return selected; }
get => selected;
set
{
if (value == selected) return;
@ -142,7 +142,7 @@ namespace osu.Game.Overlays.Music
public bool MatchingFilter
{
get { return matching; }
get => matching;
set
{
if (matching == value) return;

View File

@ -34,8 +34,8 @@ namespace osu.Game.Overlays.Music
public new MarginPadding Padding
{
get { return base.Padding; }
set { base.Padding = value; }
get => base.Padding;
set => base.Padding = value;
}
public BeatmapSetInfo FirstVisibleSet => items.FirstVisibleSet;
@ -109,8 +109,8 @@ namespace osu.Game.Overlays.Music
public string SearchTerm
{
get { return search.SearchTerm; }
set { search.SearchTerm = value; }
get => search.SearchTerm;
set => search.SearchTerm = value;
}
public BeatmapSetInfo FirstVisibleSet => items.FirstOrDefault(i => i.MatchingFilter)?.BeatmapSetInfo;

View File

@ -205,7 +205,7 @@ namespace osu.Game.Overlays.Notifications
public bool Pulsate
{
get { return pulsate; }
get => pulsate;
set
{
if (pulsate == value) return;

View File

@ -39,7 +39,7 @@ namespace osu.Game.Overlays.Notifications
public string ClearText
{
get { return clearText; }
get => clearText;
set
{
clearText = value;
@ -51,7 +51,7 @@ namespace osu.Game.Overlays.Notifications
public string Title
{
get { return title; }
get => title;
set
{
title = value;
@ -153,8 +153,8 @@ namespace osu.Game.Overlays.Notifications
public string Text
{
get { return text.Text; }
set { text.Text = value.ToUpperInvariant(); }
get => text.Text;
set => text.Text = value.ToUpperInvariant();
}
}

View File

@ -17,18 +17,15 @@ namespace osu.Game.Overlays.Notifications
{
public string Text
{
set
{
Schedule(() => textDrawable.Text = value);
}
set => Schedule(() => textDrawable.Text = value);
}
public string CompletionText { get; set; } = "Task has completed!";
public float Progress
{
get { return progressBar.Progress; }
set { Schedule(() => progressBar.Progress = value); }
get => progressBar.Progress;
set => Schedule(() => progressBar.Progress = value);
}
protected override void LoadComplete()
@ -41,9 +38,8 @@ namespace osu.Game.Overlays.Notifications
public virtual ProgressNotificationState State
{
get { return state; }
set
{
get => state;
set =>
Schedule(() =>
{
bool stateChanged = state != value;
@ -83,7 +79,6 @@ namespace osu.Game.Overlays.Notifications
}
});
}
}
private ProgressNotificationState state;
@ -180,7 +175,7 @@ namespace osu.Game.Overlays.Notifications
private float progress;
public float Progress
{
get { return progress; }
get => progress;
set
{
if (progress == value) return;
@ -194,7 +189,7 @@ namespace osu.Game.Overlays.Notifications
public bool Active
{
get { return active; }
get => active;
set
{
active = value;

View File

@ -17,7 +17,7 @@ namespace osu.Game.Overlays.Notifications
private string text = string.Empty;
public string Text
{
get { return text; }
get => text;
set
{
text = value;
@ -28,7 +28,7 @@ namespace osu.Game.Overlays.Notifications
private FontAwesome icon = FontAwesome.fa_info_circle;
public FontAwesome Icon
{
get { return icon; }
get => icon;
set
{
icon = value;
@ -76,10 +76,7 @@ namespace osu.Game.Overlays.Notifications
public override bool Read
{
get
{
return base.Read;
}
get => base.Read;
set
{

View File

@ -318,7 +318,7 @@ namespace osu.Game.Overlays.Profile
public User User
{
get { return user; }
get => user;
set
{
user = value;

View File

@ -78,7 +78,7 @@ namespace osu.Game.Overlays.Profile.Sections.Kudosu
public new int Count
{
set { valueText.Text = value.ToString(); }
set => valueText.Text = value.ToString();
}
public CountSection(string header, string description)

View File

@ -41,7 +41,7 @@ namespace osu.Game.Overlays.Settings.Sections.General
public bool Bounding
{
get { return bounding; }
get => bounding;
set
{
bounding = value;
@ -338,7 +338,7 @@ namespace osu.Game.Overlays.Settings.Sections.General
public Color4 StatusColour
{
set { statusIcon.FadeColour(value, 500, Easing.OutQuint); }
set => statusIcon.FadeColour(value, 500, Easing.OutQuint);
}
public UserDropdownHeader()

View File

@ -14,8 +14,8 @@ namespace osu.Game.Overlays.Settings
public override string LabelText
{
get { return checkbox.LabelText; }
set { checkbox.LabelText = value; }
get => checkbox.LabelText;
set => checkbox.LabelText = value;
}
}
}

View File

@ -39,7 +39,7 @@ namespace osu.Game.Overlays.Settings
public virtual string LabelText
{
get { return text?.Text ?? string.Empty; }
get => text?.Text ?? string.Empty;
set
{
if (text == null)
@ -58,7 +58,7 @@ namespace osu.Game.Overlays.Settings
public virtual Bindable<T> Bindable
{
get { return bindable; }
get => bindable;
set
{
@ -76,11 +76,7 @@ namespace osu.Game.Overlays.Settings
public bool MatchingFilter
{
set
{
// probably needs a better transition.
this.FadeTo(value ? 1 : 0);
}
set => this.FadeTo(value ? 1 : 0);
}
protected SettingsItem()
@ -115,7 +111,7 @@ namespace osu.Game.Overlays.Settings
public Bindable<T> Bindable
{
get { return bindable; }
get => bindable;
set
{
bindable = value;

View File

@ -31,7 +31,7 @@ namespace osu.Game.Overlays.Settings
public bool MatchingFilter
{
set { this.FadeTo(value ? 1 : 0); }
set => this.FadeTo(value ? 1 : 0);
}
protected SettingsSection()

View File

@ -24,10 +24,7 @@ namespace osu.Game.Overlays.Settings
public IEnumerable<string> FilterTerms => new[] { Header };
public bool MatchingFilter
{
set
{
this.FadeTo(value ? 1 : 0);
}
set => this.FadeTo(value ? 1 : 0);
}
protected SettingsSubsection()

View File

@ -88,7 +88,7 @@ namespace osu.Game.Overlays.Settings
public ExpandedState State
{
get { return state; }
get => state;
set
{
expandEvent?.Cancel();

View File

@ -28,10 +28,7 @@ namespace osu.Game.Overlays.Settings
private SettingsSection section;
public SettingsSection Section
{
get
{
return section;
}
get => section;
set
{
section = value;
@ -43,7 +40,7 @@ namespace osu.Game.Overlays.Settings
private bool selected;
public bool Selected
{
get { return selected; }
get => selected;
set
{
selected = value;

View File

@ -36,7 +36,7 @@ namespace osu.Game.Overlays
private IEnumerable<User> users;
public IEnumerable<User> Users
{
get { return users; }
get => users;
set
{
if (users?.Equals(value) ?? false)

View File

@ -35,34 +35,25 @@ namespace osu.Game.Overlays.Toolbar
public FontAwesome Icon
{
set { SetIcon(value); }
set => SetIcon(value);
}
public string Text
{
get { return DrawableText.Text; }
set
{
DrawableText.Text = value;
}
get => DrawableText.Text;
set => DrawableText.Text = value;
}
public string TooltipMain
{
get { return tooltip1.Text; }
set
{
tooltip1.Text = value;
}
get => tooltip1.Text;
set => tooltip1.Text = value;
}
public string TooltipSub
{
get { return tooltip2.Text; }
set
{
tooltip2.Text = value;
}
get => tooltip2.Text;
set => tooltip2.Text = value;
}
protected virtual Anchor TooltipAnchor => Anchor.TopLeft;

View File

@ -66,7 +66,7 @@ namespace osu.Game.Overlays.Toolbar
public int Count
{
get { return count; }
get => count;
set
{
if (count == value)

View File

@ -17,7 +17,7 @@ namespace osu.Game.Overlays.Toolbar
public OverlayContainer StateContainer
{
get { return stateContainer; }
get => stateContainer;
set
{
stateContainer = value;

View File

@ -12,7 +12,7 @@ namespace osu.Game.Overlays.Toolbar
private RulesetInfo ruleset;
public RulesetInfo Ruleset
{
get { return ruleset; }
get => ruleset;
set
{
ruleset = value;

View File

@ -22,8 +22,8 @@ namespace osu.Game.Rulesets.UI
public FontAwesome Icon
{
get { return modIcon.Icon; }
set { modIcon.Icon = value; }
get => modIcon.Icon;
set => modIcon.Icon = value;
}
private readonly ModType type;
@ -100,7 +100,7 @@ namespace osu.Game.Rulesets.UI
public bool Highlighted
{
get { return highlighted; }
get => highlighted;
set
{

View File

@ -15,7 +15,7 @@ namespace osu.Game.Screens.Backgrounds
public WorkingBeatmap Beatmap
{
get { return beatmap; }
get => beatmap;
set
{
if (beatmap == value && beatmap != null)

View File

@ -22,7 +22,7 @@ namespace osu.Game.Screens.Edit
public override int Value
{
get { return base.Value; }
get => base.Value;
set
{
if (!VALID_DIVISORS.Contains(value))

View File

@ -14,7 +14,7 @@ namespace osu.Game.Screens.Edit.Components.RadioButtons
private IReadOnlyList<RadioButton> items;
public IReadOnlyList<RadioButton> Items
{
get { return items; }
get => items;
set
{
if (ReferenceEquals(items, value))

View File

@ -19,8 +19,8 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
public FontAwesome Icon
{
get { return button.Icon; }
set { button.Icon = value; }
get => button.Icon;
set => button.Icon = value;
}
private readonly IconButton button;

View File

@ -242,7 +242,7 @@ namespace osu.Game.Screens.Menu
public ButtonState State
{
get { return state; }
get => state;
set
{

View File

@ -206,7 +206,7 @@ namespace osu.Game.Screens.Menu
public ButtonSystemState State
{
get { return state; }
get => state;
set
{

View File

@ -62,7 +62,7 @@ namespace osu.Game.Screens.Menu
public bool Triangles
{
set { colourAndTriangles.FadeTo(value ? 1 : 0, transition_length, Easing.OutQuint); }
set => colourAndTriangles.FadeTo(value ? 1 : 0, transition_length, Easing.OutQuint);
}
public bool BeatMatching = true;
@ -71,8 +71,8 @@ namespace osu.Game.Screens.Menu
public bool Ripple
{
get { return rippleContainer.Alpha > 0; }
set { rippleContainer.FadeTo(value ? 1 : 0, transition_length, Easing.OutQuint); }
get => rippleContainer.Alpha > 0;
set => rippleContainer.FadeTo(value ? 1 : 0, transition_length, Easing.OutQuint);
}
private readonly Box flashLayer;

View File

@ -45,7 +45,7 @@ namespace osu.Game.Screens.Multi.Lounge.Components
private SelectionState state;
public SelectionState State
{
get { return state; }
get => state;
set
{
if (value == state) return;
@ -65,7 +65,7 @@ namespace osu.Game.Screens.Multi.Lounge.Components
private bool matchingFilter;
public bool MatchingFilter
{
get { return matchingFilter; }
get => matchingFilter;
set
{
matchingFilter = value;

View File

@ -15,8 +15,8 @@ namespace osu.Game.Screens.Play.Break
public FontAwesome Icon
{
set { icon.Icon = value; }
get { return icon.Icon; }
set => icon.Icon = value;
get => icon.Icon;
}
public override Vector2 Size
@ -27,7 +27,7 @@ namespace osu.Game.Screens.Play.Break
base.Size = value + BlurSigma * 2.5f;
ForceRedraw();
}
get { return base.Size; }
get => base.Size;
}
public BlurredIcon()

Some files were not shown because too many files have changed in this diff Show More