Beispiel #1
0
        public override void action(BJLoopContext context)
        {
            if (BJLogicHelper.round_complete(context.GameState))
            {
                context.BJLoop = new BJDealerTurn();
            }
            else
            {
                BJLogicHelper.debug_state(context.GameState);

                if (BJLogicHelper.cards_value(context.GameState.Player.Hand) >= BJLoop.BLACKJACK)
                {
                    if (context.GameState.Player.Split)
                    {
                        context.BJLoop = new BJPlayerSplitTurn();
                    }
                    else
                    {
                        context.GameState.Current_Player += 1;
                        context.BJLoop = new BJPlayerTurn();
                    }
                }
                else
                {
                    context.BJLoop = new BJPlayerAction();
                }
            }
        }
Beispiel #2
0
        /*
         * dealer deals 2 card from dekk
         */
        public static void deal(BJLoopContext context)
        {
            while (!BJLogicHelper.round_complete(context.GameState))
            {
                context.GameState.Deck.draw(context.GameState.Player.Hand);
                context.GameState.Current_Player += 1;
            }

            context.GameState.Deck.draw(context.GameState.Dealer.Hand);
        }
Beispiel #3
0
 public override void action(BJLoopContext context)
 {
     if (BJLogicHelper.round_complete(context.GameState))
     {
         context.BJLoop = new BJPlayerTurn();
     }
     else
     {
         context.GameState.Player.action(context);
     }
 }