Esempio n. 1
0
        public SessionStats(
            int encounters, TimeSpan duration,
            long damageTotal, int damageEvents,
            long healingTotal, int healingEvents,
            long shieldingTotal, int shieldingEvents,
            Dictionary <string, int> playerDeaths,
            Dictionary <string, int> npcDeaths,
            Dictionary <string, long> npcDamageTaken)
        {
            Encounters  = encounters;
            Duration    = duration;
            DamageStats = new DamageDoneStats {
                Events = damageEvents, Total = damageTotal
            };
            HealingStats = new HealingDoneStats {
                Events = healingEvents, Total = healingTotal
            };
            ShieldingStats = new ShieldingDoneStats {
                Events = shieldingEvents, Total = shieldingTotal
            };

            Deaths = new DeathStats
            {
                NpcDeaths    = new List <CharacterDeath>(),
                PlayerDeaths = new List <CharacterDeath>()
            };
            foreach (var(k, v) in playerDeaths.OrderByDescending(e => e.Value))
            {
                Deaths.PlayerDeaths.Add(new CharacterDeath
                {
                    Name   = k,
                    Deaths = v
                });
            }
            foreach (var(k, v) in npcDeaths.OrderByDescending(e => e.Value))
            {
                Deaths.NpcDeaths.Add(new CharacterDeath
                {
                    Name   = k,
                    Deaths = v
                });
            }

            NpcDamageTaken = new Dictionary <string, long>();
            foreach (var(k, v) in npcDamageTaken.OrderByDescending(e => e.Value))
            {
                NpcDamageTaken.Add(k, v);
            }
        }
Esempio n. 2
0
        public EncounterStats(
            int encounterNumber, TimeSpan duration,
            long damageTotal, int damageEvents,
            long healingTotal, int healingEvents,
            long shieldingTotal, int shieldingEvents,
            Dictionary<string, int> playerDeaths,
            Dictionary<string, int> npcDeaths,
            Dictionary<string, long> npcDamageTaken)
        {
            EncounterNumber = encounterNumber;
            Duration = duration;
            DamageStats = new DamageDoneStats { Events = damageEvents, Total = damageTotal };
            HealingStats = new HealingDoneStats { Events = healingEvents, Total = healingTotal };
            ShieldingStats = new ShieldingDoneStats { Events = shieldingEvents, Total = shieldingTotal };

            Deaths = new DeathStats
            {
                NpcDeaths = new List<CharacterDeath>(),
                PlayerDeaths = new List<CharacterDeath>()
            };
            foreach (var (k, v) in playerDeaths.OrderByDescending(e => e.Value))
            {
                Deaths.PlayerDeaths.Add(new CharacterDeath
                {
                    Name = k,
                    Deaths = v
                });
            }
            foreach (var (k, v) in npcDeaths.OrderByDescending(e => e.Value))
            {
                Deaths.NpcDeaths.Add(new CharacterDeath
                {
                    Name = k,
                    Deaths = v
                });
            }

            if (npcDamageTaken.Any())
            {
                var topNpc = npcDamageTaken.OrderByDescending(e => e.Value).First();
                TopDamageTakenNpcTotal = topNpc.Value;
                TopDamageTakenNpcName = topNpc.Key;
            }
            
        }