Ejemplo n.º 1
0
        public static bool CombinationExist(List<PokerCard> cards, CartCombination combi)
        {
            if (combi == CartCombination.FourOfaKind) return (maxSimilar(cards).Count == 4);
            if (combi == CartCombination.ThreeOfaKind) return threeOfaKind(cards);
            if (combi == CartCombination.TwoPair) return twoPair(cards);
            if (combi == CartCombination.OnePair) return onePair(cards);
            if (combi == CartCombination.FullHouse) return fullHouse(cards);
            if (combi == CartCombination.Straight) return straight(cards);
            if (combi == CartCombination.StraightFlush) return straightFlush(cards);
            if (combi == CartCombination.Flush) return flush(cards);

            return false;
        }
Ejemplo n.º 2
0
        //vrací procenta na dokonční dané kombinace na flopu
        public static double PercToCompFlop(PokerCard[] myCard, PokerCard[] tableCard,CartCombination combination)
        {
            int spravne = CartToCombinationFlop(myCard, tableCard, combination).Count;
            int vsechny = AllCombinationFlop(myCard, tableCard).Count;

            return (double)spravne/(double)vsechny;
        }
Ejemplo n.º 3
0
        //vrací procenta na dokonční dané kombinace na turnu
        public static double PercentToCompTurn(PokerCard[] myCard, PokerCard[] tableCard, CartCombination combination)
        {
            int cards = CartToCombinationTurn(myCard, tableCard, combination).Count;
            int all = AllCombinationTurn(myCard,tableCard).Count;

            return cards/(double) all;
        }
Ejemplo n.º 4
0
 //správné kombinace pro Turn
 public static List<PokerCard> CartToCombinationTurn(PokerCard[] myCard, PokerCard[] tableCard, CartCombination combination)
 {
     List<PokerCard> balicek = FillTheStack(ArraysToList(myCard, tableCard));
     List<PokerCard> Moznekarty = new List<PokerCard>();
     for (int i = 0; i < balicek.Count; i++)
     {
         PokerCard[] mozne = {balicek[i]};
         if (PokerCartCombination.CombinationExist(ArraysToList(myCard, tableCard, mozne), combination)) { Moznekarty.Add(balicek[i]); }
     }
     return Moznekarty;
 }
Ejemplo n.º 5
0
 //vrací konkretní karty které jsou možné na dokonční dané kombinace na flopu
 public static List<PokerCard[]> CartToCombinationFlop(PokerCard[] myCard, PokerCard[] tableCard, CartCombination combination)
 {
     List<PokerCard> balicek = FillTheStack(ArraysToList(myCard,tableCard));
     List<PokerCard[]> Moznekarty = new List<PokerCard[]>();
     for (int c1 = 0; c1 < balicek.Count; c1++)
     {
         for (int c2 = c1 + 1; c2 < balicek.Count; c2++)
         {
             if (!c1.Equals(c2))
             {
                 PokerCard[] mozne = { balicek[c1], balicek[c2] };
                 if (PokerCartCombination.CombinationExist(ArraysToList(myCard, tableCard, mozne), combination)) { Moznekarty.Add(mozne); }
             }
         }
     }
     return Moznekarty;
 }
Ejemplo n.º 6
0
 public double PercentToComplete(CartCombination combination)
 {
     if (GameStatus == PokerGameStatus.Flop) return PokerMath.PercToCompFlop(myCards.ToArray(), tableCards.ToArray(), combination);
     if (GameStatus == PokerGameStatus.Turn) return PokerMath.PercentToCompTurn(myCards.ToArray(), tableCards.ToArray(), combination);
     return 0;
 }
Ejemplo n.º 7
0
 public bool CombinationExist(CartCombination combination)
 {
     List<PokerCard> cards = new List<PokerCard>();
     for(int i = 0;i< tableCards.Count;i++)
     {
         cards.Add(tableCards[i]);
     }
     for (int i = 0; i < myCards.Count; i++)
     {
         cards.Add(myCards[i]);
     }
     return PokerCartCombination.CombinationExist(cards, combination);
 }