Created
March 24, 2012 00:46
-
-
Save peppy/2176834 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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