Beispiel #1
0
        public static void Initialize(Game game)
        {
            HandSet playerHands = game.PlayerHandSet;

            List <Hand> active = new List <Hand>();

            active.Add(playerHands.ActiveHand);

            bool allBusted = true;
            int  numBusted = 0;

            foreach (Hand hand in game.PlayerHandSet)
            {
                if (!hand.Finished)
                {
                    if (hand != playerHands.ActiveHand)
                    {
                        active.Add(hand);
                    }
                }
                else
                {
                    if (hand.IsBust())
                    {
                        numBusted++;
                    }
                    else
                    {
                        if (!hand.IsSplit())
                        {
                            allBusted = false;
                        }
                    }
                }
            }

            SHand[] shands = new SHand[active.Count];
            for (int i = 0; i < shands.Length; i++)
            {
                shands[i] = new SHand(active[i]);
            }

            int[] shoe = game.Shoe.Counts;
            shoe[game.DealerHand[1].PointValue - 1]++;

            int upcard = game.DealerHand[0].PointValue;

            InitializeEvaluation(shands, shands.Length, allBusted, numBusted, upcard, shoe, game.Bet);
        }
        public static void Initialize(Game game)
        {
            HandSet playerHands = game.PlayerHandSet;

            List<Hand> active = new List<Hand>();

            active.Add(playerHands.ActiveHand);

            bool allBusted = true;
            int numBusted = 0;

            foreach (Hand hand in game.PlayerHandSet)
            {
                if (!hand.Finished)
                {
                    if (hand != playerHands.ActiveHand) active.Add(hand);
                }
                else
                {
                    if (hand.IsBust())
                    {
                        numBusted++;
                    }
                    else
                    {
                        if (!hand.IsSplit()) allBusted = false;
                    }
                }
            }

            SHand[] shands = new SHand[active.Count];
            for (int i = 0; i < shands.Length; i++)
            {
                shands[i] = new SHand(active[i]);
            }

            int[] shoe = game.Shoe.Counts;
            shoe[game.DealerHand[1].PointValue - 1]++;

            int upcard = game.DealerHand[0].PointValue;

            InitializeEvaluation(shands, shands.Length, allBusted, numBusted, upcard, shoe, game.Bet);
        }
Beispiel #3
0
 public static extern double DoubleEv(SHand player, int upcard, int bet_size, [MarshalAs(UnmanagedType.LPArray, SizeConst = 10)] int[] shoe);
Beispiel #4
0
 public static extern double StandEv(SHand hand, int upcard, [MarshalAs(UnmanagedType.LPArray, SizeConst = 10)] int[] shoe);
Beispiel #5
0
 public static extern double StandEv(SHand hand, int upcard, [MarshalAs(UnmanagedType.LPArray, SizeConst= 10)] int[] shoe);
Beispiel #6
0
 public static extern double HitEv(SHand player, int upcard, [MarshalAs(UnmanagedType.LPArray, SizeConst = 10)] int[] shoe);