1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 10:12:54 +08:00

Merge branch 'master' into update-framework

This commit is contained in:
Dean Herbert 2019-01-07 18:51:54 +09:00 committed by GitHub
commit 49ba4e5a14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 15 additions and 21 deletions

View File

@ -2,7 +2,6 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Newtonsoft.Json; using Newtonsoft.Json;
using osu.Framework; using osu.Framework;
@ -77,10 +76,10 @@ namespace osu.Desktop.Updater
switch (RuntimeInfo.OS) switch (RuntimeInfo.OS)
{ {
case RuntimeInfo.Platform.Windows: case RuntimeInfo.Platform.Windows:
bestAsset = release.Assets?.FirstOrDefault(f => f.Name.EndsWith(".exe")); bestAsset = release.Assets?.Find(f => f.Name.EndsWith(".exe"));
break; break;
case RuntimeInfo.Platform.MacOsx: case RuntimeInfo.Platform.MacOsx:
bestAsset = release.Assets?.FirstOrDefault(f => f.Name.EndsWith(".app.zip")); bestAsset = release.Assets?.Find(f => f.Name.EndsWith(".app.zip"));
break; break;
} }

View File

@ -215,7 +215,7 @@ namespace osu.Game.Rulesets.Osu.Objects
var distanceProgress = d / length; var distanceProgress = d / length;
var timeProgress = reversed ? 1 - distanceProgress : distanceProgress; var timeProgress = reversed ? 1 - distanceProgress : distanceProgress;
var firstSample = Samples.FirstOrDefault(s => s.Name == SampleInfo.HIT_NORMAL) var firstSample = Samples.Find(s => s.Name == SampleInfo.HIT_NORMAL)
?? Samples.FirstOrDefault(); // TODO: remove this when guaranteed sort is present for samples (https://github.com/ppy/osu/issues/1933) ?? Samples.FirstOrDefault(); // TODO: remove this when guaranteed sort is present for samples (https://github.com/ppy/osu/issues/1933)
var sampleList = new List<SampleInfo>(); var sampleList = new List<SampleInfo>();

View File

@ -135,7 +135,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
{ {
if (userTriggered) if (userTriggered)
{ {
var nextTick = ticks.FirstOrDefault(j => !j.IsHit); var nextTick = ticks.Find(j => !j.IsHit);
nextTick?.TriggerResult(HitResult.Great); nextTick?.TriggerResult(HitResult.Great);

View File

@ -148,7 +148,7 @@ namespace osu.Game.Tests.Visual
private bool selectedBeatmapVisible() private bool selectedBeatmapVisible()
{ {
var currentlySelected = carousel.Items.FirstOrDefault(s => s.Item is CarouselBeatmap && s.Item.State == CarouselItemState.Selected); var currentlySelected = carousel.Items.Find(s => s.Item is CarouselBeatmap && s.Item.State == CarouselItemState.Selected);
if (currentlySelected == null) if (currentlySelected == null)
return true; return true;
return currentlySelected.Item.Visible; return currentlySelected.Item.Visible;

View File

@ -49,7 +49,6 @@ namespace osu.Game.Tests.Visual
manager.UnreadCount.ValueChanged += count => { displayedCount.Text = $"displayed count: {count}"; }; manager.UnreadCount.ValueChanged += count => { displayedCount.Text = $"displayed count: {count}"; };
setState(Visibility.Visible); setState(Visibility.Visible);
AddStep(@"simple #1", sendHelloNotification); AddStep(@"simple #1", sendHelloNotification);
AddStep(@"simple #2", sendAmazingNotification); AddStep(@"simple #2", sendAmazingNotification);
@ -75,7 +74,6 @@ namespace osu.Game.Tests.Visual
checkProgressingCount(0); checkProgressingCount(0);
setState(Visibility.Visible); setState(Visibility.Visible);
//AddStep(@"barrage", () => sendBarrage()); //AddStep(@"barrage", () => sendBarrage());
@ -111,7 +109,7 @@ namespace osu.Game.Tests.Visual
if (progressingNotifications.Count(n => n.State == ProgressNotificationState.Active) < 3) if (progressingNotifications.Count(n => n.State == ProgressNotificationState.Active) < 3)
{ {
var p = progressingNotifications.FirstOrDefault(n => n.State == ProgressNotificationState.Queued); var p = progressingNotifications.Find(n => n.State == ProgressNotificationState.Queued);
if (p != null) if (p != null)
p.State = ProgressNotificationState.Active; p.State = ProgressNotificationState.Active;
} }

View File

@ -36,7 +36,7 @@ namespace osu.Game.Beatmaps
public string Hash { get; set; } public string Hash { get; set; }
public string StoryboardFile => Files?.FirstOrDefault(f => f.Filename.EndsWith(".osb"))?.Filename; public string StoryboardFile => Files?.Find(f => f.Filename.EndsWith(".osb"))?.Filename;
public List<BeatmapSetFileInfo> Files { get; set; } public List<BeatmapSetFileInfo> Files { get; set; }

View File

@ -2,7 +2,6 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using osu.Framework.Configuration; using osu.Framework.Configuration;
using osu.Game.Rulesets; using osu.Game.Rulesets;
@ -43,7 +42,7 @@ namespace osu.Game.Configuration
{ {
base.AddBindable(lookup, bindable); base.AddBindable(lookup, bindable);
var setting = databasedSettings.FirstOrDefault(s => (int)s.Key == (int)(object)lookup); var setting = databasedSettings.Find(s => (int)s.Key == (int)(object)lookup);
if (setting != null) if (setting != null)
{ {
bindable.Parse(setting.Value); bindable.Parse(setting.Value);

View File

@ -222,7 +222,7 @@ namespace osu.Game
var databasedSet = BeatmapManager.QueryBeatmapSet(s => s.OnlineBeatmapSetID == beatmap.OnlineBeatmapSetID); var databasedSet = BeatmapManager.QueryBeatmapSet(s => s.OnlineBeatmapSetID == beatmap.OnlineBeatmapSetID);
// Use first beatmap available for current ruleset, else switch ruleset. // Use first beatmap available for current ruleset, else switch ruleset.
var first = databasedSet.Beatmaps.FirstOrDefault(b => b.Ruleset == ruleset.Value) ?? databasedSet.Beatmaps.First(); var first = databasedSet.Beatmaps.Find(b => b.Ruleset == ruleset.Value) ?? databasedSet.Beatmaps.First();
ruleset.Value = first.Ruleset; ruleset.Value = first.Ruleset;
Beatmap.Value = BeatmapManager.GetWorkingBeatmap(first); Beatmap.Value = BeatmapManager.GetWorkingBeatmap(first);

View File

@ -57,7 +57,7 @@ namespace osu.Game.Screens.Edit
// Depending on beatSnapLength, we may snap to a beat that is beyond timingPoint's end time, but we want to instead snap to // Depending on beatSnapLength, we may snap to a beat that is beyond timingPoint's end time, but we want to instead snap to
// the next timing point's start time // the next timing point's start time
var nextTimingPoint = ControlPointInfo.TimingPoints.FirstOrDefault(t => t.Time > timingPoint.Time); var nextTimingPoint = ControlPointInfo.TimingPoints.Find(t => t.Time > timingPoint.Time);
if (position > nextTimingPoint?.Time) if (position > nextTimingPoint?.Time)
position = nextTimingPoint.Time; position = nextTimingPoint.Time;
@ -123,7 +123,7 @@ namespace osu.Game.Screens.Edit
if (seekTime < timingPoint.Time && timingPoint != ControlPointInfo.TimingPoints.First()) if (seekTime < timingPoint.Time && timingPoint != ControlPointInfo.TimingPoints.First())
seekTime = timingPoint.Time; seekTime = timingPoint.Time;
var nextTimingPoint = ControlPointInfo.TimingPoints.FirstOrDefault(t => t.Time > timingPoint.Time); var nextTimingPoint = ControlPointInfo.TimingPoints.Find(t => t.Time > timingPoint.Time);
if (seekTime > nextTimingPoint?.Time) if (seekTime > nextTimingPoint?.Time)
seekTime = nextTimingPoint.Time; seekTime = nextTimingPoint.Time;

View File

@ -327,7 +327,7 @@ namespace osu.Game.Screens.Tournament
continue; continue;
// ReSharper disable once AccessToModifiedClosure // ReSharper disable once AccessToModifiedClosure
DrawingsTeam teamToAdd = allTeams.FirstOrDefault(t => t.FullName == line); DrawingsTeam teamToAdd = allTeams.Find(t => t.FullName == line);
if (teamToAdd == null) if (teamToAdd == null)
continue; continue;

View File

@ -102,7 +102,7 @@ namespace osu.Game.Skinning
string lastPiece = filename.Split('/').Last(); string lastPiece = filename.Split('/').Last();
var file = source.Files.FirstOrDefault(f => var file = source.Files.Find(f =>
string.Equals(hasExtension ? f.Filename : Path.ChangeExtension(f.Filename, null), lastPiece, StringComparison.InvariantCultureIgnoreCase)); string.Equals(hasExtension ? f.Filename : Path.ChangeExtension(f.Filename, null), lastPiece, StringComparison.InvariantCultureIgnoreCase));
return file?.FileInfo.StoragePath; return file?.FileInfo.StoragePath;
} }

View File

@ -6,7 +6,6 @@ using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Animations; using osu.Framework.Graphics.Animations;
using osu.Framework.Graphics.Textures; using osu.Framework.Graphics.Textures;
using System.Linq;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
namespace osu.Game.Storyboards.Drawables namespace osu.Game.Storyboards.Drawables
@ -71,7 +70,7 @@ namespace osu.Game.Storyboards.Drawables
{ {
var framePath = basePath.Replace(".", frame + "."); var framePath = basePath.Replace(".", frame + ".");
var path = beatmap.Value.BeatmapSetInfo.Files.FirstOrDefault(f => f.Filename.ToLowerInvariant() == framePath)?.FileInfo.StoragePath; var path = beatmap.Value.BeatmapSetInfo.Files.Find(f => f.Filename.ToLowerInvariant() == framePath)?.FileInfo.StoragePath;
if (path == null) if (path == null)
continue; continue;

View File

@ -6,7 +6,6 @@ using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Textures; using osu.Framework.Graphics.Textures;
using System.Linq;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
namespace osu.Game.Storyboards.Drawables namespace osu.Game.Storyboards.Drawables
@ -66,7 +65,7 @@ namespace osu.Game.Storyboards.Drawables
private void load(IBindableBeatmap beatmap, TextureStore textureStore) private void load(IBindableBeatmap beatmap, TextureStore textureStore)
{ {
var spritePath = Sprite.Path.ToLowerInvariant(); var spritePath = Sprite.Path.ToLowerInvariant();
var path = beatmap.Value.BeatmapSetInfo.Files.FirstOrDefault(f => f.Filename.ToLowerInvariant() == spritePath)?.FileInfo.StoragePath; var path = beatmap.Value.BeatmapSetInfo.Files.Find(f => f.Filename.ToLowerInvariant() == spritePath)?.FileInfo.StoragePath;
if (path == null) if (path == null)
return; return;