public void keyChoice_rightKeyReturned_True(char value) { int decision = ServiceFunctions.ChoosingRightKey(value); int supposedResult = value - 48; Assert.Equal(supposedResult, decision); }
public void ChooseStats() { int _attackCoefficient = 0; int _defenceCoefficient = 0; int _socialCoefficient = 0; do { _attackCoefficient = 0; _defenceCoefficient = 0; _socialCoefficient = 0; Console.WriteLine("\nTo make your attacks more effective, press 1, to make your evasive manoeuvres more effective, press 2, to make your social interactions more effective, any other key"); int result = ServiceFunctions.ChoosingRightKey(Console.ReadKey().KeyChar); switch (result) { case 1: _attackCoefficient = 1; break; case 2: _defenceCoefficient = 1; break; default: _socialCoefficient = 1; break; } Console.WriteLine($"Your defence skill is {_defenceCoefficient}, your attack skill is {_attackCoefficient}, your social skill is {_socialCoefficient}. If you agree, enter 1, if not, enter anything else. "); }while (ServiceFunctions.ChoosingRightKey(Console.ReadKey().KeyChar) != 1); attackCoefficient += _attackCoefficient; defenceCoefficient += _defenceCoefficient; socialCoefficient += _socialCoefficient; }
public void preGiving() { string result; do { Console.WriteLine("\nType the name of your creature"); result = Console.ReadLine(); Console.WriteLine($"Your name is {result}. If you agree, enter 1, if not, enter anything else."); }while (ServiceFunctions.ChoosingRightKey(Console.ReadKey().KeyChar) != 1); name = result; }
public void LevelLoop() { while (true) { Console.WriteLine("To go to main menu, press 9. To exit game, press 0."); int key = ServiceFunctions.ChoosingRightKey(Console.ReadKey().KeyChar); switch (key) { case 9: MainFunctions.MainMenu(); break; case 0: MainFunctions.Exit_Game(); break; default: break; } } }