Nanook.TheGhost.ProjectSong.convertBossNotesToFaceOff C# (CSharp) Method

convertBossNotesToFaceOff() private method

For boss battles, use the face off markers and remove notes that are not in the face off sections.
private convertBossNotesToFaceOff ( int notes, int faceOff ) : int[]
notes int
faceOff int
return int[]
        private int[] convertBossNotesToFaceOff(int[] notes, int[] faceOff)
        {
            List<int> n = new List<int>();
            int lastSec = 0;

            for (int i = 0; i < notes.Length; i += 3)
            {
                for (int j = lastSec; j < faceOff.Length; j += 2)
                {
                    //is the note within a face off section
                    if (notes[i] > faceOff[j] && notes[i] < faceOff[j] + faceOff[j + 1])
                    {
                        n.Add(notes[i]);
                        n.Add(notes[i + 1]);
                        n.Add(notes[i + 2]);
                        lastSec = j; //remember this section so we can resume from it
                        break;
                    }
                    else if (notes[i] < faceOff[j])
                        break; //we've gone too far
                }
            }

            return n.ToArray();
        }