예제 #1
0
        private static void SetupGame(int sizeList, string nameList)
        {
            WordSearch wordSearch = new WordSearch();

            wordSearch.HandleSetupWords(nameList, sizeList);
            wordSearch.HandleSetupGrid();

            FrontEnd.HandlePrintGame(wordSearch.Words, wordSearch.Grid);
            FrontEnd.MessageNFInfo();
        }
예제 #2
0
        private static void HandleSetupGame()
        {
            FrontEnd.MessagePromptListSize();
            int listSize = HandleGetSizeSelection();

            FrontEnd.MessagePromptListSelect();
            string listSelected = HandleGetListSelection();

            SetupGame(listSize, listSelected);
            FrontEnd.MessagePromptRestart();
            GameLoop();
        }
예제 #3
0
        /*======================*
         * 4. In-game user input *
         *=======================*/
        private static void GameLoop()
        {
            inGame = true;
            while (inGame)
            {
                char input = FrontEnd.ReadUserInput();
                switch (input)
                {
                case 'p':
                    ReadStartQuitGame();
                    break;

                case 'q':
                    Environment.Exit(0);
                    break;
                }
            }
        }
예제 #4
0
        /*==============================*
         *  3. Handle game control flow  *
         *===============================*/
        private static void ReadStartQuitGame()
        {
            bool setup = true;

            while (setup && !inGame)
            {
                char input = FrontEnd.ReadUserInput();
                switch (input)
                {
                case 'p':
                    HandleSetupGame();
                    break;

                case 'q':
                    Environment.Exit(0);
                    break;
                }
            }
            HandleSetupGame();
        }
예제 #5
0
        private static int HandleGetSizeSelection()
        {
            int listSize = 0;

            while (listSize == 0)
            {
                char input = FrontEnd.ReadUserInput();
                switch (input)
                {
                case 's':
                    listSize = 6;
                    break;

                case 'm':
                    listSize = 12;
                    break;

                case 'l':
                    listSize = 18;
                    break;
                }
            }
            return(listSize);
        }
예제 #6
0
        private static string HandleGetListSelection()
        {
            string listSelected = "";

            while (listSelected == "")
            {
                char input = FrontEnd.ReadUserInput();
                switch (input)
                {
                case 'i':
                    listSelected = "Instruments";
                    break;

                case 'm':
                    listSelected = "Mammals";
                    break;

                case 'o':
                    listSelected = "Occupations";
                    break;
                }
            }
            return(listSelected);
        }
예제 #7
0
 private static void FirstGameMessage()
 {
     FrontEnd.MessageGreet();
     FrontEnd.MessagePromptStart();
 }