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(); } } }
/* * 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); }
public override void action(BJLoopContext context) { if (BJLogicHelper.round_complete(context.GameState)) { context.BJLoop = new BJPlayerTurn(); } else { context.GameState.Player.action(context); } }
public override void action(BJLoopContext context) { BJLogicHelper.debug_state(context.GameState); foreach (Player p in context.GameState.Players) { p.Wallet.Bet = 0; } context.BJLoop = new BJEnd(); }
public override void action(BJLoopContext context) { BJLogicHelper.debug_state(context.GameState); if (BJLogicHelper.cards_value(context.GameState.Player.Split_Hand) >= BJLoop.BLACKJACK) { context.GameState.Current_Player += 1; context.BJLoop = new BJPlayerTurn(); } else { context.GameState.Player.action(context); } }
//private GameState _state; public static void hit(BJLoopContext context) { Console.WriteLine("Action: hit"); if (context.BJState.GetType() == typeof(BJPlayerSplitTurn)) { context.GameState.Deck.draw(context.GameState.Player.Split_Hand); context.BJLoop = new BJPlayerSplitTurn(); } else { context.GameState.Deck.draw(context.GameState.Player.Hand); context.BJLoop = new BJPlayerTurn(); } BJLogicHelper.debug_state(context.GameState); }
public static void hitstand(BJLoopContext context) { int player_hand = BJLogicHelper.cards_value(context.GameState.Player.Hand); if (context.BJLoop.GetType() == typeof(BJPlayerSplitTurn)) { player_hand = BJLogicHelper.cards_value(context.GameState.Player.Split_Hand); } if (player_hand < 17) { BJActions.hit(context); } else { BJActions.stand(context); } }
public override void action(BJLoopContext context) { int dealer_hand = BJLogicHelper.cards_value(context.GameState.Dealer.Hand); while (dealer_hand < 17) { context.GameState.Deck.draw(context.GameState.Dealer.Hand); dealer_hand = BJLogicHelper.cards_value(context.GameState.Dealer.Hand); } if (dealer_hand == BLACKJACK) { context.BJLoop = new BJDealerWins(); } else { context.BJLoop = new BJCalculateResults(); } }
public override void action(BJLoopContext context) { BJLogicHelper.clean_up(context.GameState); context.BJLoop = new BJStart(); }
public override void action(BJLoopContext context) { BJLogicHelper.calc_results(context.GameState); context.BJLoop = new BJEnd(); }