From c5cae4e3eebe1e6695c47e47d1e7f87d09646727 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 15 Jan 2022 23:55:11 +0900 Subject: [PATCH] Rename methods and add xmldoc --- .../Components/Timelines/Summary/Parts/ControlPointPart.cs | 2 +- .../Timelines/Summary/Parts/ControlPointVisualisation.cs | 2 +- .../Timelines/Summary/Parts/EffectPointVisualisation.cs | 2 +- .../Timelines/Summary/Parts/GroupVisualisation.cs | 6 ++---- .../Summary/Parts/IControlPointVisualisationRedundant.cs | 5 ++++- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/ControlPointPart.cs b/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/ControlPointPart.cs index 2dab3b0e59..b72ff18434 100644 --- a/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/ControlPointPart.cs +++ b/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/ControlPointPart.cs @@ -36,7 +36,7 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Parts // as an optimisation, don't add a visualisation if there are already groups with the same types in close proximity. // for newly added control points (ie. lazer editor first where group is added empty) we always skip for simplicity. // that is fine, because cases where this is causing a performance issue are mostly where external tools were used to create an insane number of points. - if (Children.Any(g => Math.Abs(g.Group.Time - group.Time) < 1000 && g.IsRedundant(group))) + if (Children.Any(g => Math.Abs(g.Group.Time - group.Time) < 1000 && g.IsVisuallyRedundant(group))) continue; Add(new GroupVisualisation(group)); diff --git a/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/ControlPointVisualisation.cs b/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/ControlPointVisualisation.cs index 96fce1dac5..aaa3838be5 100644 --- a/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/ControlPointVisualisation.cs +++ b/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/ControlPointVisualisation.cs @@ -27,6 +27,6 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Parts Colour = Point.GetRepresentingColour(colours); } - public bool IsRedundant(ControlPoint other) => other.GetType() == Point.GetType(); + public bool IsVisuallyRedundant(ControlPoint other) => other.GetType() == Point.GetType(); } } diff --git a/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/EffectPointVisualisation.cs b/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/EffectPointVisualisation.cs index c08ab3728f..b4f048f29b 100644 --- a/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/EffectPointVisualisation.cs +++ b/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/EffectPointVisualisation.cs @@ -70,6 +70,6 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Parts } // kiai sections display duration, so are required to be visualised. - public bool IsRedundant(ControlPoint other) => (other as EffectControlPoint)?.KiaiMode == effect.KiaiMode; + public bool IsVisuallyRedundant(ControlPoint other) => (other as EffectControlPoint)?.KiaiMode == effect.KiaiMode; } } diff --git a/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/GroupVisualisation.cs b/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/GroupVisualisation.cs index b55df66a02..fc39f83e6a 100644 --- a/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/GroupVisualisation.cs +++ b/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/GroupVisualisation.cs @@ -61,9 +61,7 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Parts /// /// For display purposes, check whether the proposed group is made redundant by this visualisation group. /// - /// - /// - public bool IsRedundant(ControlPointGroup other) => - other.ControlPoints.Any(c => InternalChildren.OfType().Any(c2 => c2.IsRedundant(c))); + public bool IsVisuallyRedundant(ControlPointGroup other) => + other.ControlPoints.Any(c => InternalChildren.OfType().Any(c2 => c2.IsVisuallyRedundant(c))); } } diff --git a/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/IControlPointVisualisationRedundant.cs b/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/IControlPointVisualisationRedundant.cs index e4d47e4cdc..fc4facdd47 100644 --- a/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/IControlPointVisualisationRedundant.cs +++ b/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/IControlPointVisualisationRedundant.cs @@ -7,6 +7,9 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Parts { public interface IControlPointVisualisationRedundant { - bool IsRedundant(ControlPoint other); + /// + /// For display purposes, check whether the proposed point is made redundant by this visualisation. + /// + bool IsVisuallyRedundant(ControlPoint other); } }