Ejemplo n.º 1
0
        private void SetNoteCutStatus(NoteData noteData, NoteCutInfo noteCutInfo = null, bool initialCut = true)
        {
            GameStatus gameStatus = statusManager.gameStatus;

            gameStatus.ResetNoteCut();

            gameStatus.noteID              = noteData.id;
            gameStatus.noteType            = noteData.noteType.ToString();
            gameStatus.noteCutDirection    = noteData.cutDirection.ToString();
            gameStatus.noteLine            = noteData.lineIndex;
            gameStatus.noteLayer           = (int)noteData.noteLineLayer;
            gameStatus.timeToNextBasicNote = noteData.timeToNextBasicNote;

            if (noteCutInfo != null)
            {
                gameStatus.speedOK               = noteCutInfo.speedOK;
                gameStatus.directionOK           = noteCutInfo.directionOK;
                gameStatus.saberTypeOK           = noteCutInfo.saberTypeOK;
                gameStatus.wasCutTooSoon         = noteCutInfo.wasCutTooSoon;
                gameStatus.saberSpeed            = noteCutInfo.saberSpeed;
                gameStatus.saberDirX             = noteCutInfo.saberDir[0];
                gameStatus.saberDirY             = noteCutInfo.saberDir[1];
                gameStatus.saberDirZ             = noteCutInfo.saberDir[2];
                gameStatus.saberType             = noteCutInfo.saberType.ToString();
                gameStatus.swingRating           = noteCutInfo.swingRatingCounter == null ? -1 : initialCut ? noteCutInfo.swingRatingCounter.beforeCutRating : noteCutInfo.swingRatingCounter.afterCutRating;
                gameStatus.timeDeviation         = noteCutInfo.timeDeviation;
                gameStatus.cutDirectionDeviation = noteCutInfo.cutDirDeviation;
                gameStatus.cutPointX             = noteCutInfo.cutPoint[0];
                gameStatus.cutPointY             = noteCutInfo.cutPoint[1];
                gameStatus.cutPointZ             = noteCutInfo.cutPoint[2];
                gameStatus.cutNormalX            = noteCutInfo.cutNormal[0];
                gameStatus.cutNormalY            = noteCutInfo.cutNormal[1];
                gameStatus.cutNormalZ            = noteCutInfo.cutNormal[2];
                gameStatus.cutDistanceToCenter   = noteCutInfo.cutDistanceToCenter;
            }
        }
Ejemplo n.º 2
0
        private void SetNoteCutStatus(NoteData noteData, NoteCutInfo noteCutInfo = null, bool initialCut = true)
        {
            GameStatus gameStatus = statusManager.gameStatus;

            gameStatus.ResetNoteCut();

            // Backwards compatibility for <1.12.1
            gameStatus.noteID = -1;
            // Check the near notes first for performance
            for (int i = Math.Max(0, lastNoteId - 10); i < noteToIdMapping.Length; i++)
            {
                if (NoteDataEquals(noteToIdMapping[i], noteData, gameStatus.modNoArrows))
                {
                    gameStatus.noteID = i;
                    if (i > lastNoteId)
                    {
                        lastNoteId = i;
                    }
                    break;
                }
            }
            // If that failed, check the rest of the notes in reverse order
            if (gameStatus.noteID == -1)
            {
                for (int i = Math.Max(0, lastNoteId - 11); i >= 0; i--)
                {
                    if (NoteDataEquals(noteToIdMapping[i], noteData, gameStatus.modNoArrows))
                    {
                        gameStatus.noteID = i;
                        break;
                    }
                }
            }

            // Backwards compatibility for <1.12.1
            gameStatus.noteType         = noteData.colorType == ColorType.None ? "Bomb" : noteData.colorType == ColorType.ColorA ? "NoteA" : noteData.colorType == ColorType.ColorB ? "NoteB" : noteData.colorType.ToString();
            gameStatus.noteCutDirection = noteData.cutDirection.ToString();
            gameStatus.noteLine         = noteData.lineIndex;
            gameStatus.noteLayer        = (int)noteData.noteLineLayer;
            // If long notes are ever introduced, this name will make no sense
            gameStatus.timeToNextBasicNote = noteData.timeToNextColorNote;

            if (noteCutInfo != null)
            {
                gameStatus.speedOK               = noteCutInfo.speedOK;
                gameStatus.directionOK           = noteCutInfo.directionOK;
                gameStatus.saberTypeOK           = noteCutInfo.saberTypeOK;
                gameStatus.wasCutTooSoon         = noteCutInfo.wasCutTooSoon;
                gameStatus.saberSpeed            = noteCutInfo.saberSpeed;
                gameStatus.saberDirX             = noteCutInfo.saberDir[0];
                gameStatus.saberDirY             = noteCutInfo.saberDir[1];
                gameStatus.saberDirZ             = noteCutInfo.saberDir[2];
                gameStatus.saberType             = noteCutInfo.saberType.ToString();
                gameStatus.swingRating           = noteCutInfo.swingRatingCounter == null ? -1 : initialCut ? noteCutInfo.swingRatingCounter.beforeCutRating : noteCutInfo.swingRatingCounter.afterCutRating;
                gameStatus.timeDeviation         = noteCutInfo.timeDeviation;
                gameStatus.cutDirectionDeviation = noteCutInfo.cutDirDeviation;
                gameStatus.cutPointX             = noteCutInfo.cutPoint[0];
                gameStatus.cutPointY             = noteCutInfo.cutPoint[1];
                gameStatus.cutPointZ             = noteCutInfo.cutPoint[2];
                gameStatus.cutNormalX            = noteCutInfo.cutNormal[0];
                gameStatus.cutNormalY            = noteCutInfo.cutNormal[1];
                gameStatus.cutNormalZ            = noteCutInfo.cutNormal[2];
                gameStatus.cutDistanceToCenter   = noteCutInfo.cutDistanceToCenter;
            }
        }