Beispiel #1
0
        private static IKing SetUpKing()
        {
            string kingName = Console.ReadLine();
            IKing  king     = new King(kingName, new List <IMortal>());

            string[] royalGuardNames = Console.ReadLine().Split();
            foreach (var royalGuardName in royalGuardNames)
            {
                king.AddMortal(new RoyalGuard(royalGuardName));
            }

            string[] footmanNames = Console.ReadLine().Split();
            foreach (var footmanName in footmanNames)
            {
                king.AddMortal(new Footman(footmanName));
            }

            return(king);
        }