コード例 #1
0
ファイル: ShellViewModel.cs プロジェクト: Gl0/CasualMeter
        private void ResetDamageTracker(ResetPlayerStatsMessage message = null)
        {
            if (Server == null)
            {
                return;
            }

            var saveEncounter = message != null && message.ShouldSaveCurrent;

            if (saveEncounter && !DamageTracker.IsArchived && DamageTracker.StatsByUser.Count > 0 &&
                DamageTracker.FirstAttack != null && DamageTracker.LastAttack != null)
            {
                DamageTracker.IsArchived = true;
                DamageTracker.Abnormals  = _abnormalityStorage.Clone();
                ArchivedDamageTrackers.Add(DamageTracker);
                return;
            }
            if (message != null && !message.ShouldSaveCurrent && DamageTracker.IsArchived)
            {
                ArchivedDamageTrackers.Remove(DamageTracker);
            }

            _abnormalityStorage.ClearEnded();
            DamageTracker = new DamageTracker
            {
                OnlyBosses     = OnlyBosses,
                IgnoreOneshots = IgnoreOneshots,
                Abnormals      = _abnormalityStorage,
                MeterPlayer    = _playerTracker?.Me()
            };
        }
コード例 #2
0
 public void Reset()
 {
     DamageTracker.Instance.Reset();
     _abnormalityStorage.ClearEnded();
     _forceUiUpdate = true;
 }