public static void Main()
        {
            SoldierList soldiers = new SoldierList();
            King        king     = new King(Console.ReadLine());

            string[] royalGuardsNames = Console.ReadLine().Split();

            foreach (string guardName in royalGuardsNames)
            {
                RoyalGuard currentRoyalGuard = new RoyalGuard(guardName, king);
                soldiers.Add(currentRoyalGuard);
                king.BeingAttacked += currentRoyalGuard.OnKingBeingAttacked;
            }

            string[] footmenNames = Console.ReadLine().Split();

            foreach (string footManName in footmenNames)
            {
                Footman footman = new Footman(footManName, king);
                soldiers.Add(footman);
                king.BeingAttacked += footman.OnKingBeingAttacked;
            }

            soldiers.ForEach(s => s.SoldierKilled += soldiers.OnSoldierKilled);

            string[] command = Console.ReadLine().Split();

            while (command[0] != "End")
            {
                switch (command[0])
                {
                case "Kill":

                    Soldier attackedSoldier = soldiers.FirstOrDefault(s => s.Name.Equals(command[1]));
                    attackedSoldier.TakeAttack();
                    break;

                case "Attack":

                    king.TakeAttack();
                    break;
                }

                command = Console.ReadLine().Split();
            }
        }
        private static void Main()
        {
            SoldierList soldiers = new SoldierList();
            King        king     = new King(Console.ReadLine());

            string[] royalGuardNames = Console.ReadLine().Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
            foreach (var name in royalGuardNames)
            {
                RoyalGuard rg = new RoyalGuard(name);
                rg.SoldierDead += soldiers.HandleDeadSoldier;
                rg.SoldierDead += king.OnSoldierDeath;
                soldiers.Add(rg);
                king.KingAttacked += rg.OnKingAttack;
            }

            string[] footmanNames = Console.ReadLine().Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
            foreach (var name in footmanNames)
            {
                Footman fm = new Footman(name);
                fm.SoldierDead += soldiers.HandleDeadSoldier;
                fm.SoldierDead += king.OnSoldierDeath;
                soldiers.Add(fm);
                king.KingAttacked += fm.OnKingAttack;
            }

            string command = string.Empty;

            while ((command = Console.ReadLine()) != "End")
            {
                var tokens = command.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);

                if (tokens[0] == "Attack")
                {
                    king.RespondToAttack();
                }
                else if (tokens[0] == "Kill")
                {
                    string    name    = tokens[1];
                    IDefender soldier = soldiers.First(x => x.Name == name);
                    soldier.TakeAttack();
                }
            }
        }