mirror of https://github.com/ppy/osu
Reorganise functions to order more logically (hitcircle before slider methods)
This commit is contained in:
parent
6b663037e4
commit
4314946e10
|
@ -142,6 +142,23 @@ private void applyRandomisation(float rateOfChangeMultiplier, RandomObjectInfo p
|
||||||
current.PositionRandomised = previous.EndPositionRandomised + posRelativeToPrev;
|
current.PositionRandomised = previous.EndPositionRandomised + posRelativeToPrev;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Move the randomised position of a hit circle so that it fits inside the playfield.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>The deviation from the original randomised position in order to fit within the playfield.</returns>
|
||||||
|
private Vector2 clampHitCircleToPlayfield(HitCircle circle, RandomObjectInfo objectInfo)
|
||||||
|
{
|
||||||
|
var previousPosition = objectInfo.PositionRandomised;
|
||||||
|
objectInfo.EndPositionRandomised = objectInfo.PositionRandomised = clampToPlayfieldWithPadding(
|
||||||
|
objectInfo.PositionRandomised,
|
||||||
|
(float)circle.Radius
|
||||||
|
);
|
||||||
|
|
||||||
|
circle.Position = objectInfo.PositionRandomised;
|
||||||
|
|
||||||
|
return objectInfo.PositionRandomised - previousPosition;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Moves the <see cref="Slider"/> and all necessary nested <see cref="OsuHitObject"/>s into the <see cref="OsuPlayfield"/> if they aren't already.
|
/// Moves the <see cref="Slider"/> and all necessary nested <see cref="OsuHitObject"/>s into the <see cref="OsuPlayfield"/> if they aren't already.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -254,23 +271,6 @@ private void shiftNestedObjects(Slider slider, Vector2 shift)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Move the randomised position of a hit circle so that it fits inside the playfield.
|
|
||||||
/// </summary>
|
|
||||||
/// <returns>The deviation from the original randomised position in order to fit within the playfield.</returns>
|
|
||||||
private Vector2 clampHitCircleToPlayfield(HitCircle circle, RandomObjectInfo objectInfo)
|
|
||||||
{
|
|
||||||
var previousPosition = objectInfo.PositionRandomised;
|
|
||||||
objectInfo.EndPositionRandomised = objectInfo.PositionRandomised = clampToPlayfieldWithPadding(
|
|
||||||
objectInfo.PositionRandomised,
|
|
||||||
(float)circle.Radius
|
|
||||||
);
|
|
||||||
|
|
||||||
circle.Position = objectInfo.PositionRandomised;
|
|
||||||
|
|
||||||
return objectInfo.PositionRandomised - previousPosition;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Clamp a position to playfield, keeping a specified distance from the edges.
|
/// Clamp a position to playfield, keeping a specified distance from the edges.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
Loading…
Reference in New Issue