Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            Finch tim = InstantiateTim();

            GD.DisplayOpenScreen("Sentry Finch", "tim will detect light and temp levels", new string[1] {
                "Eric Grant"
            });
            DisplayMenu(tim);
            tim.disConnect();
            GD.DisplayCloseScreen("Sentry Finch", new string[1] {
                "Eric Grant"
            });
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            Generic_Display GD = new Generic_Display();
            Generic_Input   GI = new Generic_Input();
            Generic_Alter   GA = new Generic_Alter();

            GD.DisplayOpenScreen("Super Finch", "Tina the super finch will move forward until she is murdered by lazers and freeze rays.", new string[1] {
                "Eric Grant"
            });
            DisplayMainLoop(GD, GI, GA);
            GD.DisplayCloseScreen("Super Finch", new string[1] {
                "Eric Grant"
            });
        }
Ejemplo n.º 3
0
        /// <summary>
        /// display a title screen with menu
        /// </summary>
        /// <returns>MainMenuOption user selected</returns>
        static bool MainMenu(List <SeaMonster> seaMonsters, List <FurryMonster> furryMonsters, Generic_Display display)
        {
            //declare vars
            //
            int            selected = 0;
            ConsoleKeyInfo uKey;
            bool           breaking = false;
            bool           exit     = false;

            string[] options = new string[5]
            {
                "Make Sea Monster"
                , "Display Sea Monster Info"
                , "Make Furry Monster"
                , "Display Furry Monster Info"
                , "Exit"
            };

            Console.CursorVisible = false;

            //menu loop
            //
            do
            {
                Console.Clear();

                Console.WriteLine("~ MOSNTER MENU ~");
                Console.WriteLine("\nARROWS TO NAVIGATE\nENTER TO SELECT\n");

                //print options
                //
                for (int i = 0; i < options.Length; i++)
                {
                    if (selected == i)
                    {
                        Console.Write("(*) ");
                        Console.WriteLine(options[i]);
                    }
                    else
                    {
                        Console.Write("( ) ");
                        Console.WriteLine(options[i]);
                    }
                }

                //get input and determine selected option
                //
                uKey = Console.ReadKey(true);

                if (uKey.Key.ToString() == "DownArrow") //user moves down
                {
                    selected++;
                    if (selected > options.Length - 1)
                    {
                        selected = 0;
                    }
                }
                else if (uKey.Key.ToString() == "UpArrow") //user moves up
                {
                    selected--;
                    if (selected < 0)
                    {
                        selected = Convert.ToInt16(options.Length - 1);
                    }
                }
                else if (uKey.Key.ToString() == "Enter") //user selects option
                {
                    breaking = true;
                }
            } while (!breaking);

            switch (options[selected])
            {
            case "Make Sea Monster":
                DisplayUserAddSeaMonsters(seaMonsters, display);
                break;

            case "Display Sea Monster Info":
                DisplayAllSeaMonsterInfo(seaMonsters, display);
                break;

            case "Make Furry Monster":
                DisplayUserAddFurryMonsters(furryMonsters, display);
                break;

            case "Display Furry Monster Info":
                DisplayAllFurryMonsterInfo(furryMonsters, display);
                break;

            case "Exit":
                exit = true;
                display.DisplayNewScreen("Goodbye");

                foreach (SeaMonster monster in seaMonsters)
                {
                    monster.GoodBye(monster);
                }

                foreach (FurryMonster monster in furryMonsters)
                {
                    monster.GoodBye(monster);
                }

                display.DisplayAnyKey();

                display.DisplayCloseScreen("Sea Monster Classes", new string[1] {
                    "Eric Grant"
                });
                break;

            default:
                break;
            }

            Console.CursorVisible = true;
            return(exit);
        }