Ejemplo n.º 1
0
        ParanoiaChoice GetPlayerChoice()
        {
            ParanoiaChoice theChoice = null;

            while (theChoice == null)
            {
                printChoices();
                ConsoleKey cki = C.ReadKey(true).Key;
                if (cki == ConsoleKey.Q)
                {
                    // quit
                }
                else if (cki == ConsoleKey.P)
                {
                    // Display Player Information
                }
                else
                {
                    int pr = KeyToInt(cki);
                    if (pr > -1 && pr < currentResponse.Choices.Length)
                    {
                        theChoice = currentResponse.Choices [pr];
                    }
                }
            }
            return(theChoice);
        }
Ejemplo n.º 2
0
        private void Play()
        {
            bool playing = true;

            currentResponse = p.Start();
            do
            {
                PrintResponse(currentResponse);
                if (currentResponse.Choices == null || currentResponse.Choices.Length == 0)
                {
                    playing = false;
                }
                else
                {
                    ParanoiaChoice c = GetPlayerChoice();
                    currentResponse = p.PlayerChoice(c);
                }
            } while (playing);
            More();
        }