Skip to content

Instantly share code, notes, and snippets.

@peppy
Created March 24, 2012 00:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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