Example #1
0
        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);
        }
Example #2
0
        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);
        }
Example #3
0
 internal GameMode()
 {
     m_GameMode = GameUi.eGameMode.WrongChoise;
 }
Example #4
0
 private void setGameMode(string i_gameModeStr)
 {
     m_GameMode = parse(i_gameModeStr);
 }