public RushJudgementResult(RushHitObject hitObject, RushJudgement judgement) : base(hitObject, judgement) { }
private IEnumerable <IActionPoint> generateActionPoints() { for (int i = 0; i < Beatmap.HitObjects.Count; i++) { var current = Beatmap.HitObjects[i]; LanedHitLane?desiredLane; if (current is DualOrb) { desiredLane = null; } else if (Beatmap.HitObjects[i] is LanedHit lanedHit) { desiredLane = lanedHit.Lane; } else { continue; } RushHitObject nextHit = GetNextObject(i) as RushHitObject; double endTime = current.GetEndTime(); bool canDelayKeyUp = nextHit == null || nextHit.StartTime > endTime + RELEASE_DELAY; double calculatedDelay = canDelayKeyUp ? RELEASE_DELAY : (nextHit.StartTime - endTime) * 0.9; if (desiredLane == null || desiredLane == LanedHitLane.Air) { yield return(new HitPoint { Time = current.StartTime, Lane = LanedHitLane.Air }); yield return(new ReleasePoint { Time = endTime + calculatedDelay, Lane = LanedHitLane.Air }); } if (desiredLane == null || desiredLane == LanedHitLane.Ground) { yield return(new HitPoint { Time = current.StartTime, Lane = LanedHitLane.Ground }); yield return(new ReleasePoint { Time = endTime + calculatedDelay, Lane = LanedHitLane.Ground }); } } foreach (RushHitObject h in Beatmap.HitObjects) { switch (h) { default: case DualOrb _: case LanedHit _: break; case MiniBoss miniBoss: var currentTime = miniBoss.StartTime; var endTime = miniBoss.GetEndTime(); var duration = endTime - currentTime; var punchTime = Math.Min(duration / miniBoss.RequiredHits, miniboss_punch_delay + RELEASE_DELAY); bool alternate = true; while (currentTime < endTime) { yield return(new HitPoint { Time = currentTime, Lane = alternate ? LanedHitLane.Ground : LanedHitLane.Air }); currentTime += punchTime; yield return(new ReleasePoint { Time = currentTime, Lane = alternate ? LanedHitLane.Ground : LanedHitLane.Air }); alternate = !alternate; } break; } } }
private IEnumerable <IActionPoint> generateActionPoints() { const double sawblade_safety = 200; double lastAirHit = -1000, lastGroundHit = -1000; for (int i = 0; i < Beatmap.HitObjects.Count; i++) { var current = Beatmap.HitObjects[i]; LanedHitLane?desiredLane; if (current is DualHit) { desiredLane = null; } else if (current is Sawblade sawblade) { desiredLane = sawblade.Lane.Opposite(); // don't bother if we're probably already in right lane if (desiredLane == LanedHitLane.Air && current.StartTime < lastAirHit + sawblade_safety || desiredLane == LanedHitLane.Ground && current.StartTime < lastGroundHit + sawblade_safety) { continue; } } else if (current is LanedHit lanedHit) { desiredLane = lanedHit.Lane; } else { continue; } RushHitObject nextHit = GetNextObject(i) as RushHitObject; double endTime = current.GetEndTime(); bool canDelayKeyUp = nextHit == null || nextHit.StartTime > endTime + RELEASE_DELAY; double calculatedDelay = canDelayKeyUp ? RELEASE_DELAY : (nextHit.StartTime - endTime) * 0.9; if (desiredLane == null || desiredLane == LanedHitLane.Air) { lastAirHit = endTime; yield return(new HitPoint { Time = current.StartTime, Lane = LanedHitLane.Air }); yield return(new ReleasePoint { Time = endTime + calculatedDelay, Lane = LanedHitLane.Air }); } if (desiredLane == null || desiredLane == LanedHitLane.Ground) { lastGroundHit = endTime; yield return(new HitPoint { Time = current.StartTime, Lane = LanedHitLane.Ground }); yield return(new ReleasePoint { Time = endTime + calculatedDelay, Lane = LanedHitLane.Ground }); } } foreach (RushHitObject h in Beatmap.HitObjects) { switch (h) { default: case DualHit _: case LanedHit _: break; case MiniBoss miniBoss: var currentTime = miniBoss.StartTime; var endTime = miniBoss.GetEndTime(); var duration = endTime - currentTime; var punchTime = duration / (miniBoss.RequiredHits * 2f); bool alternate = true; while (currentTime < endTime) { yield return(new HitPoint { Time = currentTime, Lane = alternate ? LanedHitLane.Ground : LanedHitLane.Air }); currentTime += punchTime / 2f; yield return(new ReleasePoint { Time = currentTime, Lane = alternate ? LanedHitLane.Ground : LanedHitLane.Air }); currentTime += punchTime / 2f; alternate = !alternate; } break; } } }