public static int SecId(Interval[] secInt, int sec) { for (int i = 0; i < secInt.Length; i++) if (sec >= secInt[i].From) return i; return 0; }
public static int ScoreId(Interval[] ints, int? score) { if (score == null) return ints.Length - 1; int s = (int)score; for (int i = 0; i < ints.Length; i++) if (s > ints[i].From) return i; return 0; }