Exemplo n.º 1
0
        public void Attack()
        {
            var         evasionChance = opponent.Evasion;
            var         shots         = player.Shoot();
            List <Shot> hits          = new List <Shot>();

            foreach (var shot in shots)
            {
                var hitChance = randomNumberService.Range(0, 100);
                if (hitChance > evasionChance)
                {
                    hits.Add(shot);
                }
            }
            opponent.AcceptIncomingShots(hits.ToArray());
        }