Exemplo n.º 1
0
    private static King SetupKing()
    {
        string kingName = Console.ReadLine();
        King   king     = new King(kingName, new List <Subject>());

        string[] royalGurards = Console.ReadLine().Split(' ', StringSplitOptions.RemoveEmptyEntries);

        foreach (string guardName in royalGurards)
        {
            RoyalGuard guard = new RoyalGuard(guardName);

            king.AddSubject(guard);
        }

        string[] footmen = Console.ReadLine().Split(' ', StringSplitOptions.RemoveEmptyEntries);

        foreach (string footmanName in footmen)
        {
            Footman footman = new Footman(footmanName);

            king.AddSubject(footman);
        }

        return(king);
    }