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

Convert delegate to local function.

This commit is contained in:
Huo Yaoyuan 2019-11-12 20:12:11 +08:00
parent 42a98c5d87
commit f3f5094c26
3 changed files with 6 additions and 7 deletions

View File

@ -170,7 +170,7 @@ csharp_style_deconstructed_variable_declaration = true:warning
#Style - other C# 7.x features
dotnet_style_prefer_inferred_tuple_names = true:warning
csharp_prefer_simple_default_expression = true:warning
csharp_style_pattern_local_over_anonymous_function = true:silent
csharp_style_pattern_local_over_anonymous_function = true:warning
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:silent
#Style - C# 8 features

View File

@ -1,7 +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.
using System;
using System.Linq;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
@ -93,7 +92,7 @@ namespace osu.Game.Screens.Menu
textFlow.AddParagraph("Things may not work as expected", t => t.Font = t.Font.With(size: 20));
textFlow.NewParagraph();
Action<SpriteText> format = t => t.Font = OsuFont.GetFont(size: 15, weight: FontWeight.SemiBold);
static void format(SpriteText t) => t.Font = OsuFont.GetFont(size: 15, weight: FontWeight.SemiBold);
textFlow.AddParagraph("Detailed bug reports are welcomed via github issues.", format);
textFlow.NewParagraph();

View File

@ -1,7 +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.
using System;
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore.Internal;
using osu.Framework.Allocation;
@ -77,12 +76,13 @@ namespace osu.Game.Screens.Multi.Ranking.Pages
private void scoresLoaded(IEnumerable<APIRoomScoreInfo> scores)
{
Action<SpriteText> gray = s => s.Colour = colours.GrayC;
Action<SpriteText> white = s =>
void gray(SpriteText s) => s.Colour = colours.GrayC;
void white(SpriteText s)
{
s.Font = s.Font.With(size: s.Font.Size * 1.4f);
s.Colour = colours.GrayF;
};
}
rankText.AddText(name + "\n", white);
rankText.AddText("You are placed ", gray);