public GameState Deal(double bet) { //Clear last game. Make new game with old balance. NewGame(_defaultPlayer.Balance); //Try to set new bet balance TryPlaceBet(bet); //Check if insufficient funds if (_gameState.CurrentState == State.LowBalance) { return(null); } //Shuffle a new deck _deckService.NewDeck(); //At the beginning of each hand the dealer deals two cards, //first to the player and then to himself. DealFirstHands(); //Check for BlackJack if (HandLogic.HasBlackJack(_defaultPlayer)) { EndGame(); } //Setup a new GameState _gameState = new GameState(_defaultPlayer, _dealer, State.Open); return(_gameState); }