1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 10:18:22 +08:00

Use Linq.Append and Prepend.

This commit is contained in:
Huo Yaoyuan 2018-04-02 12:06:34 +08:00
parent cc70f7182a
commit b842f682eb
9 changed files with 10 additions and 12 deletions

View File

@ -13,7 +13,7 @@ namespace osu.Game.Rulesets.Osu.Mods
{
public class OsuModAutoplay : ModAutoplay<OsuHitObject>
{
public override Type[] IncompatibleMods => base.IncompatibleMods.Concat(new[] { typeof(OsuModAutopilot), typeof(OsuModSpunOut) }).ToArray();
public override Type[] IncompatibleMods => base.IncompatibleMods.Append(typeof(OsuModAutopilot)).Append(typeof(OsuModSpunOut)).ToArray();
protected override Score CreateReplayScore(Beatmap<OsuHitObject> beatmap)
{

View File

@ -9,6 +9,6 @@ namespace osu.Game.Rulesets.Osu.Mods
{
public class OsuModNoFail : ModNoFail
{
public override Type[] IncompatibleMods => base.IncompatibleMods.Concat(new[] { typeof(OsuModAutopilot) }).ToArray();
public override Type[] IncompatibleMods => base.IncompatibleMods.Append(typeof(OsuModAutopilot)).ToArray();
}
}

View File

@ -10,6 +10,6 @@ namespace osu.Game.Rulesets.Osu.Mods
public class OsuModRelax : ModRelax
{
public override string Description => @"You don't need to click. Give your clicking/tapping fingers a break from the heat of things.";
public override Type[] IncompatibleMods => base.IncompatibleMods.Concat(new[] { typeof(OsuModAutopilot) }).ToArray();
public override Type[] IncompatibleMods => base.IncompatibleMods.Append(typeof(OsuModAutopilot)).ToArray();
}
}

View File

@ -9,6 +9,6 @@ namespace osu.Game.Rulesets.Osu.Mods
{
public class OsuModSuddenDeath : ModSuddenDeath
{
public override Type[] IncompatibleMods => base.IncompatibleMods.Concat(new[] { typeof(OsuModAutopilot) }).ToArray();
public override Type[] IncompatibleMods => base.IncompatibleMods.Append(typeof(OsuModAutopilot)).ToArray();
}
}

View File

@ -16,7 +16,7 @@ namespace osu.Game.Beatmaps.Formats
public TOutput Decode(StreamReader primaryStream, params StreamReader[] otherStreams)
{
var output = CreateTemplateObject();
foreach (StreamReader stream in new[] { primaryStream }.Concat(otherStreams))
foreach (StreamReader stream in otherStreams.Prepend(primaryStream))
ParseStreamInto(stream, output);
return output;
}

View File

@ -45,7 +45,7 @@ namespace osu.Game.Input.Bindings
};
protected override IEnumerable<Drawable> KeyBindingInputQueue =>
handler == null ? base.KeyBindingInputQueue : new[] { handler }.Concat(base.KeyBindingInputQueue);
handler == null ? base.KeyBindingInputQueue : base.KeyBindingInputQueue.Prepend(handler);
}
public enum GlobalAction

View File

@ -47,7 +47,7 @@ namespace osu.Game.Overlays.KeyBinding
private FillFlowContainer<KeyButton> buttons;
public IEnumerable<string> FilterTerms => new[] { text.Text }.Concat(bindings.Select(b => b.KeyCombination.ReadableString()));
public IEnumerable<string> FilterTerms => bindings.Select(b => b.KeyCombination.ReadableString()).Prepend(text.Text);
public KeyBindingRow(object action, IEnumerable<Framework.Input.Bindings.KeyBinding> bindings)
{

View File

@ -128,10 +128,8 @@ namespace osu.Game.Rulesets.Edit
selectionLayer.SelectionFinished += hitObjectMaskLayer.AddSelectionOverlay;
toolboxCollection.Items =
new[] { new RadioButton("Select", () => setCompositionTool(null)) }
.Concat(
CompositionTools.Select(t => new RadioButton(t.Name, () => setCompositionTool(t)))
)
CompositionTools.Select(t => new RadioButton(t.Name, () => setCompositionTool(t)))
.Prepend(new RadioButton("Select", () => setCompositionTool(null)))
.ToList();
toolboxCollection.Items[0].Select();

View File

@ -150,7 +150,7 @@ namespace osu.Game.Screens.Select
var mods = modSelect.SelectedMods.Value;
if (mods.All(m => m.GetType() != autoType))
{
modSelect.SelectedMods.Value = mods.Concat(new[] { auto });
modSelect.SelectedMods.Value = mods.Append(auto);
removeAutoModOnResume = true;
}
}