AlphaTab.Rendering.Utils.BeamingHelper.CheckNote C# (CSharp) Method

CheckNote() private method

private CheckNote ( Note note ) : void
note AlphaTab.Model.Note
return void
        private void CheckNote(Note note)
        {
            var value = GetValue(note);

            // detect the smallest note which is at the beginning of this group
            if (FirstMinNote == null || note.Beat.Start < FirstMinNote.Beat.Start)
            {
                FirstMinNote = note;
            }
            else if (note.Beat.Start == FirstMinNote.Beat.Start)
            {
                if (value < GetValue(FirstMinNote))
                {
                    FirstMinNote = note;
                }
            }

            // detect the biggest note which is at the beginning of this group
            if (FirstMaxNote == null || note.Beat.Start < FirstMaxNote.Beat.Start)
            {
                FirstMaxNote = note;
            }
            else if (note.Beat.Start == FirstMaxNote.Beat.Start)
            {
                if (value > GetValue(FirstMaxNote))
                {
                    FirstMaxNote = note;
                }
            }

            // detect the smallest note which is at the end of this group
            if (LastMinNote == null || note.Beat.Start > LastMinNote.Beat.Start)
            {
                LastMinNote = note;
            }
            else if (note.Beat.Start == LastMinNote.Beat.Start)
            {
                if (value < GetValue(LastMinNote))
                {
                    LastMinNote = note;
                }
            }
            // detect the biggest note which is at the end of this group
            if (LastMaxNote == null || note.Beat.Start > LastMaxNote.Beat.Start)
            {
                LastMaxNote = note;
            }
            else if (note.Beat.Start == LastMaxNote.Beat.Start)
            {
                if (value > GetValue(LastMaxNote))
                {
                    LastMaxNote = note;
                }
            }

            if (MaxNote == null || value > GetValue(MaxNote))
            {
                MaxNote = note;
            }
            if (MinNote == null || value < GetValue(MinNote))
            {
                MinNote = note;
            }
        }