From 45af7969434d6216f71dc8da59759c3e33626986 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 30 Oct 2019 17:05:15 +0900 Subject: [PATCH] Remove usages of EF internals --- .../UserInterface/TestSceneBeatSyncedContainer.cs | 4 ++-- osu.Game/Screens/Edit/EditorClock.cs | 13 +++++++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/osu.Game.Tests/Visual/UserInterface/TestSceneBeatSyncedContainer.cs b/osu.Game.Tests/Visual/UserInterface/TestSceneBeatSyncedContainer.cs index b6df559686..ed44d82bce 100644 --- a/osu.Game.Tests/Visual/UserInterface/TestSceneBeatSyncedContainer.cs +++ b/osu.Game.Tests/Visual/UserInterface/TestSceneBeatSyncedContainer.cs @@ -3,7 +3,7 @@ using System; using System.Collections.Generic; -using Microsoft.EntityFrameworkCore.Internal; +using System.Linq; using NUnit.Framework; using osu.Framework.Allocation; using osu.Framework.Audio.Track; @@ -153,7 +153,7 @@ namespace osu.Game.Tests.Visual.UserInterface }; } - private IReadOnlyList timingPoints => Beatmap.Value.Beatmap.ControlPointInfo.TimingPoints; + private List timingPoints => Beatmap.Value.Beatmap.ControlPointInfo.TimingPoints.ToList(); private TimingControlPoint getNextTimingPoint(TimingControlPoint current) { diff --git a/osu.Game/Screens/Edit/EditorClock.cs b/osu.Game/Screens/Edit/EditorClock.cs index 1cfb123f25..f674a62a3a 100644 --- a/osu.Game/Screens/Edit/EditorClock.cs +++ b/osu.Game/Screens/Edit/EditorClock.cs @@ -3,7 +3,6 @@ using System; using System.Linq; -using Microsoft.EntityFrameworkCore.Internal; using osu.Framework.MathUtils; using osu.Framework.Timing; using osu.Game.Beatmaps; @@ -88,7 +87,17 @@ namespace osu.Game.Screens.Edit if (direction < 0 && timingPoint.Time == CurrentTime) { // When going backwards and we're at the boundary of two timing points, we compute the seek distance with the timing point which we are seeking into - int activeIndex = ControlPointInfo.TimingPoints.IndexOf(timingPoint); + int activeIndex = -1; + + for (int i = 0; i < ControlPointInfo.TimingPoints.Count; i++) + { + if (ControlPointInfo.TimingPoints[i] == timingPoint) + { + activeIndex = i; + break; + } + } + while (activeIndex > 0 && CurrentTime == timingPoint.Time) timingPoint = ControlPointInfo.TimingPoints[--activeIndex]; }