3
3
4
4
using System ;
5
5
using System . Linq ;
6
- using osu . Framework . Extensions . IEnumerableExtensions ;
7
6
using osu . Game . Rulesets . Osu . UI ;
8
7
using osu . Game . Rulesets . Objects ;
9
8
using osu . Game . Rulesets . Osu . Beatmaps ;
@@ -117,10 +116,9 @@ public static void ReflectHorizontallyAlongPlayfield(OsuHitObject osuObject)
117
116
if ( osuObject is not Slider slider )
118
117
return ;
119
118
120
- void reflectNestedObject ( OsuHitObject nested ) => nested . Position = new Vector2 ( OsuPlayfield . BASE_SIZE . X - nested . Position . X , nested . Position . Y ) ;
121
119
static void reflectControlPoint ( PathControlPoint point ) => point . Position = new Vector2 ( - point . Position . X , point . Position . Y ) ;
122
120
123
- modifySlider ( slider , reflectNestedObject , reflectControlPoint ) ;
121
+ modifySlider ( slider , reflectControlPoint ) ;
124
122
}
125
123
126
124
/// <summary>
@@ -134,10 +132,9 @@ public static void ReflectVerticallyAlongPlayfield(OsuHitObject osuObject)
134
132
if ( osuObject is not Slider slider )
135
133
return ;
136
134
137
- void reflectNestedObject ( OsuHitObject nested ) => nested . Position = new Vector2 ( nested . Position . X , OsuPlayfield . BASE_SIZE . Y - nested . Position . Y ) ;
138
135
static void reflectControlPoint ( PathControlPoint point ) => point . Position = new Vector2 ( point . Position . X , - point . Position . Y ) ;
139
136
140
- modifySlider ( slider , reflectNestedObject , reflectControlPoint ) ;
137
+ modifySlider ( slider , reflectControlPoint ) ;
141
138
}
142
139
143
140
/// <summary>
@@ -146,10 +143,9 @@ public static void ReflectVerticallyAlongPlayfield(OsuHitObject osuObject)
146
143
/// <param name="slider">The slider to be flipped.</param>
147
144
public static void FlipSliderInPlaceHorizontally ( Slider slider )
148
145
{
149
- void flipNestedObject ( OsuHitObject nested ) => nested . Position = new Vector2 ( slider . X - ( nested . X - slider . X ) , nested . Y ) ;
150
146
static void flipControlPoint ( PathControlPoint point ) => point . Position = new Vector2 ( - point . Position . X , point . Position . Y ) ;
151
147
152
- modifySlider ( slider , flipNestedObject , flipControlPoint ) ;
148
+ modifySlider ( slider , flipControlPoint ) ;
153
149
}
154
150
155
151
/// <summary>
@@ -159,18 +155,13 @@ public static void FlipSliderInPlaceHorizontally(Slider slider)
159
155
/// <param name="rotation">The angle, measured in radians, to rotate the slider by.</param>
160
156
public static void RotateSlider ( Slider slider , float rotation )
161
157
{
162
- void rotateNestedObject ( OsuHitObject nested ) => nested . Position = rotateVector ( nested . Position - slider . Position , rotation ) + slider . Position ;
163
158
void rotateControlPoint ( PathControlPoint point ) => point . Position = rotateVector ( point . Position , rotation ) ;
164
159
165
- modifySlider ( slider , rotateNestedObject , rotateControlPoint ) ;
160
+ modifySlider ( slider , rotateControlPoint ) ;
166
161
}
167
162
168
- private static void modifySlider ( Slider slider , Action < OsuHitObject > modifyNestedObject , Action < PathControlPoint > modifyControlPoint )
163
+ private static void modifySlider ( Slider slider , Action < PathControlPoint > modifyControlPoint )
169
164
{
170
- // No need to update the head and tail circles, since slider handles that when the new slider path is set
171
- slider . NestedHitObjects . OfType < SliderTick > ( ) . ForEach ( modifyNestedObject ) ;
172
- slider . NestedHitObjects . OfType < SliderRepeat > ( ) . ForEach ( modifyNestedObject ) ;
173
-
174
165
var controlPoints = slider . Path . ControlPoints . Select ( p => new PathControlPoint ( p . Position , p . Type ) ) . ToArray ( ) ;
175
166
foreach ( var point in controlPoints )
176
167
modifyControlPoint ( point ) ;
0 commit comments