示例#1
0
        /// <summary>
        /// Saves the current <c>Score</c> (and record if reached) and resets the score
        /// to its initial value. Use this method for example when a user restarts a
        /// level with a fresh score of 0.
        /// </summary>
        /// <param name="save">If set to <c>true</c> save.</param>
        public void Reset(bool save)
        {
            if (save)
            {
                ScoreStorage.SetLatestScore(this, _tempScore);

                double record = ScoreStorage.GetRecordScore(this);
                if (HasTempReached(record))
                {
                    ScoreStorage.SetRecordScore(this, _tempScore);
                    _scoreRecordReachedSent = false;
                }

                performSaveActions();
            }

            SetTempScore(StartValue);
        }
示例#2
0
        /// <summary>
        /// Determines if this <c>Score</c> has reached a record value of the given <c>scoreVal</c>.
        /// </summary>
        /// <returns>If this score has reached the given record returns <c>true</c>;
        /// otherwise <c>false</c>.</returns>
        /// <param name="scoreVal">numeric score value.</param>
        public bool HasRecordReached(double scoreVal)
        {
            double record = ScoreStorage.GetRecordScore(this);

            return(HasScoreReached(record, scoreVal));
        }