public int CrotchetTillFirstEvent() { switch (Type) { case "IntensityIncrease": case "Hit": return(OccoursOn.First() - 1); case "Positional": return(LocationPattern.First().Index - 1); default: throw new ArgumentException(); } }
public bool IndexIsLastHit(int index) { switch (Type) { case "IntensityIncrease": case "Hit": return(index == OccoursOn.Last()); case "Positional": return(index == LocationPattern.Last().Index); default: throw new ArgumentException(); } }
public int GetEventAfter(int currentEvent) { switch (Type) { case "IntensityIncrease": case "Hit": var prevItemPos = OccoursOn.IndexOf(currentEvent); var nextItem = OccoursOn[prevItemPos + 1]; return(nextItem); case "Positional": var prevItem2 = LocationPattern.Find(x => x.Index == currentEvent); var prevItemPos2 = LocationPattern.IndexOf(prevItem2); var nextItem2 = LocationPattern[prevItemPos2 + 1]; return(nextItem2.Index); default: throw new ArgumentException(); } }