Exemplo n.º 1
0
        public async Task <IEnumerable <KilliPrinter> > LiveKilledOrTeamEliminiated(IEnumerable <LiveEventKill> playerKilled)
        {
            var result = await _teamPlayerRepository.GetPlayersId(playerKilled).ConfigureAwait(false);

            var killiPrinter = new List <KilliPrinter>();

            foreach (var item in result.Where(c => c.IsGroggy == false))
            {
                var playerKillMessage = new PlayerKilledGraphics()
                {
                    TimeKilled      = item.TimeKilled,
                    KillerName      = item.KillerName,
                    VictimName      = item.VictimName,
                    VictimLocation  = item.VictimLocation,
                    DamagedCausedBy = _assetsRepository.GetDamageCauserName(item.DamagedCausedBy),
                    DamageReason    = item.DamageReason,
                    VictimTeamId    = item.VictimTeamId,
                    KillerTeamId    = item.KillerTeamId,
                    KillerPlayerId  = item.KillerPlayerId,
                    VictimPlayerId  = item.VictimPlayerId,
                };

                var killMessage = new KilliPrinter()
                {
                    PlayerKilled = playerKillMessage
                };


                killiPrinter.Add(killMessage);
            }

            return(killiPrinter);
        }
Exemplo n.º 2
0
        private async Task <KilliPrinter> LiveKilledOrTeamEliminiated(IEnumerable <LiveEventKill> playerKilled)
        {
            var result = await _teamPlayerRepository.GetPlayersId(playerKilled).ConfigureAwait(false);

            var playerKillMessage = result.Select(item => new PlayerKilledGraphics()
            {
                TimeKilled      = item.TimeKilled,
                KillerName      = item.KillerName,
                VictimName      = item.VictimName,
                VictimLocation  = item.VictimLocation,
                DamagedCausedBy = _assetsRepository.GetDamageCauserName(item.DamagedCausedBy),
                DamageReason    = item.DamageReason,
                VictimTeamId    = item.VictimTeamId,
                KillerTeamId    = item.KillerTeamId,
                KillerPlayerId  = item.KillerPlayerId,
                VictimPlayerId  = item.VictimPlayerId
            }).FirstOrDefault();

            var killMessage = new KilliPrinter()
            {
                PlayerKilled = playerKillMessage
            };

            return(killMessage);
        }