public override void Execute(IBlackjackDealer dealer)
 {
     var p = (BettingPlayer)Player;
     p.Bank.DoubleDown();
     dealer.Hit(p);
     p.State.Execute(dealer);
 }
Exemple #2
0
 public override void Execute(IBlackjackDealer dealer)
 {
     BettingPlayer player = (BettingPlayer)Player;
     player.Bet();
     player.State = player.GetWaitingState();
     dealer.DoneBetting(player);
 }
 public void NewGame(IGUIPlayer player, IBlackjackDealer dealer)
 {
     _player = player;
     _dealer = dealer;
     RegisterListeners(player, dealer);
     dealer.AddPlayer(player);
     _connection.Send(_connectionId, new GameViewModel { Dealer = new PlayerViewModel(dealer), Player = new PlayerViewModel(player) }.ToJson());
     dealer.NewGame();
 }
            public override void Execute(IBlackjackDealer dealer)
            {
                var d = ((BlackjackDealer)Player);
                ICardPlayer nextBettingPlayer = d.GetNextBettingPlayer();
                nextBettingPlayer.Play(d);

                if (!(nextBettingPlayer is EmptyCardPlayer)) return;
                d.State = d.GetDealingState();
                d.State.Execute(dealer);
            }
Exemple #5
0
            public override void Execute(IBlackjackDealer dealer)
            {
                if (Player.DoHit())
                    dealer.Hit(Player);
                else
                {
                    Player.State = Player.GetStandingState();
                    Player.RaisePlayerStandingEvent();
                }

                Player.State.Execute(dealer);
            }
            public override void Execute(IBlackjackDealer dealer)
            {
                var d = ((BlackjackDealer) Player); // The dealer is, well me...the Player I store is the same reference. // TODO: Do I even need to pass myself around??
                ICardPlayer nextWaitingPlayer = d.GetNextWaitingPlayer();
                nextWaitingPlayer.Play(d);

                // This is a bit crap but I feel its better than the
                // solution in the book. See page 424
                if (!(nextWaitingPlayer is EmptyCardPlayer)) return;
                d.State = d.GetPlayingState();
                d.ExposeCards();
                d.State.Execute(dealer);
            }
            public override void Execute(IBlackjackDealer dealer)
            {
                BettingPlayer player = (BettingPlayer)Player;
                if (player.Hand.CanDoubleDown() && player.DoubleDown())
                {
                    player.State = player.GetDoublingDownState();
                    player.State.Execute(dealer);
                    return;
                }

                if (player.DoHit())
                    dealer.Hit(player);
                else
                {
                    player.State = player.GetStandingState();
                    player.RaisePlayerStandingEvent();
                }

                player.State.Execute(dealer);
            }
 public override void Execute(IBlackjackDealer dealer)
 {
     InformLosers();
     InformWinners();
     InformStandoffs();
 }
 public override void Execute(IBlackjackDealer dealer)
 {
     // Do nothing
 }
 public override void Execute(IBlackjackDealer dealer)
 {
     var d = ((BlackjackDealer)Player);
     d.Deal();
     d.State.Execute(dealer);
 }
 public override void Execute(IBlackjackDealer dealer)
 {
     // do nothing here, actions will come from the GUI which is
     // external to the state, but when events do come in be sure to
     // force state transition right away
 }
Exemple #12
0
 public override void Execute(IBlackjackDealer dealer)
 {
     dealer.Standing(Player);
 }
 public override void Execute(IBlackjackDealer dealer)
 {
     // do nothing here, actions will come from the GUI which is
     // external to the state, since no events come in as part of
     // betting the state will need to be changed externally to this state
 }
Exemple #14
0
 public override void Execute(IBlackjackDealer dealer)
 {
     // Do nothing while waiting.
 }
 public virtual void Play(IBlackjackDealer dealer)
 {
     State.Execute(dealer);
 }
 public override void Execute(IBlackjackDealer dealer)
 {
     dealer.ExposeCards();
     InformStandoffs();
     InformLosers();
 }
 public abstract void Execute(IBlackjackDealer dealer);
Exemple #18
0
 public override void Play(IBlackjackDealer dealer)
 {
     _dealer = dealer;
     base.Play(dealer);
 }
Exemple #19
0
 public override void Execute(IBlackjackDealer dealer)
 {
     dealer.Busted(Player);
     Player.RaisePlayerBustedEvent();
 }