Beispiel #1
0
        /// <summary>
        /// Starts driver
        /// </summary>
        /// <param name="game">Game name to join/create</param>
        /// <param name="pass">Game pass to join/create</param>
        /// <param name="difficulty">Game difficulty</param>
        public void Start(string game, string pass, DifficultyType difficulty)
        {
            if (!IsInitalized)
            {
                throw new Exception("Driver not initalized!");
            }

            // convert game password to Titlecase
            TextInfo myTI = new CultureInfo("en-US", false).TextInfo;

            settings.GameName        = game;
            settings.GamePass        = myTI.ToTitleCase(pass);
            settings.GameDifficulty  = difficulty;
            settings.GameDescription = difficulty.ToString();

            PushBot();
        }
        private void DoDifficulty(bool b)
        {
            if (b)
            {
                _currentDifficultyType =
                    (int)_currentDifficultyType < Enum.GetValues(typeof(DifficultyType)).Length - 1
                        ? _currentDifficultyType + 1
                        : _currentDifficultyType;
            }
            else
            {
                _currentDifficultyType =
                    _currentDifficultyType > 0 ? _currentDifficultyType - 1
                        : _currentDifficultyType;
            }

            _travelControl.Print(13, 2, _currentDifficultyType.ToString().PadRight(20), GetDifficultyColor(_currentDifficultyType));
            UpdateCost();
        }
Beispiel #3
0
 /// <summary>
 /// "难度"显示
 /// </summary>
 /// <param name="data"></param>
 private void DifficultyShow(DifficultyType diff)
 {
     GetWidget("Difficulty").GetComponent <Text>().text = diff.ToString();
 }
Beispiel #4
0
        /// <summary>
        /// Starts driver
        /// </summary>
        /// <param name="game">Game name to join/create</param>
        /// <param name="pass">Game pass to join/create</param>
        /// <param name="difficulty">Game difficulty</param>
        public void Start(string game, string pass, DifficultyType difficulty)
        {
            if (!IsInitalized)
            {
                throw new Exception("Driver not initalized!");
            }

            // convert game password to Titlecase
            TextInfo myTI = new CultureInfo("en-US", false).TextInfo;

            settings.GameName = game;
            settings.GamePass = myTI.ToTitleCase(pass);
            settings.GameDifficulty = difficulty;
            settings.GameDescription = difficulty.ToString();

            PushBot();
        }
Beispiel #5
0
 public Difficulty(string[] d,DifficultyType p)
 {
     descriptions = d; problemType = p.ToString();
 }