Exemple #1
0
        public void TerminalMain()
        {
            //ToDo: Consider putting all this in a navigation object with states

            GameData objGameData = new GameData();

            string userInput = string.Empty;

            while (userInput.ToUpper() != "x".ToUpper())
            {
                Console.Clear();
                Console.WriteLine("Who Wants to Be a Millionaire?\n");

                if (objGameData.gamesPlayed > 0)
                {
                    objGameData.GameSummary();
                }
                Console.WriteLine("Here are your choices: \n1. Start New Game\n2. Add Question\n3. Load default questions\nx. Exit");
                userInput = Console.ReadLine();

                switch (userInput)
                {
                case "1":
                    playGame(ref objGameData);
                    break;

                case "2":
                    //ToDo: Setting to add questions
                    Console.WriteLine("Who Wants to Be a Millionaire?\n");
                    AddQuestion(ref objGameData);
                    break;

                case "3":
                    if (objGameData.GetNumberOfQuestions() == 0)
                    {
                        // Load default game questions
                        objGameData.SetDefaultQuestions();
                    }
                    else
                    {
                        Console.WriteLine("Default questions have already been loaded.\nPress any key to continue...");
                        Console.ReadKey();
                    }
                    break;

                case "4":
                    ProgramSms objSms = new ProgramSms();
                    objSms.PublicRetrieveAllSms();
                    break;
                }
            }
        }
Exemple #2
0
        private static void Main(string[] args)
        {
            ProgramSms objSms = new ProgramSms();
            int        status = 0;

            //objSms.PublicSendSms(ref status, "2029461187", "4253459249", "test message");
            objSms.PublicReadSms();
            //objSms.PublicTestSms();
            objSms.PublicRetrieveAllSms();

            Console.WriteLine("waiting");
            Console.ReadKey();
            if (status != 0)
            {
                Console.WriteLine("could not send message due status error: {0}", status);
                throw new System.Exception("Error with SMS send");
            }
            ProgramTerminal objTerminal = new ProgramTerminal();

            objTerminal.TerminalMain();
        }