Exemplo n.º 1
0
        public void UpdateScoring(InputState state, ScoreManager scoreManager)
        {
            if (Scored)
            {
                return;
            }

            //First, check we're in the input range
            if (!state.ActiveInRange(Position))
            {
                return;
            }

            //We have a relevant 'down' on our mine. Note we're not checking for changes as mines can be hit staying down.
            //Let's see if they hit the mine

            double timeDelta = Math.Abs(state.Time - Time.Seconds);
            bool   isLate    = Time.Seconds > state.Time;

            if (timeDelta <= scoreManager.goodThreshold) //we'll consider this a 'hit'
            {
                scoreManager.onScoring(new Scoring(state.Time - Time.Seconds, Scoring.Rank.Miss, this));
                Scored = true;
            }
            else if (isLate && timeDelta > scoreManager.scoringThreshold)
            {
                scoreManager.onScoring(new Scoring(0, Scoring.Rank.Marv, this));
                Scored = true;
                Hit    = true;
            }
        }