예제 #1
0
        /// <summary>
        /// Will combine multiple notes into a big one.
        /// </summary>
        private static List <Hit> ClusterNotes(ICollection <Hit> notes)
        {
            var clusters     = new List <Hit>(notes.Count);
            var clusterBuild = new List <Hit>();

            foreach (Hit note in notes)
            {
                if (clusterBuild.Count > 0 && clusterBuild[0].RealTime + Hit.Threshold < note.RealTime)
                {
                    clusters.Add(Hit.Cluster(clusterBuild));
                    clusterBuild.Clear();
                }

                clusterBuild.Add(note);
            }

            if (clusterBuild.Count > 0)
            {
                clusters.Add(Hit.Cluster(clusterBuild));
            }

            return(clusters);
        }
예제 #2
0
 public ScoredClusterHit(Hit cluster, float hitDifficulty, float continuousDifficulty)
 {
     Cluster              = cluster ?? throw new ArgumentNullException(nameof(cluster));
     HitDifficulty        = hitDifficulty;
     ContinuousDifficulty = continuousDifficulty;
 }