示例#1
0
 public override void Execute(IBlackjackDealer dealer)
 {
     var p = (BettingPlayer)Player;
     p.Bank.DoubleDown();
     dealer.Hit(p);
     p.State.Execute(dealer);
 }
示例#2
0
 public override void Execute(IBlackjackDealer dealer)
 {
     BettingPlayer player = (BettingPlayer)Player;
     player.Bet();
     player.State = player.GetWaitingState();
     dealer.DoneBetting(player);
 }
示例#3
0
 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);
            }
示例#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);
            }
示例#6
0
            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);
            }
示例#7
0
            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();
 }
示例#9
0
 public override void Execute(IBlackjackDealer dealer)
 {
     // Do nothing
 }
示例#10
0
 public override void Execute(IBlackjackDealer dealer)
 {
     var d = ((BlackjackDealer)Player);
     d.Deal();
     d.State.Execute(dealer);
 }
示例#11
0
 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
 }
示例#12
0
 public override void Execute(IBlackjackDealer dealer)
 {
     dealer.Standing(Player);
 }
示例#13
0
 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
 }
示例#14
0
 public override void Execute(IBlackjackDealer dealer)
 {
     // Do nothing while waiting.
 }
示例#15
0
 public virtual void Play(IBlackjackDealer dealer)
 {
     State.Execute(dealer);
 }
示例#16
0
 public override void Execute(IBlackjackDealer dealer)
 {
     dealer.ExposeCards();
     InformStandoffs();
     InformLosers();
 }
示例#17
0
 public abstract void Execute(IBlackjackDealer dealer);
示例#18
0
 public override void Play(IBlackjackDealer dealer)
 {
     _dealer = dealer;
     base.Play(dealer);
 }
示例#19
0
 public override void Execute(IBlackjackDealer dealer)
 {
     dealer.Busted(Player);
     Player.RaisePlayerBustedEvent();
 }