From 46c665cd2aed565be5b4bdd777256a01a91d7e7b Mon Sep 17 00:00:00 2001 From: MikiraSora Date: Tue, 27 Aug 2024 03:34:52 +0800 Subject: [PATCH] update --- .../Views/SvgPrefabView.xaml | 1 - .../Views/OngekiObjects/BeamEndView.xaml | 31 - .../Views/OngekiObjects/BeamEndView.xaml.cs | 10 - .../Views/OngekiObjects/BeamNextView.xaml | 24 - .../Views/OngekiObjects/BeamNextView.xaml.cs | 10 - .../Views/OngekiObjects/BeamStartView.xaml | 31 - .../Views/OngekiObjects/BeamStartView.xaml.cs | 10 - .../Views/OngekiObjects/LaneEndView.xaml | 28 - .../Views/OngekiObjects/LaneEndView.xaml.cs | 10 - .../Views/OngekiObjects/LaneNextView.xaml | 21 - .../Views/OngekiObjects/LaneNextView.xaml.cs | 10 - .../Views/OngekiObjects/LaneStartView.xaml | 28 - .../Views/OngekiObjects/LaneStartView.xaml.cs | 10 - .../Views/OngekiObjects/WallEndView.xaml | 31 - .../Views/OngekiObjects/WallEndView.xaml.cs | 10 - .../Views/OngekiObjects/WallNextView.xaml | 23 - .../Views/OngekiObjects/WallNextView.xaml.cs | 10 - .../Views/OngekiObjects/WallStartView.xaml | 31 - .../Views/OngekiObjects/WallStartView.xaml.cs | 10 - OngekiFumenEditor/OngekiFumenEditor.csproj | 1307 ++++++++--------- .../Parser/Ogkr/DefaultOngekiFumenParser.cs | 2 +- .../Views/FileInfoTypeUIView.xaml | 4 +- .../Views/RangeValueTypeUIView.xaml | 4 +- OngekiFumenEditor/Utils/MathUtils.cs | 553 +++---- 24 files changed, 945 insertions(+), 1264 deletions(-) delete mode 100644 OngekiFumenEditor/Modules/FumenVisualEditor/Views/OngekiObjects/BeamEndView.xaml delete mode 100644 OngekiFumenEditor/Modules/FumenVisualEditor/Views/OngekiObjects/BeamEndView.xaml.cs delete mode 100644 OngekiFumenEditor/Modules/FumenVisualEditor/Views/OngekiObjects/BeamNextView.xaml delete mode 100644 OngekiFumenEditor/Modules/FumenVisualEditor/Views/OngekiObjects/BeamNextView.xaml.cs delete mode 100644 OngekiFumenEditor/Modules/FumenVisualEditor/Views/OngekiObjects/BeamStartView.xaml delete mode 100644 OngekiFumenEditor/Modules/FumenVisualEditor/Views/OngekiObjects/BeamStartView.xaml.cs delete mode 100644 OngekiFumenEditor/Modules/FumenVisualEditor/Views/OngekiObjects/LaneEndView.xaml delete mode 100644 OngekiFumenEditor/Modules/FumenVisualEditor/Views/OngekiObjects/LaneEndView.xaml.cs delete mode 100644 OngekiFumenEditor/Modules/FumenVisualEditor/Views/OngekiObjects/LaneNextView.xaml delete mode 100644 OngekiFumenEditor/Modules/FumenVisualEditor/Views/OngekiObjects/LaneNextView.xaml.cs delete mode 100644 OngekiFumenEditor/Modules/FumenVisualEditor/Views/OngekiObjects/LaneStartView.xaml delete mode 100644 OngekiFumenEditor/Modules/FumenVisualEditor/Views/OngekiObjects/LaneStartView.xaml.cs delete mode 100644 OngekiFumenEditor/Modules/FumenVisualEditor/Views/OngekiObjects/WallEndView.xaml delete mode 100644 OngekiFumenEditor/Modules/FumenVisualEditor/Views/OngekiObjects/WallEndView.xaml.cs delete mode 100644 OngekiFumenEditor/Modules/FumenVisualEditor/Views/OngekiObjects/WallNextView.xaml delete mode 100644 OngekiFumenEditor/Modules/FumenVisualEditor/Views/OngekiObjects/WallNextView.xaml.cs delete mode 100644 OngekiFumenEditor/Modules/FumenVisualEditor/Views/OngekiObjects/WallStartView.xaml delete mode 100644 OngekiFumenEditor/Modules/FumenVisualEditor/Views/OngekiObjects/WallStartView.xaml.cs diff --git a/OngekiFumenEditor/Modules/EditorSvgObjectControlProvider/Views/SvgPrefabView.xaml b/OngekiFumenEditor/Modules/EditorSvgObjectControlProvider/Views/SvgPrefabView.xaml index 12ab9d78..31ab9417 100644 --- a/OngekiFumenEditor/Modules/EditorSvgObjectControlProvider/Views/SvgPrefabView.xaml +++ b/OngekiFumenEditor/Modules/EditorSvgObjectControlProvider/Views/SvgPrefabView.xaml @@ -6,7 +6,6 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:ongekiobjects="clr-namespace:OngekiFumenEditor.Modules.FumenVisualEditor.Views" xmlns:viewModels="clr-namespace:OngekiFumenEditor.Modules.EditorSvgObjectControlProvider.ViewModels" - d:DataContext="{d:DesignInstance Type=viewModels:SvgPrefabViewModel}" mc:Ignorable="d"> - - - - - - - - - E - - - diff --git a/OngekiFumenEditor/Modules/FumenVisualEditor/Views/OngekiObjects/BeamEndView.xaml.cs b/OngekiFumenEditor/Modules/FumenVisualEditor/Views/OngekiObjects/BeamEndView.xaml.cs deleted file mode 100644 index 8a318541..00000000 --- a/OngekiFumenEditor/Modules/FumenVisualEditor/Views/OngekiObjects/BeamEndView.xaml.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace OngekiFumenEditor.Modules.FumenVisualEditor.Views.OngekiObjects -{ - public partial class BeamEndView : OngekiObjectViewBase - { - public BeamEndView() - { - InitializeComponent(); - } - } -} diff --git a/OngekiFumenEditor/Modules/FumenVisualEditor/Views/OngekiObjects/BeamNextView.xaml b/OngekiFumenEditor/Modules/FumenVisualEditor/Views/OngekiObjects/BeamNextView.xaml deleted file mode 100644 index 789f5ec1..00000000 --- a/OngekiFumenEditor/Modules/FumenVisualEditor/Views/OngekiObjects/BeamNextView.xaml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - diff --git a/OngekiFumenEditor/Modules/FumenVisualEditor/Views/OngekiObjects/BeamNextView.xaml.cs b/OngekiFumenEditor/Modules/FumenVisualEditor/Views/OngekiObjects/BeamNextView.xaml.cs deleted file mode 100644 index e60f29ee..00000000 --- a/OngekiFumenEditor/Modules/FumenVisualEditor/Views/OngekiObjects/BeamNextView.xaml.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace OngekiFumenEditor.Modules.FumenVisualEditor.Views.OngekiObjects -{ - public partial class BeamNextView : OngekiObjectViewBase - { - public BeamNextView() - { - InitializeComponent(); - } - } -} diff --git a/OngekiFumenEditor/Modules/FumenVisualEditor/Views/OngekiObjects/BeamStartView.xaml b/OngekiFumenEditor/Modules/FumenVisualEditor/Views/OngekiObjects/BeamStartView.xaml deleted file mode 100644 index 75c5c227..00000000 --- a/OngekiFumenEditor/Modules/FumenVisualEditor/Views/OngekiObjects/BeamStartView.xaml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - S - - - diff --git a/OngekiFumenEditor/Modules/FumenVisualEditor/Views/OngekiObjects/BeamStartView.xaml.cs b/OngekiFumenEditor/Modules/FumenVisualEditor/Views/OngekiObjects/BeamStartView.xaml.cs deleted file mode 100644 index 1a83c852..00000000 --- a/OngekiFumenEditor/Modules/FumenVisualEditor/Views/OngekiObjects/BeamStartView.xaml.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace OngekiFumenEditor.Modules.FumenVisualEditor.Views.OngekiObjects -{ - public partial class BeamStartView : OngekiObjectViewBase - { - public BeamStartView() - { - InitializeComponent(); - } - } -} diff --git a/OngekiFumenEditor/Modules/FumenVisualEditor/Views/OngekiObjects/LaneEndView.xaml b/OngekiFumenEditor/Modules/FumenVisualEditor/Views/OngekiObjects/LaneEndView.xaml deleted file mode 100644 index c50d31bc..00000000 --- a/OngekiFumenEditor/Modules/FumenVisualEditor/Views/OngekiObjects/LaneEndView.xaml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - E - - - diff --git a/OngekiFumenEditor/Modules/FumenVisualEditor/Views/OngekiObjects/LaneEndView.xaml.cs b/OngekiFumenEditor/Modules/FumenVisualEditor/Views/OngekiObjects/LaneEndView.xaml.cs deleted file mode 100644 index 47ad2f59..00000000 --- a/OngekiFumenEditor/Modules/FumenVisualEditor/Views/OngekiObjects/LaneEndView.xaml.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace OngekiFumenEditor.Modules.FumenVisualEditor.Views.OngekiObjects -{ - public partial class LaneEndView : OngekiObjectViewBase - { - public LaneEndView() - { - InitializeComponent(); - } - } -} diff --git a/OngekiFumenEditor/Modules/FumenVisualEditor/Views/OngekiObjects/LaneNextView.xaml b/OngekiFumenEditor/Modules/FumenVisualEditor/Views/OngekiObjects/LaneNextView.xaml deleted file mode 100644 index c4d89cfa..00000000 --- a/OngekiFumenEditor/Modules/FumenVisualEditor/Views/OngekiObjects/LaneNextView.xaml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - diff --git a/OngekiFumenEditor/Modules/FumenVisualEditor/Views/OngekiObjects/LaneNextView.xaml.cs b/OngekiFumenEditor/Modules/FumenVisualEditor/Views/OngekiObjects/LaneNextView.xaml.cs deleted file mode 100644 index 7965206e..00000000 --- a/OngekiFumenEditor/Modules/FumenVisualEditor/Views/OngekiObjects/LaneNextView.xaml.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace OngekiFumenEditor.Modules.FumenVisualEditor.Views.OngekiObjects -{ - public partial class LaneNextView : OngekiObjectViewBase - { - public LaneNextView() - { - InitializeComponent(); - } - } -} diff --git a/OngekiFumenEditor/Modules/FumenVisualEditor/Views/OngekiObjects/LaneStartView.xaml b/OngekiFumenEditor/Modules/FumenVisualEditor/Views/OngekiObjects/LaneStartView.xaml deleted file mode 100644 index 964cb2de..00000000 --- a/OngekiFumenEditor/Modules/FumenVisualEditor/Views/OngekiObjects/LaneStartView.xaml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - S - - - diff --git a/OngekiFumenEditor/Modules/FumenVisualEditor/Views/OngekiObjects/LaneStartView.xaml.cs b/OngekiFumenEditor/Modules/FumenVisualEditor/Views/OngekiObjects/LaneStartView.xaml.cs deleted file mode 100644 index 9db56f29..00000000 --- a/OngekiFumenEditor/Modules/FumenVisualEditor/Views/OngekiObjects/LaneStartView.xaml.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace OngekiFumenEditor.Modules.FumenVisualEditor.Views.OngekiObjects -{ - public partial class LaneStartView : OngekiObjectViewBase - { - public LaneStartView() - { - InitializeComponent(); - } - } -} diff --git a/OngekiFumenEditor/Modules/FumenVisualEditor/Views/OngekiObjects/WallEndView.xaml b/OngekiFumenEditor/Modules/FumenVisualEditor/Views/OngekiObjects/WallEndView.xaml deleted file mode 100644 index 40badd35..00000000 --- a/OngekiFumenEditor/Modules/FumenVisualEditor/Views/OngekiObjects/WallEndView.xaml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - E - - - diff --git a/OngekiFumenEditor/Modules/FumenVisualEditor/Views/OngekiObjects/WallEndView.xaml.cs b/OngekiFumenEditor/Modules/FumenVisualEditor/Views/OngekiObjects/WallEndView.xaml.cs deleted file mode 100644 index c97c9111..00000000 --- a/OngekiFumenEditor/Modules/FumenVisualEditor/Views/OngekiObjects/WallEndView.xaml.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace OngekiFumenEditor.Modules.FumenVisualEditor.Views.OngekiObjects -{ - public partial class WallEndView : OngekiObjectViewBase - { - public WallEndView() - { - InitializeComponent(); - } - } -} diff --git a/OngekiFumenEditor/Modules/FumenVisualEditor/Views/OngekiObjects/WallNextView.xaml b/OngekiFumenEditor/Modules/FumenVisualEditor/Views/OngekiObjects/WallNextView.xaml deleted file mode 100644 index 96341550..00000000 --- a/OngekiFumenEditor/Modules/FumenVisualEditor/Views/OngekiObjects/WallNextView.xaml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - diff --git a/OngekiFumenEditor/Modules/FumenVisualEditor/Views/OngekiObjects/WallNextView.xaml.cs b/OngekiFumenEditor/Modules/FumenVisualEditor/Views/OngekiObjects/WallNextView.xaml.cs deleted file mode 100644 index 084a836c..00000000 --- a/OngekiFumenEditor/Modules/FumenVisualEditor/Views/OngekiObjects/WallNextView.xaml.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace OngekiFumenEditor.Modules.FumenVisualEditor.Views.OngekiObjects -{ - public partial class WallNextView : OngekiObjectViewBase - { - public WallNextView() - { - InitializeComponent(); - } - } -} diff --git a/OngekiFumenEditor/Modules/FumenVisualEditor/Views/OngekiObjects/WallStartView.xaml b/OngekiFumenEditor/Modules/FumenVisualEditor/Views/OngekiObjects/WallStartView.xaml deleted file mode 100644 index c0554409..00000000 --- a/OngekiFumenEditor/Modules/FumenVisualEditor/Views/OngekiObjects/WallStartView.xaml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - S - - - diff --git a/OngekiFumenEditor/Modules/FumenVisualEditor/Views/OngekiObjects/WallStartView.xaml.cs b/OngekiFumenEditor/Modules/FumenVisualEditor/Views/OngekiObjects/WallStartView.xaml.cs deleted file mode 100644 index c0549cf8..00000000 --- a/OngekiFumenEditor/Modules/FumenVisualEditor/Views/OngekiObjects/WallStartView.xaml.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace OngekiFumenEditor.Modules.FumenVisualEditor.Views.OngekiObjects -{ - public partial class WallStartView : OngekiObjectViewBase - { - public WallStartView() - { - InitializeComponent(); - } - } -} diff --git a/OngekiFumenEditor/OngekiFumenEditor.csproj b/OngekiFumenEditor/OngekiFumenEditor.csproj index 9841aed4..e44354a0 100644 --- a/OngekiFumenEditor/OngekiFumenEditor.csproj +++ b/OngekiFumenEditor/OngekiFumenEditor.csproj @@ -1,687 +1,658 @@ - + - - Exe - net7.0-windows - true - true - embedded - preview - Resources\Icons\logo.ico - true - OngekiFumenEditor.Startup - + + Exe + net7.0-windows + true + true + embedded + preview + Resources\Icons\logo.ico + true + OngekiFumenEditor.Startup + - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + - - - - - - - all - runtime;compile; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - - + + + + + + + all + runtime;compile; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + - - - - - all - - - all - - - all - - - all - - + + + all + + + all + + + all + + + all + + + all + + + all + + - - - Dependencies\AcbGeneratorFuck\AcbGeneratorFuck.dll - - - Dependencies\DereTore\DereTore.Common.dll - - - Dependencies\DereTore\DereTore.Common.StarlightStage.dll - - - Dependencies\DereTore\DereTore.Exchange.Archive.ACB.dll - - - Dependencies\DereTore\DereTore.Exchange.Audio.HCA.dll - - - Dependencies\DereTore\DereTore.Interop.OS.dll - - - Dependencies\JacketGenerator\TexturePlugin.dll - - + + + Dependencies\AcbGeneratorFuck\AcbGeneratorFuck.dll + + + Dependencies\DereTore\DereTore.Common.dll + + + Dependencies\DereTore\DereTore.Common.StarlightStage.dll + + + Dependencies\DereTore\DereTore.Exchange.Archive.ACB.dll + + + Dependencies\DereTore\DereTore.Exchange.Audio.HCA.dll + + + Dependencies\DereTore\DereTore.Interop.OS.dll + + + Dependencies\JacketGenerator\TexturePlugin.dll + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - True - OptionGeneratorToolsSetting.settings - True - - - True - ProgramSetting.settings - True - - - True - True - Resources.resx - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - True - AudioPlayerToolViewerSetting.settings - True - - - True - True - AudioSetting.settings - - - True - True - EditorGlobalSetting.settings - - - True - True - LogSetting.settings - - - Code - - + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + True + OptionGeneratorToolsSetting.settings + True + + + True + ProgramSetting.settings + True + + + True + True + Resources.resx + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + True + AudioPlayerToolViewerSetting.settings + True + + + True + True + AudioSetting.settings + + + True + True + EditorGlobalSetting.settings + + + True + True + LogSetting.settings + + + Code + + - - - AudioPlayerToolViewerSetting.Designer.cs - PublicSettingsSingleFileGenerator - - - OptionGeneratorToolsSetting.Designer.cs - PublicSettingsSingleFileGenerator - - - PublicSettingsSingleFileGenerator - AudioSetting.Designer.cs - - - PublicSettingsSingleFileGenerator - EditorGlobalSetting.Designer.cs - - - ProgramSetting.Designer.cs - PublicSettingsSingleFileGenerator - - - PublicSettingsSingleFileGenerator - LogSetting.Designer.cs - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - + + + AudioPlayerToolViewerSetting.Designer.cs + PublicSettingsSingleFileGenerator + + + OptionGeneratorToolsSetting.Designer.cs + PublicSettingsSingleFileGenerator + + + PublicSettingsSingleFileGenerator + AudioSetting.Designer.cs + + + PublicSettingsSingleFileGenerator + EditorGlobalSetting.Designer.cs + + + ProgramSetting.Designer.cs + PublicSettingsSingleFileGenerator + + + PublicSettingsSingleFileGenerator + LogSetting.Designer.cs + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + - - - $(DefaultXamlRuntime) - - - $(DefaultXamlRuntime) - - - $(DefaultXamlRuntime) - Designer - - - $(DefaultXamlRuntime) - - - $(DefaultXamlRuntime) - Designer - - - $(DefaultXamlRuntime) - Designer - - - $(DefaultXamlRuntime) - Designer - - - $(DefaultXamlRuntime) - Designer - - - $(DefaultXamlRuntime) - Designer - - - $(DefaultXamlRuntime) - Designer - - - $(DefaultXamlRuntime) - - - $(DefaultXamlRuntime) - - - $(DefaultXamlRuntime) - - - $(DefaultXamlRuntime) - - - $(DefaultXamlRuntime) - - - $(DefaultXamlRuntime) - - - $(DefaultXamlRuntime) - - - $(DefaultXamlRuntime) - - - $(DefaultXamlRuntime) - Designer - - - $(DefaultXamlRuntime) - Designer - - - $(DefaultXamlRuntime) - Designer - - - $(DefaultXamlRuntime) - Designer - - - $(DefaultXamlRuntime) - Designer - - - $(DefaultXamlRuntime) - - - $(DefaultXamlRuntime) - Designer - - - $(DefaultXamlRuntime) - Designer - - - $(DefaultXamlRuntime) - Designer - - - $(DefaultXamlRuntime) - Designer - - - $(DefaultXamlRuntime) - Designer - - - $(DefaultXamlRuntime) - Designer - - - $(DefaultXamlRuntime) - Designer - - - $(DefaultXamlRuntime) - Designer - - - $(DefaultXamlRuntime) - Designer - - - $(DefaultXamlRuntime) - Designer - - - $(DefaultXamlRuntime) - - - $(DefaultXamlRuntime) - - - $(DefaultXamlRuntime) - Designer - - - $(DefaultXamlRuntime) - Designer - - - $(DefaultXamlRuntime) - Designer - - - $(DefaultXamlRuntime) - Designer - - - $(DefaultXamlRuntime) - Designer - - - $(DefaultXamlRuntime) - Designer - - - $(DefaultXamlRuntime) - Designer - - - $(DefaultXamlRuntime) - Designer - - - $(DefaultXamlRuntime) - - - $(DefaultXamlRuntime) - - - $(DefaultXamlRuntime) - - - $(DefaultXamlRuntime) - Designer - - + + + $(DefaultXamlRuntime) + + + $(DefaultXamlRuntime) + + + $(DefaultXamlRuntime) + Designer + + + $(DefaultXamlRuntime) + + + $(DefaultXamlRuntime) + Designer + + + $(DefaultXamlRuntime) + Designer + + + $(DefaultXamlRuntime) + Designer + + + $(DefaultXamlRuntime) + Designer + + + $(DefaultXamlRuntime) + Designer + + + $(DefaultXamlRuntime) + Designer + + + $(DefaultXamlRuntime) + + + $(DefaultXamlRuntime) + + + $(DefaultXamlRuntime) + + + $(DefaultXamlRuntime) + + + $(DefaultXamlRuntime) + + + $(DefaultXamlRuntime) + + + $(DefaultXamlRuntime) + + + $(DefaultXamlRuntime) + + + $(DefaultXamlRuntime) + Designer + + + $(DefaultXamlRuntime) + Designer + + + $(DefaultXamlRuntime) + Designer + + + $(DefaultXamlRuntime) + Designer + + + $(DefaultXamlRuntime) + Designer + + + $(DefaultXamlRuntime) + + + $(DefaultXamlRuntime) + Designer + + + $(DefaultXamlRuntime) + Designer + + + $(DefaultXamlRuntime) + Designer + + + $(DefaultXamlRuntime) + Designer + + + $(DefaultXamlRuntime) + Designer + + + $(DefaultXamlRuntime) + Designer + + + $(DefaultXamlRuntime) + Designer + + + $(DefaultXamlRuntime) + Designer + + + $(DefaultXamlRuntime) + Designer + + + $(DefaultXamlRuntime) + Designer + + + $(DefaultXamlRuntime) + Designer + + + $(DefaultXamlRuntime) + Designer + + + $(DefaultXamlRuntime) + Designer + + + $(DefaultXamlRuntime) + + + $(DefaultXamlRuntime) + Designer + + - - - + + + - - - + + + - - - Resources.zh-Hans.Designer.cs - PublicResXFileCodeGenerator - - - Resources.ja.Designer.cs - PublicResXFileCodeGenerator - - - PublicResXFileCodeGenerator - Resources.Designer.cs - - + + + Resources.zh-Hans.Designer.cs + PublicResXFileCodeGenerator + + + Resources.ja.Designer.cs + PublicResXFileCodeGenerator + + + PublicResXFileCodeGenerator + Resources.Designer.cs + + - - + + + + + + + diff --git a/OngekiFumenEditor/Parser/Ogkr/DefaultOngekiFumenParser.cs b/OngekiFumenEditor/Parser/Ogkr/DefaultOngekiFumenParser.cs index 280c3ff1..a9187f54 100644 --- a/OngekiFumenEditor/Parser/Ogkr/DefaultOngekiFumenParser.cs +++ b/OngekiFumenEditor/Parser/Ogkr/DefaultOngekiFumenParser.cs @@ -15,7 +15,7 @@ public class DefaultOngekiFumenParser : IFumenDeserializable public static readonly string[] FumenFileExtensions = new[] { ".ogkr" }; - public const string FormatName = "OngekiFumenFile"; + public const string FormatName = "Ongeki Fumen File"; public string[] SupportFumenFileExtensions => FumenFileExtensions; diff --git a/OngekiFumenEditor/UI/Controls/ObjectInspector/Views/FileInfoTypeUIView.xaml b/OngekiFumenEditor/UI/Controls/ObjectInspector/Views/FileInfoTypeUIView.xaml index 1d2cd037..36d1478d 100644 --- a/OngekiFumenEditor/UI/Controls/ObjectInspector/Views/FileInfoTypeUIView.xaml +++ b/OngekiFumenEditor/UI/Controls/ObjectInspector/Views/FileInfoTypeUIView.xaml @@ -7,9 +7,9 @@ xmlns:gemini="http://schemas.timjones.io/gemini" xmlns:local="clr-namespace:OngekiFumenEditor.Modules.FumenObjectPropertyBrowser.Views" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - xmlns:vm="clr-namespace:OngekiFumenEditor.Modules.FumenObjectPropertyBrowser.ViewModels" + xmlns:viewModels="clr-namespace:OngekiFumenEditor.UI.Controls.ObjectInspector.ViewModels" d:Background="White" - d:DataContext="{d:DesignInstance Type=vm:FileInfoTypeUIViewModel}" + d:DataContext="{d:DesignInstance Type=viewModels:FileInfoTypeUIViewModel}" mc:Ignorable="d"> diff --git a/OngekiFumenEditor/Utils/MathUtils.cs b/OngekiFumenEditor/Utils/MathUtils.cs index 2aeeb88d..55774c69 100644 --- a/OngekiFumenEditor/Utils/MathUtils.cs +++ b/OngekiFumenEditor/Utils/MathUtils.cs @@ -1,329 +1,378 @@ -using IntervalTree; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.CompilerServices; +using IntervalTree; using OngekiFumenEditor.Base; using OngekiFumenEditor.Base.Collections; -using OngekiFumenEditor.Base.Collections.Base; using OngekiFumenEditor.Base.OngekiObjects; using OngekiFumenEditor.Modules.FumenVisualEditor; using OngekiFumenEditor.Modules.FumenVisualEditor.ViewModels; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Runtime.CompilerServices; -namespace OngekiFumenEditor.Utils +namespace OngekiFumenEditor.Utils; + +public static class MathUtils { - public static class MathUtils + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double Random() { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static double Random() => RandomHepler.RandomDouble(); - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static int Random(int min, int max) => RandomHepler.Random(min, max); - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static int Random(int max) => RandomHepler.Random(max); - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static double Normalize(double from, double to, double cur) - { - var duration = to - from; - var normalized = (cur - from) / duration; - return normalized; - } + return RandomHepler.RandomDouble(); + } - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static int LCM(int a, int b) - { - return a / GCD(a, b) * b; - } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int Random(int min, int max) + { + return RandomHepler.Random(min, max); + } - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static int GCD(int a, int b) + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int Random(int max) + { + return RandomHepler.Random(max); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double Normalize(double from, double to, double cur) + { + var duration = to - from; + var normalized = (cur - from) / duration; + return normalized; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int LCM(int a, int b) + { + return a / GCD(a, b) * b; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int GCD(int a, int b) + { + return b == 0 ? a : GCD(b, a % b); + } + + public static double CalculateLength(TGrid from, TGrid to, BpmList bpmList) + { + var fromBpm = bpmList.GetBpm(from); + var toBpm = bpmList.GetBpm(to); + + if (fromBpm == toBpm) { - return b == 0 ? a : GCD(b, a % b); + return CalculateBPMLength(fromBpm, to); } - public static double CalculateLength(TGrid from, TGrid to, BpmList bpmList) + var nextBpm = bpmList.GetNextBpm(fromBpm); + var pre = CalculateBPMLength(from, nextBpm.TGrid, fromBpm.BPM); + var aft = CalculateBPMLength(toBpm.TGrid, to, toBpm.BPM); + + var mid = 0d; + var cur = nextBpm; + while (cur != toBpm) { - var fromBpm = bpmList.GetBpm(from); - var toBpm = bpmList.GetBpm(to); + nextBpm = bpmList.GetNextBpm(cur); - if (fromBpm == toBpm) - { - return CalculateBPMLength(fromBpm, to); - } - else - { - var nextBpm = bpmList.GetNextBpm(fromBpm); - var pre = CalculateBPMLength(from, nextBpm.TGrid, fromBpm.BPM); - var aft = CalculateBPMLength(toBpm.TGrid, to, toBpm.BPM); + //calc len + mid += CalculateBPMLength(cur.TGrid, nextBpm.TGrid, cur.BPM); - var mid = 0d; - var cur = nextBpm; - while (cur != toBpm) - { - nextBpm = bpmList.GetNextBpm(cur); + cur = nextBpm; + } - //calc len - mid += CalculateBPMLength(cur.TGrid, nextBpm.TGrid, cur.BPM); + return pre + mid + aft; + } - cur = nextBpm; - } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float RadianToAngle(float radian) + { + return radian * 180 / MathF.PI; + } - return pre + mid + aft; - } - } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float AngleToRadian(float angle) + { + return angle * MathF.PI / 180; + } - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static float RadianToAngle(float radian) - => radian * 180 / MathF.PI; + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double CalculateLength(XGrid from, XGrid to, double unitLen) + { + return (to.TotalUnit - from.TotalUnit) * unitLen; + } - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static float AngleToRadian(float angle) - => angle * MathF.PI / 180; + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double CalculateBPMLength(BPMChange from, BPMChange to) + { + return CalculateBPMLength(from, to.TGrid); + } - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static double CalculateLength(XGrid from, XGrid to, double unitLen) - => (to.TotalUnit - from.TotalUnit) * unitLen; + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double CalculateBPMLength(BPMChange from, TGrid to) + { + return CalculateBPMLength(from.TGrid, to, from.BPM); + } - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static double CalculateBPMLength(BPMChange from, BPMChange to) - => CalculateBPMLength(from, to.TGrid); + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double CalculateBPMLength(TGrid from, TGrid to, double bpm) + { + if (to is null) + return double.PositiveInfinity; + var msec = CalculateBPMLength(from.TotalUnit, to.TotalUnit, bpm); + return msec; + } - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static double CalculateBPMLength(BPMChange from, TGrid to) - => CalculateBPMLength(from.TGrid, to, from.BPM); + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double CalculateBPMLength(double fromTGridUnit, double toTGridUnit, double bpm, + uint resT = TGrid.DEFAULT_RES_T, uint timeT = 240_000) + { + /* + var size = bpm / 240 * timeGridSize; + + /** + * 比如from是unit=50 grid=500 bpm = 240 resT=1000 + * to是unit=51 grid=0 bpm = 480 + * timeGridSize是1000 + * 那么 + * len = ((51 - 50) + (0 - 500) / 1000) * (240 / 240 * 1000) + * = (-500.0/1000 + 1) * 1000 + * = 0.5 * 1000 + * = 500 + * + var diff = to - from; + return (diff.Unit + diff.Grid * 1.0 / from.ResT) * size; + */ + + var diffGridUnit = toTGridUnit - fromTGridUnit; + var totalGrid = diffGridUnit * resT; + var msec = timeT * totalGrid / (resT * bpm); + return msec; + } - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static double CalculateBPMLength(TGrid from, TGrid to, double bpm) + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static double Limit(double val, double min, double max) + { + if (min > max) { - if (to is null) - return double.PositiveInfinity; - var msec = CalculateBPMLength(from.TotalUnit, to.TotalUnit, bpm); - return msec; + var t = min; + min = max; + max = t; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static double CalculateBPMLength(double fromTGridUnit, double toTGridUnit, double bpm, uint resT = TGrid.DEFAULT_RES_T) - { - /* - var size = bpm / 240 * timeGridSize; - - /** - * 比如from是unit=50 grid=500 bpm = 240 resT=1000 - * to是unit=51 grid=0 bpm = 480 - * timeGridSize是1000 - * 那么 - * len = ((51 - 50) + (0 - 500) / 1000) * (240 / 240 * 1000) - * = (-500.0/1000 + 1) * 1000 - * = 0.5 * 1000 - * = 500 - * - var diff = to - from; - return (diff.Unit + diff.Grid * 1.0 / from.ResT) * size; - */ - - var diffGridUnit = toTGridUnit - fromTGridUnit; - var totalGrid = diffGridUnit * resT; - var msec = 240_000 * totalGrid / (resT * bpm); - return msec; - } + return Math.Max(Math.Min(val, max), min); + } - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static double Limit(double val, double min, double max) - { - if (min > max) - { - var t = min; - min = max; - max = t; - } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Func BuildTwoPointFormFormula(double x1, double y1, double x2, double y2) + { + var by = y2 - y1; + var bx = x2 - x1; - return Math.Max(Math.Min(val, max), min); - } + if (by == 0) + return y => x1; - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Func BuildTwoPointFormFormula(double x1, double y1, double x2, double y2) - { - var by = y2 - y1; - var bx = x2 - x1; + return y => (y - y1) * 1.0 / by * bx + x1; + } - if (by == 0) - return y => x1; + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double CalculateXFromTwoPointFormFormula(double y, double x1, double y1, double x2, double y2) + { + var by = y2 - y1; + var bx = x2 - x1; - return y => (y - y1) * 1.0 / by * bx + x1; - } + if (by == 0) + return x1; - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static double CalculateXFromTwoPointFormFormula(double y, double x1, double y1, double x2, double y2) - { - var by = y2 - y1; - var bx = x2 - x1; + return (y - y1) * 1.0 / by * bx + x1; + } - if (by == 0) - return x1; + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double CalculateYFromTwoPointFormFormula(double x, double x1, double y1, double x2, double y2) + { + var by = y2 - y1; + var bx = x2 - x1; - return (y - y1) * 1.0 / by * bx + x1; - } + if (by == 0) + return y1; - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static double CalculateYFromTwoPointFormFormula(double x, double x1, double y1, double x2, double y2) - { - var by = y2 - y1; - var bx = x2 - x1; + return (x - x1) / bx * by + y1; + } - if (by == 0) - return y1; + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool IsInRange(double start1, double end1, double start2, double end2) + { + return (start1 <= end2 && start2 <= end1) || (start2 <= end1 && start1 <= end2); + } - return (x - x1) / bx * by + y1; - } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool IsInRange(TimeSpan start1, TimeSpan end1, TimeSpan start2, TimeSpan end2) + { + return (start1 <= end2 && start2 <= end1) || (start2 <= end1 && start1 <= end2); + } - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool IsInRange(double start1, double end1, double start2, double end2) => (start1 <= end2 && start2 <= end1) || (start2 <= end1 && start1 <= end2); - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool IsInRange(TimeSpan start1, TimeSpan end1, TimeSpan start2, TimeSpan end2) => (start1 <= end2 && start2 <= end1) || (start2 <= end1 && start1 <= end2); - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static double CalculateXFromBetweenObjects(T from, T to, FumenVisualEditorViewModel editor, TGrid tGrid) where T : IHorizonPositionObject, ITimelineObject - => CalculateXFromBetweenObjects(from.TGrid, from.XGrid, to.TGrid, to.XGrid, editor, tGrid); + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static double CalculateXFromBetweenObjects(T from, T to, FumenVisualEditorViewModel editor, TGrid tGrid) + where T : IHorizonPositionObject, ITimelineObject + { + return CalculateXFromBetweenObjects(from.TGrid, from.XGrid, to.TGrid, to.XGrid, editor, tGrid); + } - public static XGrid CalculateXGridFromBetweenObjects(TGrid fromTGrid, XGrid fromXGrid, TGrid toTGrid, XGrid toXGrid, TGrid tGrid) - { - var timeX = CalculateXFromTwoPointFormFormula(tGrid.TotalGrid, fromXGrid.TotalGrid, fromTGrid.TotalGrid, toXGrid.TotalGrid, toTGrid.TotalGrid); - var xGrid = new XGrid((float)(timeX / fromXGrid.ResX), 0); - xGrid.NormalizeSelf(); + public static XGrid CalculateXGridFromBetweenObjects(TGrid fromTGrid, XGrid fromXGrid, TGrid toTGrid, XGrid toXGrid, + TGrid tGrid) + { + var timeX = CalculateXFromTwoPointFormFormula(tGrid.TotalGrid, fromXGrid.TotalGrid, fromTGrid.TotalGrid, + toXGrid.TotalGrid, toTGrid.TotalGrid); + var xGrid = new XGrid((float) (timeX / fromXGrid.ResX)); + xGrid.NormalizeSelf(); + + return xGrid; + } + + public static double CalculateXFromBetweenObjects(TGrid fromTGrid, XGrid fromXGrid, TGrid toTGrid, XGrid toXGrid, + FumenVisualEditorViewModel editor, TGrid tGrid) + { + var xGrid = CalculateXGridFromBetweenObjects(fromTGrid, fromXGrid, toTGrid, toXGrid, tGrid); + var timeX = XGridCalculator.ConvertXGridToX(xGrid, editor); + return timeX; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float calcGradient(float x1, float y1, float x2, float y2) + { + if (y1 == y2) + return float.MaxValue; + + return (y1 - y2) / (x1 - x2); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static T Max(T a, T b) where T : GridBase + { + return a > b ? a : b; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static T Min(T a, T b) where T : GridBase + { + return a > b ? b : a; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static TimeSpan Max(TimeSpan a, TimeSpan b) + { + return a > b ? a : b; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static TimeSpan Min(TimeSpan a, TimeSpan b) + { + return a > b ? b : a; + } + + public static IEnumerable GetIntegersBetweenTwoValues(double from, double to) + { + var sign = Math.Sign(to - from); + var begin = 0; + var end = 0; - return xGrid; + if (sign > 0) + { + begin = (int) Math.Ceiling(from); + end = (int) Math.Floor(to); } - public static double CalculateXFromBetweenObjects(TGrid fromTGrid, XGrid fromXGrid, TGrid toTGrid, XGrid toXGrid, FumenVisualEditorViewModel editor, TGrid tGrid) + if (sign < 0) { - var xGrid = CalculateXGridFromBetweenObjects(fromTGrid, fromXGrid, toTGrid, toXGrid, tGrid); - var timeX = XGridCalculator.ConvertXGridToX(xGrid, editor); - return timeX; + begin = (int) Math.Floor(from); + end = (int) Math.Ceiling(to); } - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static float calcGradient(float x1, float y1, float x2, float y2) + for (var i = begin; sign > 0 ? i <= end : i >= end; i += sign) + yield return i; + } + + public static IEnumerable> SplitByTurningGradient(IEnumerable collection, + Func valMapFunc) + { + float calcGradient(T a, T b) { - if (y1 == y2) + var va = valMapFunc(a); + var vb = valMapFunc(b); + + if (va == vb) return float.MaxValue; - return (y1 - y2) / (x1 - x2); + return -(va - vb); } - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static T Max(T a, T b) where T : GridBase => a > b ? a : b; - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static T Min(T a, T b) where T : GridBase => a > b ? b : a; + var itor = collection.GetEnumerator(); + if (!itor.MoveNext()) + yield break; - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TimeSpan Max(TimeSpan a, TimeSpan b) => a > b ? a : b; - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TimeSpan Min(TimeSpan a, TimeSpan b) => a > b ? b : a; + var list = new List(); + var prevPoint = itor.Current; + var prevSign = 0; - public static IEnumerable GetIntegersBetweenTwoValues(double from, double to) + while (true) { - var sign = Math.Sign(to - from); - var begin = 0; - var end = 0; + if (!itor.MoveNext()) + break; + var point = itor.Current; + var sign = MathF.Sign(calcGradient(prevPoint, point)); - if (sign > 0) - { - begin = (int)Math.Ceiling(from); - end = (int)Math.Floor(to); - } - if (sign < 0) + if (prevSign != sign && list.Count != 0) { - begin = (int)Math.Floor(from); - end = (int)Math.Ceiling(to); + yield return list; + list.Clear(); + list.Add(prevPoint); } - for (int i = begin; sign > 0 ? i <= end : i >= end; i += sign) - yield return i; - } - - public static IEnumerable> SplitByTurningGradient(IEnumerable collection, Func valMapFunc) - { - float calcGradient(T a, T b) - { - var va = valMapFunc(a); - var vb = valMapFunc(b); + prevPoint = point; + prevSign = sign; - if (va == vb) - return float.MaxValue; + list.Add(point); + } - return -(va - vb); - } + if (list.Count > 0) + yield return list; + } - var itor = collection.GetEnumerator(); + public record CombinableRange(T Min, T Max) where T : IComparable + { + public static IEnumerable> CombineRanges(IEnumerable> sortedList) + { + var itor = sortedList.OrderBy(x => x.Min).GetEnumerator(); if (!itor.MoveNext()) yield break; - - var list = new List(); - var prevPoint = itor.Current; - var prevSign = 0; - - while (true) + var cur = itor.Current; + while (itor.MoveNext()) { - if (!itor.MoveNext()) - break; - var point = itor.Current; - var sign = MathF.Sign(calcGradient(prevPoint, point)); + var next = itor.Current; + if (next.Min.CompareTo(cur.Max) <= 0) + { + //combinable + var newMin = cur.Min.CompareTo(next.Min) < 0 ? cur.Min : next.Min; + var newMax = cur.Max.CompareTo(next.Max) > 0 ? cur.Max : next.Max; - if (prevSign != sign && list.Count != 0) + cur = new CombinableRange(newMin, newMax); + } + else { - yield return list; - list.Clear(); - list.Add(prevPoint); + yield return cur; + cur = next; } - - prevPoint = point; - prevSign = sign; - - list.Add(point); } - if (list.Count > 0) - yield return list; + if (cur is not null) + yield return cur; } - public record CombinableRange(T Min, T Max) where T : IComparable + public static IIntervalTree> ToIntervalTree(IEnumerable> sortedList) { - public static IEnumerable> CombineRanges(IEnumerable> sortedList) - { - var itor = sortedList.OrderBy(x => x.Min).GetEnumerator(); - if (!itor.MoveNext()) - yield break; - var cur = itor.Current; - while (itor.MoveNext()) - { - var next = itor.Current; - if (next.Min.CompareTo(cur.Max) <= 0) - { - //combinable - var newMin = cur.Min.CompareTo(next.Min) < 0 ? cur.Min : next.Min; - var newMax = cur.Max.CompareTo(next.Max) > 0 ? cur.Max : next.Max; - - cur = new(newMin, newMax); - } - else - { - yield return cur; - cur = next; - } - } - if (cur is not null) - yield return cur; - } - - public static IIntervalTree> ToIntervalTree(IEnumerable> sortedList) - { - var comparer = new ComparerWrapper((a, b) => a.CompareTo(b)); - var tree = new IntervalTree>(comparer); + var comparer = new ComparerWrapper((a, b) => a.CompareTo(b)); + var tree = new IntervalTree>(comparer); - foreach (var range in sortedList) - tree.Add(range.Min, range.Max, range); + foreach (var range in sortedList) + tree.Add(range.Min, range.Max, range); - return tree; - } + return tree; } } -} +} \ No newline at end of file