Skip to content

Instantly share code, notes, and snippets.

@peppy
Created March 24, 2012 00:46
Show Gist options
  • Save peppy/2176834 to your computer and use it in GitHub Desktop.
Save peppy/2176834 to your computer and use it in GitHub Desktop.
internal bool IsRetarded()
{
if (sliderCurveSmoothLines == null || cumulativeLengths == null)
return false;
float legalDistance = HitObjectManager.HitObjectRadius * 1.0f;
float scanDistance = HitObjectManager.HitObjectRadius * 4.0f;
for (int x = 0; x < sliderCurveSmoothLines.Count; x++)
{
Vector2 current = sliderCurveSmoothLines[x].p2;
int lower_index = cumulativeLengths.FindLastIndex(d => d < cumulativeLengths[x] - scanDistance);
int lower_bound = Math.Max(0, lower_index);
int y;
for (y = x; y >= lower_bound; y--)
{
if (Vector2.Distance(current, sliderCurveSmoothLines[y].p1) >= legalDistance) break;
}
if (y + 1 == lower_index) return true;
}
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment