Ejemplo n.º 1
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.º 2
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.º 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
 //vrací zda karta v listu existuje
 public static bool CartInStackExist(List<PokerCard> cart, PokerCard mycard)
 {
     foreach (var c in cart)
     {
         if (mycard.Color == c.Color && mycard.Value == c.Value) return true;
     }
     return false;
 }
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
 //vrací všechny kombinace pro flop
 public static List<PokerCard[]> AllCombinationFlop(PokerCard[] myCard, PokerCard[] tableCard)
 {
     List<PokerCard> balicek = FillTheStack(ArraysToList(tableCard, myCard));
     List<PokerCard[]> kombinace = 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]};
                 kombinace.Add(mozne);
             }
         }
     }
     return kombinace;
 }
Ejemplo n.º 7
0
 //Všechny kombinace pro TURN
 public static List<PokerCard> AllCombinationTurn(PokerCard[] myCard, PokerCard[] tableCard)
 {
     List<PokerCard> balicek = FillTheStack(ArraysToList(tableCard, myCard));
     List<PokerCard> kombinace = new List<PokerCard>();
     for (int i = 0; i < balicek.Count; i++) kombinace.Add(balicek[i]);
     return kombinace;
 }
Ejemplo n.º 8
0
 //adding
 public void SetMyCards(PokerCard card)
 {
     if (myCards.Count < 2)this.myCards.Add(card);
 }
Ejemplo n.º 9
0
 public void SetTableCard(PokerCard card)
 {
     if (!ValidCards(card)) throw new System.ArgumentException("Card is alredy Exist or have invalid value, color!!!", "Shit :(");
     if (tableCards.Count < 5) tableCards.Add(card);
 }
Ejemplo n.º 10
0
 //deleting
 public void DeleteTableCart(PokerCard card)
 {
     for (int i = 0; i < tableCards.Count; i++)
     {
         if (tableCards[i].Value == card.Value && tableCards[i].Color == card.Color) tableCards.RemoveAt(i);
     }
 }
Ejemplo n.º 11
0
 public void DeleteMyCart(PokerCard card)
 {
     for (int i = 0; i < myCards.Count; i++)
     {
         if (myCards[i].Value == card.Value && myCards[i].Color == card.Color) myCards.RemoveAt(i);
     }
 }
Ejemplo n.º 12
0
 public bool CartExistInTable(PokerCard card)
 {
     for (int i = 0; i < tableCards.Count; i++)
     {
         if (tableCards[i].Color == card.Color && tableCards[i].Value == card.Value) return true;
     }
     return false;
 }
Ejemplo n.º 13
0
 public bool CartExistInMyCards(PokerCard card)
 {
     for (int i = 0; i < myCards.Count; i++)
     {
         if (myCards[i].Color == card.Color && myCards[i].Value == card.Value) return true;
     }
     return false;
 }
Ejemplo n.º 14
0
 public bool CartExist(PokerCard card)
 {
     List<PokerCard> pom = new List<PokerCard>();
     for(int i = 0;i< myCards.Count;i++) pom.Add(myCards[i]);
     for(int i = 0;i< tableCards.Count;i++) pom.Add(tableCards[i]);
     return PokerMath.CartInStackExist(pom,card);
 }