private bool checkGameModeInput(string i_gameModeStr) { bool isValidInput = true; GameUi.eGameMode gameModeVal = parse(i_gameModeStr); if (gameModeVal != GameUi.eGameMode.PVp && gameModeVal != GameUi.eGameMode.PVc && gameModeVal != GameUi.eGameMode.CVc) { isValidInput = false; } return(isValidInput); }
private GameUi.eGameMode parse(string i_gameModeStr) { GameUi.eGameMode parsed = GameUi.eGameMode.WrongChoise; bool isValidInput = int.TryParse(i_gameModeStr, out int res); if (isValidInput) { parsed = (GameUi.eGameMode)res; } return(parsed); }
internal GameMode() { m_GameMode = GameUi.eGameMode.WrongChoise; }
private void setGameMode(string i_gameModeStr) { m_GameMode = parse(i_gameModeStr); }