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 int Damage(Guid id, int round, bool allies, Encounter enc) { int num = 0; foreach (RoundLog fRound in this.fRounds) { if (fRound.Round != round && round != 0) { continue; } foreach (TurnLog turn in fRound.Turns) { if (!(turn.ID == id) && !(id == Guid.Empty)) { continue; } List <Guid> _allies = EncounterReport.get_allies(turn.ID, enc); List <Guid> guids = new List <Guid>(); if (!allies) { foreach (Guid combatant in this.Combatants) { if (_allies.Contains(combatant)) { continue; } guids.Add(combatant); } } else { guids.AddRange(_allies); } num += turn.Damage(guids); } } return(num); }