Exemplo n.º 1
0
Arquivo: Aim.cs Projeto: tjgtll/osu
        private static List <OsuMovement> createMovements(List <OsuHitObject> hitObjects, double clockRate, List <Vector <double> > strainHistory)
        {
            OsuMovement.Initialize();
            var movements = new List <OsuMovement>();

            if (hitObjects.Count == 0)
            {
                return(movements);
            }

            // the first object
            movements.AddRange(OsuMovement.ExtractMovement(hitObjects[0]));

            // the rest
            for (int i = 1; i < hitObjects.Count; i++)
            {
                var obj0      = i > 1 ? hitObjects[i - 2] : null;
                var obj1      = hitObjects[i - 1];
                var obj2      = hitObjects[i];
                var obj3      = i < hitObjects.Count - 1 ? hitObjects[i + 1] : null;
                var tapStrain = strainHistory[i];

                movements.AddRange(OsuMovement.ExtractMovement(obj0, obj1, obj2, obj3, tapStrain, clockRate));
            }
            return(movements);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Converts hit objects into movements.
        /// </summary>
        /// <param name="hitObjects">List of all map hit objects</param>
        /// <param name="strainHistory">List of all hit objects' tap strain</param>
        /// <param name="noteDensities">List of all hit objects' visual note densities</param>
        /// <param name="clockRate">Clock rate</param>
        /// <param name="hidden">Are we calculating hidden mod?</param>
        /// <returns>List of all movements</returns>
        private static List <OsuMovement> createMovements(List <OsuHitObject> hitObjects, double clockRate, List <Vector <double> > strainHistory,
                                                          bool hidden = false, List <double> noteDensities = null)
        {
            var movements = new List <OsuMovement>();

            if (hitObjects.Count == 0)
            {
                return(movements);
            }

            // the first object
            movements.AddRange(OsuMovement.ExtractMovement(hitObjects[0]));

            // the rest
            for (int i = 1; i < hitObjects.Count; i++)
            {
                var objNeg4   = i > 3 ? hitObjects[i - 4] : null;
                var objNeg2   = i > 1 ? hitObjects[i - 2] : null;
                var objPrev   = hitObjects[i - 1];
                var objCurr   = hitObjects[i];
                var objNext   = i < hitObjects.Count - 1 ? hitObjects[i + 1] : null;
                var tapStrain = strainHistory[i];

                if (hidden)
                {
                    movements.AddRange(OsuMovement.ExtractMovement(objNeg2, objPrev, objCurr, objNext, tapStrain, clockRate,
                                                                   hidden: true, noteDensity: noteDensities[i], objNeg4: objNeg4));
                }
                else
                {
                    movements.AddRange(OsuMovement.ExtractMovement(objNeg2, objPrev, objCurr, objNext, tapStrain, clockRate, objNeg4: objNeg4));
                }
            }

            return(movements);
        }