예제 #1
0
        public void SetOptions()
        {
            //set backgroundcolor
            pnlField.BackColor = _options.GetColor("btnColorField");

            //set numbers of boxes in both directions
            _numberBoxesHorizontal = _options.GetHorizontal();
            _numberBoxesVertical   = _options.GetVertical();

            //set boxwidth and boxheight
            _boxWidth  = (pnlField.Width - _marginBoxInPanel[1] * 2f) / _numberBoxesHorizontal;
            _boxHeight = (pnlField.Height - _marginBoxInPanel[0] * 2f) / _numberBoxesVertical;

            //set boxcolor
            _boxColor = _options.GetColor("btnColorBox");

            //clear then fill dictionary
            _dctColorAndValue.Clear();
            for (int i = 1; i <= 3; i++)
            {
                _dctColorAndValue.Add(_options.GetColor("btnColorBoxType" + i), _options.GetValue("nudBoxType" + i));
            }

            if (_options.cbxFreedom.Checked)
            {
                tmrGame.Interval = _options.GetAdvancedOptions()["interval"];
                _playTime        = _options.GetAdvancedOptions()["playTime"];
                _gameOverAt      = _options.GetAdvancedOptions()["gameOverAt"];
            }
            else
            {
                _playTime        = 40;  //no idea why you would put 39999 here (doesn't make sense in any time unit)
                tmrGame.Interval = 100; //doesn't make sense (way too fast)
                _gameOverAt      = 0;
            }

            lblTime.Text = _playTime + " Sek.";
        }
예제 #2
0
        /// <summary>
        /// Übernimmt die Optionen aus dem <see cref="frmOptions"/> Form und baut das Spielfeld auf
        /// </summary>
        public void SetupPlayField()
        {
            pnlPlayField.BackColor = _optionsForm.GetColor("btnColorField");
            _boxColor    = _optionsForm.GetColor("btnColorBoxes");
            _maxPlayTime = _optionsForm.GetMaxPlaytime();

            _boxCountHorizontal = _optionsForm.GetHorizontal();
            _boxCountVertical   = _optionsForm.GetVertical();

            _boxWidth  = (pnlPlayField.Width - (_gamePanelMargin[0] * 2)) / _boxCountHorizontal;
            _boxHeight = (pnlPlayField.Height - (_gamePanelMargin[1] * 2)) / _boxCountVertical;

            _boxRatings.Clear();

            for (int i = 0; i < 3; i++)
            {
                Color color  = _optionsForm.GetColor("btnColorBoxtype" + i);
                int   rating = _optionsForm.GetValue("nudRatingBoxtype" + i);
                _boxRatings.Add(color, rating);
            }

            BuildButtonField();
        }
예제 #3
0
        public void SetOptions()
        {
            //set backgroundcolor
            pnlField.BackColor = _options.GetColor("btnColorField");

            //set numbers of boxes in both directions
            _numberBoxesHorizontal = _options.GetHorizontal();
            _numberBoxesVertical   = _options.GetVertical();

            //set boxwidth and boxheight
            _boxWidth  = (pnlField.Width - _marginBoxInPanel[1] * 2) / _numberBoxesHorizontal;
            _boxHeight = (pnlField.Height - _marginBoxInPanel[0] * 2) / _numberBoxesVertical;

            //set boxcolor
            _boxColor = _options.GetColor("btnColorBox");

            //Clear then fill dictionary
            _dctColorAndValue.Clear();
            for (int i = 1; i <= 3; i++)
            {
                _dctColorAndValue.Add(_options.GetColor("btnColorBoxType" + i), _options.GetValue("nudBoxType" + i));
            }
        }