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(); } } }
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); }