Exemple #1
0
        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);
        }
Exemple #2
0
        public void AddStartRoundEntry(int round)
        {
            if (!this.fActive)
            {
                return;
            }
            StartRoundLogEntry startRoundLogEntry = new StartRoundLogEntry()
            {
                Round = round
            };

            this.fEntries.Add(startRoundLogEntry);
        }