public NewGame() { ScreenController.Clear(); AddQuestions(); AddDecisions(); Run(); }
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(); } }
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(); } }
private void Intro() { ScreenController.Clear(); ScreenController.Write("You wake up in your house."); int input = intro.Run(); if (input == 1) { Bathroom(); } else { Kitchen(); } }
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()); }
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()); }
private void Cycle() { ScreenController.Clear(); ScreenController.Write("You travel to work by bike."); Console.ReadLine(); }
private void Walk() { ScreenController.Clear(); ScreenController.Write("You travel to work by foot."); Console.ReadLine(); }
public MainMenu() { ScreenController.Clear(); AddDecisions(); Run(); }