Ejemplo n.º 1
0
        private void ResolveCheckBoxes(object checkBoxNumber)
        {
            NumberOfPlayersEnum  myEnum   = (NumberOfPlayersEnum)checkBoxNumber;
            NumberOfPlayersClass theClass = NumberOfPlayersCollection.First <NumberOfPlayersClass>(t => t.Player == myEnum);

            // ok, they want to check this one, let them and uncheck all else
            foreach (NumberOfPlayersClass iter in NumberOfPlayersCollection)
            {
                iter.IsChecked = false;
            }
            theClass.IsChecked = true;
        }
Ejemplo n.º 2
0
        private void StartGame()
        {
            NumberOfPlayersClass arg = NumberOfPlayersCollection.First <NumberOfPlayersClass>(t => t.IsChecked == true);

            if (arg == null)
            {
                // BIG problem.  Log and find out why
                throw new Exception("Could not resolve number of players in StartGame");
            }
            _game = new BlackJackGameModel(Convert.ToUInt16(arg.Player));
            _game.StartGame();
            OnPropertyChanged("DealerInfo");
            OnPropertyChanged("PlayersInfo");
            OnPropertyChanged("CanShowDealerScore");
        }