Skip to content

Commit

Permalink
Merge pull request #2288 from andy840119/regular-clean-up-code
Browse files Browse the repository at this point in the history
Regular clean up code.
  • Loading branch information
andy840119 authored Sep 25, 2024
2 parents 7dc4942 + 35c974d commit 6b83612
Show file tree
Hide file tree
Showing 24 changed files with 77 additions and 101 deletions.
6 changes: 6 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ indent_style = space
indent_size = 2
trim_trailing_whitespace = true

[g_*.cs]
generated_code = true

[*.cs]
end_of_line = crlf
insert_final_newline = true
Expand Down Expand Up @@ -194,6 +197,9 @@ csharp_style_prefer_switch_expression = false:none
#Style - C# 10 features
csharp_style_namespace_declarations = file_scoped:suggestion

#Style - C# 12 features
csharp_style_prefer_primary_constructors = false

[*.{yaml,yml}]
insert_final_newline = true
indent_style = space
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ public void TestLyricTimeTag(string text, string[] timeTags)
{
// Get first lyric from beatmap
var lyrics = new KarDecoder().Decode(text);
var lyric = lyrics.FirstOrDefault()!;
var lyric = lyrics.First();

// Check time tag
var expected = TestCaseTagHelper.ParseTimeTags(timeTags);
var actual = lyric?.TimeTags ?? throw new ArgumentNullException(nameof(lyric));
var actual = lyric.TimeTags;
TimeTagAssert.ArePropertyEqual(expected, actual);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ public void TestLyricTimeTag(string text, string[] timeTags)
{
// Get first lyric from beatmap
var lyrics = new LrcDecoder().Decode(text);
var lyric = lyrics.FirstOrDefault()!;
var lyric = lyrics.First();

// Check time tag
var expected = TestCaseTagHelper.ParseTimeTags(timeTags);
var actual = lyric?.TimeTags ?? throw new ArgumentNullException(nameof(lyric));
var actual = lyric.TimeTags;
TimeTagAssert.ArePropertyEqual(expected, actual);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
using osu.Framework.Extensions;
using osu.Framework.Graphics;
using osu.Game.Rulesets.Judgements;
using osu.Game.Rulesets.Karaoke.Objects.Drawables;
using osu.Game.Rulesets.Karaoke.UI;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Scoring;
Expand Down
11 changes: 11 additions & 0 deletions osu.Game.Rulesets.Karaoke.sln.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -776,9 +776,19 @@ See the LICENCE file in the repository root for full licence text.
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateStaticReadonly/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aa_bb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=StaticReadonly/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AA_BB" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=TypeParameters/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=15b5b1f1_002D457c_002D4ca6_002Db278_002D5615aedc07d3/@EntryIndexedValue">&lt;Policy&gt;&lt;Descriptor Staticness="Static" AccessRightKinds="Private" Description="Static readonly fields (private)"&gt;&lt;ElementKinds&gt;&lt;Kind Name="READONLY_FIELD" /&gt;&lt;/ElementKinds&gt;&lt;/Descriptor&gt;&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aa_bb" /&gt;&lt;/Policy&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=236f7aa5_002D7b06_002D43ca_002Dbf2a_002D9b31bfcff09a/@EntryIndexedValue">&lt;Policy&gt;&lt;Descriptor Staticness="Any" AccessRightKinds="Private" Description="Constant fields (private)"&gt;&lt;ElementKinds&gt;&lt;Kind Name="CONSTANT_FIELD" /&gt;&lt;/ElementKinds&gt;&lt;/Descriptor&gt;&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aa_bb" /&gt;&lt;/Policy&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=2c62818f_002D621b_002D4425_002Dadc9_002D78611099bfcb/@EntryIndexedValue">&lt;Policy&gt;&lt;Descriptor Staticness="Any" AccessRightKinds="Any" Description="Type parameters"&gt;&lt;ElementKinds&gt;&lt;Kind Name="TYPE_PARAMETER" /&gt;&lt;/ElementKinds&gt;&lt;/Descriptor&gt;&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /&gt;&lt;/Policy&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=4a98fdf6_002D7d98_002D4f5a_002Dafeb_002Dea44ad98c70c/@EntryIndexedValue">&lt;Policy&gt;&lt;Descriptor Staticness="Instance" AccessRightKinds="Private" Description="Instance fields (private)"&gt;&lt;ElementKinds&gt;&lt;Kind Name="FIELD" /&gt;&lt;Kind Name="READONLY_FIELD" /&gt;&lt;/ElementKinds&gt;&lt;/Descriptor&gt;&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb"&gt;&lt;ExtraRule Prefix="_" Suffix="" Style="aaBb" /&gt;&lt;/Policy&gt;&lt;/Policy&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=669e5282_002Dfb4b_002D4e90_002D91e7_002D07d269d04b60/@EntryIndexedValue">&lt;Policy&gt;&lt;Descriptor Staticness="Any" AccessRightKinds="Protected, ProtectedInternal, Internal, Public, PrivateProtected" Description="Constant fields (not private)"&gt;&lt;ElementKinds&gt;&lt;Kind Name="CONSTANT_FIELD" /&gt;&lt;/ElementKinds&gt;&lt;/Descriptor&gt;&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AA_BB" /&gt;&lt;/Policy&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=76f79b1e_002Dece7_002D4df2_002Da322_002D1bd7fea25eb7/@EntryIndexedValue">&lt;Policy&gt;&lt;Descriptor Staticness="Any" AccessRightKinds="Any" Description="Local functions"&gt;&lt;ElementKinds&gt;&lt;Kind Name="LOCAL_FUNCTION" /&gt;&lt;/ElementKinds&gt;&lt;/Descriptor&gt;&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;&lt;/Policy&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=8b8504e3_002Df0be_002D4c14_002D9103_002Dc732f2bddc15/@EntryIndexedValue">&lt;Policy&gt;&lt;Descriptor Staticness="Any" AccessRightKinds="Any" Description="Enum members"&gt;&lt;ElementKinds&gt;&lt;Kind Name="ENUM_MEMBER" /&gt;&lt;/ElementKinds&gt;&lt;/Descriptor&gt;&lt;Policy Inspect="False" Prefix="" Suffix="" Style="AaBb" /&gt;&lt;/Policy&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=9d1af99b_002Dbefe_002D48a4_002D9eb3_002D661384e29869/@EntryIndexedValue">&lt;Policy&gt;&lt;Descriptor Staticness="Static, Instance" AccessRightKinds="Private" Description="private methods"&gt;&lt;ElementKinds&gt;&lt;Kind Name="ASYNC_METHOD" /&gt;&lt;Kind Name="METHOD" /&gt;&lt;/ElementKinds&gt;&lt;/Descriptor&gt;&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;&lt;/Policy&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=9ffbe43b_002Dc610_002D411b_002D9839_002D1416a146d9b0/@EntryIndexedValue">&lt;Policy&gt;&lt;Descriptor Staticness="Static, Instance" AccessRightKinds="Protected, ProtectedInternal, Internal, Public" Description="internal/protected/public methods"&gt;&lt;ElementKinds&gt;&lt;Kind Name="ASYNC_METHOD" /&gt;&lt;Kind Name="METHOD" /&gt;&lt;/ElementKinds&gt;&lt;/Descriptor&gt;&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /&gt;&lt;/Policy&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=a4c2df6c_002Db202_002D48d5_002Db077_002De678cb548c25/@EntryIndexedValue">&lt;Policy&gt;&lt;Descriptor Staticness="Static, Instance" AccessRightKinds="Private" Description="private properties"&gt;&lt;ElementKinds&gt;&lt;Kind Name="PROPERTY" /&gt;&lt;/ElementKinds&gt;&lt;/Descriptor&gt;&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;&lt;/Policy&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=a4f433b8_002Dabcd_002D4e55_002Da08f_002D82e78cef0f0c/@EntryIndexedValue">&lt;Policy&gt;&lt;Descriptor Staticness="Any" AccessRightKinds="Any" Description="Local constants"&gt;&lt;ElementKinds&gt;&lt;Kind Name="LOCAL_CONSTANT" /&gt;&lt;/ElementKinds&gt;&lt;/Descriptor&gt;&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aa_bb" /&gt;&lt;/Policy&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=c873eafb_002Dd57f_002D481d_002D8c93_002D77f6863c2f88/@EntryIndexedValue">&lt;Policy&gt;&lt;Descriptor Staticness="Static" AccessRightKinds="Protected, ProtectedInternal, Internal, Public, PrivateProtected" Description="Static readonly fields (not private)"&gt;&lt;ElementKinds&gt;&lt;Kind Name="READONLY_FIELD" /&gt;&lt;/ElementKinds&gt;&lt;/Descriptor&gt;&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AA_BB" /&gt;&lt;/Policy&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=f9fce829_002De6f4_002D4cb2_002D80f1_002D5497c44f51df/@EntryIndexedValue">&lt;Policy&gt;&lt;Descriptor Staticness="Static" AccessRightKinds="Private" Description="Static fields (private)"&gt;&lt;ElementKinds&gt;&lt;Kind Name="FIELD" /&gt;&lt;/ElementKinds&gt;&lt;/Descriptor&gt;&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;&lt;/Policy&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=fd562728_002Dc23d_002D417f_002Da19f_002D9d854247fbea/@EntryIndexedValue">&lt;Policy&gt;&lt;Descriptor Staticness="Static, Instance" AccessRightKinds="Protected, ProtectedInternal, Internal, Public" Description="internal/protected/public properties"&gt;&lt;ElementKinds&gt;&lt;Kind Name="PROPERTY" /&gt;&lt;/ElementKinds&gt;&lt;/Descriptor&gt;&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /&gt;&lt;/Policy&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=JS_005FBLOCK_005FSCOPE_005FCONSTANT/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=JS_005FBLOCK_005FSCOPE_005FFUNCTION/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
Expand Down Expand Up @@ -843,6 +853,7 @@ See the LICENCE file in the repository root for full licence text.&#xD;
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002ECSharpPlaceAttributeOnSameLineMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateBlankLinesAroundFieldToBlankLinesAroundProperty/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateThisQualifierSettings/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EPredefinedNamingRulesToUserRulesUpgrade/@EntryIndexedValue">True</s:Boolean>
<s:String x:Key="/Default/Environment/UnitTesting/NUnitProvider/SetCurrentDirectoryTo/@EntryValue">TestFolder</s:String>
<s:Boolean x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=28A2A5FC43E07C488A4BC7430879479E/@KeyIndexDefined">True</s:Boolean>
<s:Boolean x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=28A2A5FC43E07C488A4BC7430879479E/Applicability/=Live/@EntryIndexedValue">True</s:Boolean>
Expand Down
22 changes: 10 additions & 12 deletions osu.Game.Rulesets.Karaoke/Beatmaps/KaraokeBeatmapProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,17 @@ public override void PreProcess()

base.PreProcess();
applyInvalidProperty(karaokeBeatmap);
return;

static KaraokeBeatmap getKaraokeBeatmap(IBeatmap beatmap)
{
// goes to there while parsing the beatmap.
if (beatmap is KaraokeBeatmap karaokeBeatmap)
return karaokeBeatmap;

// goes to there while editing the beatmap.
if (beatmap is EditorBeatmap editorBeatmap)
return getKaraokeBeatmap(editorBeatmap.PlayableBeatmap);

throw new InvalidCastException($"The beatmap is not a {nameof(KaraokeBeatmap)}");
}
static KaraokeBeatmap getKaraokeBeatmap(IBeatmap beatmap) =>
beatmap switch
{
// goes to there while parsing the beatmap.
KaraokeBeatmap karaokeBeatmap => karaokeBeatmap,
// goes to there while editing the beatmap.
EditorBeatmap editorBeatmap => getKaraokeBeatmap(editorBeatmap.PlayableBeatmap),
_ => throw new InvalidCastException($"The beatmap is not a {nameof(KaraokeBeatmap)}"),
};
}

private void applyStage(KaraokeBeatmap beatmap)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,7 @@ void addDifficultyToSet(BeatmapSetInfo targetBeatmapSet, IBeatmap newBeatmap)
private void save(BeatmapInfo beatmapInfo, IBeatmap beatmapContent)
{
// get realm from beatmapManager using reflection
var realm = beatmapManager.GetType().GetProperty("Realm", BindingFlags.NonPublic | BindingFlags.Instance)?.GetValue(beatmapManager) as RealmAccess;

if (realm == null)
if (beatmapManager.GetType().GetProperty("Realm", BindingFlags.NonPublic | BindingFlags.Instance)?.GetValue(beatmapManager) is not RealmAccess realm)
{
throw new InvalidOperationException();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,11 @@ Page createReturnPage(double time)
}
}

private struct LyricTimingInfo : IComparable<LyricTimingInfo>
private readonly struct LyricTimingInfo : IComparable<LyricTimingInfo>
{
public double StartTime { get; set; }
public double StartTime { get; init; }

public double EndTime { get; set; }
public double EndTime { get; init; }

public int CompareTo(LyricTimingInfo other)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ private partial class SingerCircle : OsuClickableContainer, IHasContextMenu, IHa
{
public Bindable<Singer> Current { get; } = new();

public Action? DeleteRequested { get; set; }
public Action? DeleteRequested { get; init; }

private readonly DrawableSingerAvatar singerAvatar;

Expand Down
17 changes: 0 additions & 17 deletions osu.Game.Rulesets.Karaoke/Extensions/ListExtensions.cs

This file was deleted.

4 changes: 2 additions & 2 deletions osu.Game.Rulesets.Karaoke/Mods/KaraokeModSnow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ protected override void Update()
/// </summary>
private partial class SnowSprite : Circle
{
public float HorizontalSpeed { get; set; }
public float HorizontalSpeed { get; init; }

public double CreateTime { get; set; }
public double CreateTime { get; init; }
}
}
}
10 changes: 4 additions & 6 deletions osu.Game.Rulesets.Karaoke/Objects/Drawables/DrawableLyric.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Extensions.IEnumerableExtensions;
using osu.Framework.Extensions.ObjectExtensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
Expand Down Expand Up @@ -145,7 +146,7 @@ private void updateFontStyle()
if (CurrentSkin == null)
return;

if (HitObject == null)
if (HitObject.IsNull())
return;

var lyricStyle = CurrentSkin.GetConfig<Lyric, LyricStyle>(HitObject)?.Value;
Expand All @@ -157,7 +158,7 @@ private void updateLyricFontInfo()
if (CurrentSkin == null)
return;

if (HitObject == null)
if (HitObject.IsNull())
return;

var lyricFontInfo = CurrentSkin.GetConfig<Lyric, LyricFontInfo>(HitObject)?.Value;
Expand Down Expand Up @@ -216,8 +217,5 @@ public void ApplyToLyricPieces(Action<DrawableKaraokeSpriteText> action)
action?.Invoke(lyricPiece);
}

public void ApplyToTranslationText(Action<OsuSpriteText> action)
{
action?.Invoke(translationText);
}
public void ApplyToTranslationText(Action<OsuSpriteText> action) => action.Invoke(translationText);
}
7 changes: 4 additions & 3 deletions osu.Game.Rulesets.Karaoke/Objects/Drawables/DrawableNote.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Diagnostics;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Extensions.ObjectExtensions;
using osu.Framework.Graphics;
using osu.Framework.Input.Bindings;
using osu.Framework.Input.Events;
Expand Down Expand Up @@ -117,7 +118,7 @@ protected override void ApplySkin(ISkinSource skin, bool allowFallback)
if (CurrentSkin == null)
return;

if (HitObject == null)
if (HitObject.IsNull())
return;

var noteSkin = skin.GetConfig<Note, NoteStyle>(HitObject)?.Value;
Expand Down Expand Up @@ -207,7 +208,7 @@ public void OnReleased(KeyBindingReleaseEvent<KaraokeScoringAction> e)
EndSing();
}

public void ApplyToLyricText(Action<OsuSpriteText> action) => action?.Invoke(textPiece);
public void ApplyToLyricText(Action<OsuSpriteText> action) => action.Invoke(textPiece);

public void ApplyToBackground(Action<SkinnableDrawable> action) => action?.Invoke(background);
public void ApplyToBackground(Action<SkinnableDrawable> action) => action.Invoke(background);
}
13 changes: 6 additions & 7 deletions osu.Game.Rulesets.Karaoke/Objects/Utils/LyricsUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using System.Linq;
using osu.Framework.Graphics.Sprites;
using osu.Game.Rulesets.Karaoke.Beatmaps;
using osu.Game.Rulesets.Karaoke.Extensions;

namespace osu.Game.Rulesets.Karaoke.Objects.Utils;

Expand Down Expand Up @@ -83,19 +82,19 @@ public static Lyric CombineLyric(Lyric firstLyric, Lyric secondLyric)
string lyricText = firstLyric.Text + secondLyric.Text;

var timeTags = new List<TimeTag>();
timeTags.AddRangeWithNullCheck(firstLyric.TimeTags);
timeTags.AddRangeWithNullCheck(shiftingTimeTag(secondLyric.TimeTags, offsetIndexForSecondLyric));
timeTags.AddRange(firstLyric.TimeTags);
timeTags.AddRange(shiftingTimeTag(secondLyric.TimeTags, offsetIndexForSecondLyric));

var rubyTags = new List<RubyTag>();
rubyTags.AddRangeWithNullCheck(firstLyric.RubyTags);
rubyTags.AddRangeWithNullCheck(shiftingRubyTag(secondLyric.RubyTags, lyricText, offsetIndexForSecondLyric));
rubyTags.AddRange(firstLyric.RubyTags);
rubyTags.AddRange(shiftingRubyTag(secondLyric.RubyTags, lyricText, offsetIndexForSecondLyric));

double startTime = Math.Min(firstLyric.StartTime, secondLyric.StartTime);
double endTime = Math.Max(firstLyric.EndTime, secondLyric.EndTime);

var singers = new List<ElementId>();
singers.AddRangeWithNullCheck(firstLyric.SingerIds);
singers.AddRangeWithNullCheck(secondLyric.SingerIds);
singers.AddRange(firstLyric.SingerIds);
singers.AddRange(secondLyric.SingerIds);

bool sameLanguage = EqualityComparer<CultureInfo?>.Default.Equals(firstLyric.Language, secondLyric.Language);
var language = sameLanguage ? firstLyric.Language : null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ protected override bool HasDataProperty(LyricWorkingProperty flags) =>
protected override bool IsWorkingPropertySynced(Lyric hitObject, LyricWorkingProperty flags) =>
flags switch
{
LyricWorkingProperty.StartTime => true,
LyricWorkingProperty.Duration => true,
LyricWorkingProperty.Timing => true,
LyricWorkingProperty.StartTime => throw new InvalidOperationException(),
LyricWorkingProperty.Duration => throw new InvalidOperationException(),
LyricWorkingProperty.Timing => throw new InvalidOperationException(),
LyricWorkingProperty.Singers => isWorkingSingerSynced(hitObject),
LyricWorkingProperty.Page => true,
LyricWorkingProperty.Page => throw new InvalidOperationException(),
LyricWorkingProperty.ReferenceLyric => isReferenceLyricSynced(hitObject),
LyricWorkingProperty.EffectApplier => true,
LyricWorkingProperty.EffectApplier => throw new InvalidOperationException(),
_ => throw new ArgumentOutOfRangeException(nameof(flags), flags, null),
};

Expand Down
Loading

0 comments on commit 6b83612

Please sign in to comment.