Esempio n. 1
0
        static void Main(string[] args)
        {
            ConsoleReader consoleReader = new ConsoleReader();

            int victimHealh = consoleReader.GetHealth();

            Victim victim = consoleReader.GetVictim(victimHealh);

            victim.StepsToRun = 10;
            Killer killer = consoleReader.GetKiller();

            Weapon weapon = consoleReader.ChooseWeapon(killer);
            Shield shield = consoleReader.ChooseShield(victim);

            for (int i = 0; i < victim.StepsToRun; i++)
            {
                killer.Voice();
                victim.Voice();
                victim.Health = victim.Armor(shield, victim.Health);
                victim.Health = killer.Attack(weapon, victim.Health);

                if (victim.Health <= 0)
                {
                    Console.WriteLine("Victim died");
                    break;
                }
            }
        }
Esempio n. 2
0
 private void TriggerAttack(int instanceID, Killer killer)
 {
     if (this.killers.ContainsKey(instanceID))
     {
         killer.Attack(this.victims);
         this.tm.doOnce <int, Killer>(killer.GetFireInterval(), this.TriggerAttack, instanceID, killer);
     }
     return;
 }