Remove functions with get-only properties

This commit is contained in:
Andrei Zavatski 2020-03-04 00:39:12 +03:00
parent 17f2baf600
commit 6fca3e5a46
3 changed files with 11 additions and 11 deletions

View File

@ -17,11 +17,11 @@ namespace osu.Game.Overlays.Changelog
Width *= 2; Width *= 2;
} }
protected override string GetMainText() => Value.DisplayName; protected override string GetMainText => Value.DisplayName;
protected override string GetAdditionalText() => Value.LatestBuild.DisplayVersion; protected override string GetAdditionalText => Value.LatestBuild.DisplayVersion;
protected override string GetInfoText() => Value.LatestBuild.Users > 0 ? $"{"user".ToQuantity(Value.LatestBuild.Users, "N0")} online" : null; protected override string GetInfoText => Value.LatestBuild.Users > 0 ? $"{"user".ToQuantity(Value.LatestBuild.Users, "N0")} online" : null;
protected override Color4 GetBarColour(OsuColour colours) => Value.Colour; protected override Color4 GetBarColour(OsuColour colours) => Value.Colour;
} }

View File

@ -14,9 +14,9 @@ namespace osu.Game.Overlays.Home.Friends
{ {
} }
protected override string GetMainText() => Value.Status.ToString(); protected override string GetMainText => Value.Status.ToString();
protected override string GetAdditionalText() => Value.Count.ToString(); protected override string GetAdditionalText => Value.Count.ToString();
protected override Color4 GetBarColour(OsuColour colours) protected override Color4 GetBarColour(OsuColour colours)
{ {

View File

@ -58,17 +58,17 @@ namespace osu.Game.Overlays
{ {
new OsuSpriteText new OsuSpriteText
{ {
Text = GetMainText(), Text = GetMainText,
Font = OsuFont.GetFont(size: 12, weight: FontWeight.Black), Font = OsuFont.GetFont(size: 12, weight: FontWeight.Black),
}, },
new OsuSpriteText new OsuSpriteText
{ {
Text = GetAdditionalText(), Text = GetAdditionalText,
Font = OsuFont.GetFont(size: 16, weight: FontWeight.Regular), Font = OsuFont.GetFont(size: 16, weight: FontWeight.Regular),
}, },
new OsuSpriteText new OsuSpriteText
{ {
Text = GetInfoText(), Text = GetInfoText,
Font = OsuFont.GetFont(size: 10), Font = OsuFont.GetFont(size: 10),
Colour = colourProvider.Foreground1 Colour = colourProvider.Foreground1
}, },
@ -88,11 +88,11 @@ namespace osu.Game.Overlays
SelectedItem.BindValueChanged(_ => updateState(), true); SelectedItem.BindValueChanged(_ => updateState(), true);
} }
protected abstract string GetMainText(); protected abstract string GetMainText { get; }
protected abstract string GetAdditionalText(); protected abstract string GetAdditionalText { get; }
protected virtual string GetInfoText() => string.Empty; protected virtual string GetInfoText => string.Empty;
protected abstract Color4 GetBarColour(OsuColour colours); protected abstract Color4 GetBarColour(OsuColour colours);