Beispiel #1
0
        protected void CheckPosition(int startLaneIndex, int startWidth)
        {
            int maxRightOffset = Math.Max(0, StepNotes.Count == 0 ? 0 : StepNotes.Max(p => p.LaneIndexOffset + p.WidthChange));

            if (startWidth < Math.Abs(Math.Min(0, StepNotes.Count == 0 ? 0 : StepNotes.Min(p => p.WidthChange))) + 1 || startLaneIndex + startWidth + maxRightOffset > Constants.LanesCount)
            {
                throw new ArgumentOutOfRangeException("startWidth", "Invalid note width.");
            }

            if (StepNotes.Any(p =>
            {
                int laneIndex = startLaneIndex + p.LaneIndexOffset;
                return(laneIndex < 0 || laneIndex + (startWidth + p.WidthChange) > Constants.LanesCount);
            }))
            {
                throw new ArgumentOutOfRangeException("startLaneIndex", "Invalid lane index.");
            }
            if (startLaneIndex < 0 || startLaneIndex + startWidth > Constants.LanesCount)
            {
                throw new ArgumentOutOfRangeException("startLaneIndex", "Invalid lane index.");
            }
        }
Beispiel #2
0
 public override int GetDuration()
 {
     return(StepNotes.Max(p => p.TickOffset));
 }