Cascade.NoteTimeAnalysis.Analyze C# (CSharp) Method

Analyze() public static method

public static Analyze ( int playerIndex, List info, float numberOfSeconds ) : NoteTimeAnalysis
playerIndex int
info List
numberOfSeconds float
return NoteTimeAnalysis
        public static NoteTimeAnalysis Analyze(int playerIndex, List<NoteTimeInfo> info, float numberOfSeconds )
        {
            double lastTime = 0;
            double addedTime = 0;
            int num = 0;
           // Global.Output += "Analyzing for player " + (playerIndex + 1) + "...";
            foreach (var i in info)
            {
                //Global.Output += i.PlayerIndex;
                if (i.PlayerIndex == playerIndex)
                {
                    addedTime += i.Time.TotalSeconds - lastTime;
                    lastTime = i.Time.TotalSeconds;
                    num++;
                }
            }
            Global.Output += "Analysis complete: Time: " + numberOfSeconds + ", AddedTime: " + addedTime + ", Number: " + num;
            float averageNoteTime = (float)(addedTime / num);
            Global.Output += "Average time to next note: " + averageNoteTime;
            float averageNotesPerMin = num * (60f / numberOfSeconds);
            Global.Output += "Average notes per min: " + averageNotesPerMin;

            float averageBPMFromNumberOfNotes = averageNotesPerMin / 4;

            Global.Output += "Average BPM from number of notes: " + averageBPMFromNumberOfNotes;

            float averageBPMFromTimes = (60 / averageNoteTime) / 4;

            Global.Output += "Average BPM from time to next note: " + averageBPMFromTimes;

            return new NoteTimeAnalysis(averageBPMFromNumberOfNotes);
        }
        public override string ToString()