public RiftEncounterDescriptor(Guid id, String name, long duration, bool emphasized, bool rrSupported, RiftOutcome outcome)
 {
     Id = id;
     Name = name;
     Duration = new TimeSpan(duration);
     IsEmphasized = emphasized;
     IsRrSupported = rrSupported;
     Outcome = outcome;
 }
 public RiftEncounterData(Guid id, string name, long startTime, long stopTime, RiftOutcome outcome)
 {
     Id = id;
     Name = name;
     StartTime = startTime;
     StopTime = stopTime;
     Duration = new TimeSpan(stopTime-startTime);
     Outcome = outcome;
 }
        private RiftEncounter getCurrentEncounter(string name, RiftOutcome outcome)
        {
            lock (this.encounterLock)
            {
                Dictionary<string, RiftEntity> entityMap = new Dictionary<string, RiftEntity>();
                lock (this.inProgressEntityMap)
                {
                    foreach (var riftEntity in inProgressEntityMap)
                    {
                        entityMap.Add(riftEntity.Key, riftEntity.Value);
                    }
                }

                return new RiftEncounter(
                    this.inProgressEncounterId,
                    name,
                    this.inProgressEncounterStartTime,
                    this.inProgressEncounterStopTime,
                    outcome,
                    inProgressEncounterActions, entityMap);
            }
        }
        public void commitEncounter(RiftOutcome outcome, bool rrSupported)
        {
            Guid encounterId = Guid.NewGuid();

            lock (this.encounterLock)
            {
                encounterId = this.inProgressEncounterId;

                if ((this.inProgressEncounterActions.Count > 0) &&
                    (this.inProgressEncounterStopTime - this.inProgressEncounterStartTime > 15L))
                {
                    var emphasized = true;
                    if (this.inProgressEncounterName == null)
                    {
                        emphasized = false;
                        this.inProgressEncounterName = chooseEncounterName();
                    }

                    long duration = this.inProgressEncounterStopTime - this.inProgressEncounterStartTime;
                    //this.descriptorList.add(new RiftEncounterDescriptor(this.inProgressEncounterId, this.inProgressEncounterName, duration, emphasized, rrSupported, outcome));

                    RiftEncounter newEncounter = getCurrentEncounter(this.inProgressEncounterName, outcome);

                    //RiftEncounterPersistence.saveEncounter(newEncounter);

                    if (newEncounter.getActions().Any(x => RiftActionFilterFactory.getDamageTypes().Contains(x.ActionType)))
                    {
                        _riftDataStore.Add(newEncounter);
                        this.inProgressEncounterId = Guid.NewGuid();
                    }
                }

                this.inProgressEncounterName = null;
                this.inProgressEncounterStartTime = 0L;
                this.inProgressEncounterStopTime = 0L;
                this.inProgressEncounterActions = new List<RiftAction>();
                this.inProgressEntityMap.Clear();
            }

            //this.listenerList.inProgressEncounterUpdated(encounterId);
            //this.listenerList.encounterListUpdated(this._bossEncountersOnly);
        }