Skip to content

Commit

Permalink
Remove StrictCompletionOrder from SlideCheckpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
LumpBloom7 committed Jul 22, 2022
1 parent d1f2418 commit 1849be3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,7 @@ public class DrawableSlideCheckpoint : DrawableSentakkiHitObject
// All hits can only be done after the parent StartTime
public bool IsHittable => Time.Current > ParentHitObject.HitObject.StartTime && isPreviousNodeHit();

private bool isPreviousNodeHit()
{
if (HitObject.StrictCompletionOrder)
return ThisIndex < 1 || parentSlide.SlideCheckpoints[ThisIndex - 1].IsHit;

return ThisIndex < 2 || parentSlide.SlideCheckpoints[ThisIndex - 2].IsHit;
}
private bool isPreviousNodeHit() => ThisIndex < 2 || parentSlide.SlideCheckpoints[ThisIndex - 2].IsHit;

private Container<DrawableSlideCheckpointNode> nodes;

Expand Down
6 changes: 3 additions & 3 deletions osu.Game.Rulesets.Sentakki/Objects/SlideBody.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ protected override void CreateNestedHitObjects(CancellationToken cancellationTok

protected virtual void CreateSlideCheckpoints()
{
var distance = SlideInfo.SlidePath.TotalDistance;
var nodeCount = (int)Math.Floor(distance / 100);
double distance = SlideInfo.SlidePath.TotalDistance;
int nodeCount = (int)Math.Floor(distance / 100);
for (int i = 0; i < nodeCount; i++)
{
var progress = (double)(i + 1) / nodeCount;
double progress = (double)(i + 1) / nodeCount;
SlideCheckpoint checkpoint = new SlideCheckpoint()
{
Progress = (float)progress,
Expand Down
9 changes: 0 additions & 9 deletions osu.Game.Rulesets.Sentakki/Objects/SlideCheckpoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ namespace osu.Game.Rulesets.Sentakki.Objects
{
public class SlideCheckpoint : SentakkiHitObject
{
public SlideCheckpoint(bool strictMode = false)
{
StrictCompletionOrder = strictMode;
}

// Used to update slides visuals
public float Progress { get; set; }

Expand All @@ -21,10 +16,6 @@ public SlideCheckpoint(bool strictMode = false)

public int NodesToPass { get; set; } = 1;

// If this is true, then all previous checkpoints must be completed to hit this one
// This is in contrast to non-strict, where you can hit it if the n-2 checkpoint is hit
public bool StrictCompletionOrder { get; }

protected override void CreateNestedHitObjects(CancellationToken cancellationToken)
{
foreach (var nodePosition in NodePositions)
Expand Down

0 comments on commit 1849be3

Please sign in to comment.