internal EncounterReport CreateReport(Encounter enc, bool all_entries) { EncounterReport encounterReport = new EncounterReport(); RoundLog roundLog = null; TurnLog timestamp = null; foreach (IEncounterLogEntry fEntry in this.fEntries) { StartRoundLogEntry startRoundLogEntry = fEntry as StartRoundLogEntry; StartTurnLogEntry startTurnLogEntry = fEntry as StartTurnLogEntry; if (startRoundLogEntry != null) { if (roundLog != null) { encounterReport.Rounds.Add(roundLog); } roundLog = new RoundLog(startRoundLogEntry.Round); } else if (startTurnLogEntry == null) { if (!all_entries && !fEntry.Important) { continue; } timestamp.Entries.Add(fEntry); } else { if (timestamp != null) { timestamp.End = startTurnLogEntry.Timestamp; roundLog.Turns.Add(timestamp); } timestamp = new TurnLog(startTurnLogEntry.CombatantID) { Start = startTurnLogEntry.Timestamp }; } } if (roundLog != null) { if (timestamp != null) { if (timestamp.Entries.Count != 0) { timestamp.End = timestamp.Entries[timestamp.Entries.Count - 1].Timestamp; } roundLog.Turns.Add(timestamp); } encounterReport.Rounds.Add(roundLog); } return(encounterReport); }
public TurnLog GetTurn(Guid id) { TurnLog turnLog; List <TurnLog> .Enumerator enumerator = this.fTurns.GetEnumerator(); try { while (enumerator.MoveNext()) { TurnLog current = enumerator.Current; if (current.ID != id) { continue; } turnLog = current; return(turnLog); } return(null); } finally { ((IDisposable)enumerator).Dispose(); } }