Example #1
0
 public NewGame()
 {
     ScreenController.Clear();
     AddQuestions();
     AddDecisions();
     Run();
 }
Example #2
0
        private void Kitchen()
        {
            ScreenController.Clear();
            ScreenController.Write("You make your way down to the kitchen to get some food.");
            int input = breakfast.Run();

            ScreenController.Clear();
            if (input == 1)
            {
                ScreenController.Write("You make a healthy breakfast and find yourself with plenty of time to travel to work.");
            }
            else
            {
                ScreenController.Write("You have a massive greasy breakfast that you spend loads of time enjoying, but are now late for work!");
            }
            input = travel.Run();
            if (input == 1)
            {
                Walk();
            }
            else
            {
                Cycle();
            }
        }
Example #3
0
        private void Bathroom()
        {
            ScreenController.Clear();
            ScreenController.Write("You clean your teeth and go for a shower, but in doing so you are now running late for work!");
            int input = travel.Run();

            if (input == 1)
            {
                Walk();
            }
            else
            {
                Cycle();
            }
        }
Example #4
0
        private void Intro()
        {
            ScreenController.Clear();
            ScreenController.Write("You wake up in your house.");
            int input = intro.Run();

            if (input == 1)
            {
                Bathroom();
            }
            else
            {
                Kitchen();
            }
        }
Example #5
0
        private void EnterName()
        {
            ScreenController.Clear();
            var charName = enterName.Run();
            int input    = confirmName.Run();

            if (input == 1)
            {
                GameController.character.Name = charName;
                EnterGender();
            }
            else
            {
                EnterName();
            }
        }
        public void Clear_HappyPath_MovesCursorLocationToTopLeft()
        {
            // Arrange

            var screenBufferMock = new Mock <IScreenBuffer>();

            // Act

            var screenController = new ScreenController(screenBufferMock.Object);

            screenController.Clear();

            // Assert

            screenBufferMock.VerifySet(sb => sb.CursorLeft = 0, Times.Once());
            screenBufferMock.VerifySet(sb => sb.CursorTop  = 0, Times.Once());
        }
Example #7
0
        private void EnterGender()
        {
            ScreenController.Clear();
            string charGender = enterGender.Run();
            int    input      = confirmGender.Run();

            if (input == 1)
            {
                GameController.character.Gender = charGender;
                ScreenController.Clear();
                ScreenController.Write("Saved");
                ScreenController.Write($"Name: {GameController.character.Name}");
                ScreenController.Write($"Gender: {GameController.character.Gender}");
                GameController.CreateSaveFile();
                Console.Read();
            }
            else
            {
                EnterGender();
            }
        }
        public void Clear_HappyPath_RendersToScreenBuffer()
        {
            // Arrange

            var screenBufferMock = new Mock <IScreenBuffer>();

            // Act

            var screenController = new ScreenController(screenBufferMock.Object);

            screenController.Clear();

            // Assert

            var buffer = new CharInfo[1];

            screenBufferMock.Verify(sb => sb.Render(
                                        It.Is <Action <CharInfo[]> >(
                                            a => Apply(a, buffer)
                                            .All(ci => ci.AsciiChar == '\0' && ci.Attributes == 7))),
                                    Times.Once());
        }
Example #9
0
 private void Cycle()
 {
     ScreenController.Clear();
     ScreenController.Write("You travel to work by bike.");
     Console.ReadLine();
 }
Example #10
0
 private void Walk()
 {
     ScreenController.Clear();
     ScreenController.Write("You travel to work by foot.");
     Console.ReadLine();
 }
Example #11
0
 public MainMenu()
 {
     ScreenController.Clear();
     AddDecisions();
     Run();
 }