GR.Gambling.Blackjack.GameLogger.Action C# (CSharp) Method

Action() public method

public Action ( Card dealer_upcard, CardSet player_hands, int active_hand_index, List actions ) : void
dealer_upcard Card
player_hands CardSet
active_hand_index int
actions List
return void
        public void Action(Card dealer_upcard, CardSet[] player_hands, int active_hand_index, List<ActionEv> actions)
        {
            ActionInfo info = new ActionInfo() {
                hand_index = active_hand_index,
                player_cards = player_hands[active_hand_index],
                action_evs = actions.ToArray()
            };

            action_history.Add(info);
        }

Usage Example

Esempio n. 1
0
        public List <ActionEv> GetActions(CardSet seen_cards, Card dealer_upcard, CardSet[] player_hands, int active_hand, List <ActionType> available_actions)
        {
            ValidateActions(player_hands[active_hand], available_actions);

            Shoe tmp_shoe = shoe.Copy();

            tmp_shoe.Remove(seen_cards);

            Eval.CacheDealerProbs(dealer_upcard.PointValue, tmp_shoe.ToArray());

            List <ActionEv> actions = new List <ActionEv>();

            foreach (ActionType a in available_actions)
            {
                double ev = GetActionEV(tmp_shoe, player_hands[active_hand], a, dealer_upcard);

                actions.Add(new ActionEv()
                {
                    Action = a, Ev = ev
                });
            }

            actions.Sort(delegate(ActionEv ae1, ActionEv ae2) { return(ae2.Ev.CompareTo(ae1.Ev)); });

            game_logger.Action(dealer_upcard, player_hands, active_hand, actions);

            return(actions);
        }