Exemplo n.º 1
0
        public void Start()
        {
            do
            {
                Console.WriteLine("Welcome Villain! What would you like to do?");
                Console.WriteLine("[0] Create a Villain?");
                Console.WriteLine("[1] Get all Villains?");
                Console.WriteLine("[2] Create some chaos?");
                Console.WriteLine("[3] Go back to the main menu?");
                userInput = Console.ReadLine();
                switch (userInput)
                {
                case "0":
                    //call create a villain, call get villain details
                    SuperVillain newVillain = GetVillainDetails();
                    repo.AddAVillain(newVillain);
                    break;

                case "1":
                    //call get all villains
                    foreach (var villain in villainService.GetAllVillains())
                    {
                        Console.WriteLine($"Hero: \n\tHero Alias: {villain.Alias} \n\tHero Real Name: {villain.RealName} \n\tHero Hideout: {villain.HideOut}");
                        foreach (var power in villain.SuperPowers)
                        {
                            Console.WriteLine($"\tSuper Powers:\n\t\tName: {power.Name}\n\t\tDescription: {power.Description}");
                        }
                    }
                    break;

                case "2":
                    //call the event delegate for villain work, call get villain by name
                    tasks.PlanWorldDomination();
                    tasks.CreateChaos();
                    break;

                case "3":
                    //call the main menu
                    Console.WriteLine("Going back to main");
                    break;

                default:
                    //invalid input message;
                    service.InvalidInputMessage();
                    break;
                }
            } while (!userInput.Equals("3"));
        }
Exemplo n.º 2
0
        public void Start()
        {
            do
            {
                Console.WriteLine("Welcome Villain! What would you like to do?");
                Console.WriteLine("[0] Create a Villain?");
                Console.WriteLine("[1] Get all Villains?");
                Console.WriteLine("[2] Create some chaos?");
                Console.WriteLine("[3] Go back to the main menu?");
                userInput = Console.ReadLine();
                switch (userInput)
                {
                case "0":
                    //call create a villain, call get villain details
                    SuperVillain newVillain = GetVillainDetails();
                    repo.AddAVillain(newVillain);
                    break;

                case "1":
                    //call get all villains
                    repo.GetAllVillains();
                    break;

                case "2":
                    //call the event delegate for villain work, call get villain by name
                    tasks.PlanWorldDomination();
                    tasks.CreateChaos();
                    break;

                case "3":
                    //call the main menu
                    MainMenu main = new MainMenu();
                    main.Start();
                    break;

                default:
                    //invalid input message;
                    service.InvalidInputMessage();
                    break;
                }
            }while(!userInput.Equals("3"));
        }
Exemplo n.º 3
0
 public void AddVillain(SuperVillain newVillain)
 {
     //Add some business logic here
     repo.AddAVillain(newVillain);
 }