Beispiel #1
0
        public static void Main(string[] args)
        {
            JokeManager   jokeList = new JokeManager();
            UserInterface ui       = new UserInterface(jokeList);

            ui.Start();
        }
Beispiel #2
0
        public static void Main(string[] args)
        {
            JokeManager   manager = new JokeManager();
            UserInterface ui      = new UserInterface(manager);

            ui.Start();
        }
Beispiel #3
0
        public static void Main(string[] args)
        {
            // List<string> jokes = new List<string>();
            JokeManager   joker = new JokeManager();
            UserInterface ui    = new UserInterface(joker);

            ui.Start();
        }
Beispiel #4
0
        public static void Main(string[] args)
        {
            JokeManager manager = new JokeManager();

            manager.AddJoke("What is red and smells of blue paint? - Red paint.");
            manager.AddJoke("What is blue and smells of red paint? - Blue paint.");

            Console.WriteLine("Drawing jokes:");
            for (int i = 0; i < 5; i++)
            {
                Console.WriteLine(manager.DrawJoke());
            }

            Console.WriteLine("");
            Console.WriteLine("Printing jokes:");
            manager.PrintJokes();
        }
        public static void Main(string[] args)
        {
            JokeManager manager = new JokeManager();

            /*manager.AddJoke("What is red and smells of blue paint? - Red paint.");
             * manager.AddJoke("What is blue and smells of red paint? - Blue paint.");
             *
             * Console.WriteLine("Drawing jokes:");
             * for (int i = 0; i < 5; i++)
             * {
             * Console.WriteLine(manager.DrawJoke());
             * }
             *
             * Console.WriteLine("");
             * Console.WriteLine("Printing jokes:");
             * manager.PrintJokes();*/

            // Part 2
            UserInterface ui = new UserInterface(manager);

            ui.Start();
        }
Beispiel #6
0
 public UserInterface(JokeManager joke)
 {
     this.joke = joke;
 }
Beispiel #7
0
 public UserInterface(JokeManager manager)
 {
     this.manager = manager;
 }
Beispiel #8
0
 public UserInterface(JokeManager joker)
 {
     this.joker = joker;
 }
Beispiel #9
0
        private JokeManager jokeManager;              //An instance of the JokeManager object class

        public UserInterface(JokeManager jokeManager) //Constructor
        {
            this.jokeManager = jokeManager;
        }
Beispiel #10
0
 public UserInterface(JokeManager jokes)
 {
     this.jokes = jokes;
 }
Beispiel #11
0
 public UserInterface(JokeManager jokeList)
 {
     this.jokeList = jokeList;
 }
Beispiel #12
0
        public static void Main(string[] args)
        {
            JokeManager   manager = new JokeManager();
            UserInterface ui      = new UserInterface(manager);

            ui.Start();

            /*JokeManager manager = new JokeManager();
             * manager.AddJoke("What is red and smells of blue paint? - Red paint.");
             * manager.AddJoke("What is blue and smells of red paint? - Blue paint.");
             *
             * Console.WriteLine("Drawing jokes:");
             * for (int i = 0; i < 5; i++)
             * {
             *  Console.WriteLine(manager.DrawJoke());
             * }
             *
             * Console.WriteLine("");
             * Console.WriteLine("Printing jokes:");
             * manager.PrintJokes();*/
            /*List<string> jokes = new List<string>();
             * Console.WriteLine("What a joke!");
             *
             * while (true)
             * {
             * Console.WriteLine("Commands:");
             * Console.WriteLine(" 1 - add a joke");
             * Console.WriteLine(" 2 - draw a joke");
             * Console.WriteLine(" 3 - list jokes");
             * Console.WriteLine(" X - stop");
             *
             * string command = Console.ReadLine();
             *
             * if (command == "X")
             * {
             *  break;
             * }
             *
             * if (command == "1")
             * {
             *  Console.WriteLine("Write the joke to be added:");
             *  string joke = Console.ReadLine();
             *  jokes.Add(joke);
             * }
             * else if (command == "2")
             * {
             *  Console.WriteLine("Drawing a joke.");
             *
             *  if (jokes.Count == 0)
             *  {
             *    Console.WriteLine("Jokes are in short supply.");
             *  }
             *  else
             *  {
             *    Random draw = new Random();
             *    int index = draw.Next(0, jokes.Count);
             *    Console.WriteLine(jokes[index]);
             *  }
             *
             * }
             * else if (command == "3")
             * {
             *  Console.WriteLine("Printing the jokes.");
             *  foreach (string joke in jokes)
             *  {
             *    Console.WriteLine(joke);
             *  }
             * }
             * }*/
        }