예제 #1
0
파일: Poker.cs 프로젝트: Zezis/ProjectZezi
        //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;
        }
예제 #2
0
파일: Poker.cs 프로젝트: Zezis/ProjectZezi
 //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;
 }
예제 #3
0
파일: Poker.cs 프로젝트: Zezis/ProjectZezi
        //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;
        }
예제 #4
0
파일: Poker.cs 프로젝트: Zezis/ProjectZezi
 //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;
 }
예제 #5
0
파일: Poker.cs 프로젝트: Zezis/ProjectZezi
 //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;
 }
예제 #6
0
파일: Poker.cs 프로젝트: Zezis/ProjectZezi
 //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;
 }
예제 #7
0
파일: Poker.cs 프로젝트: Zezis/ProjectZezi
 //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;
 }
예제 #8
0
파일: Poker.cs 프로젝트: Zezis/ProjectZezi
 //adding
 public void SetMyCards(PokerCard card)
 {
     if (myCards.Count < 2)this.myCards.Add(card);
 }
예제 #9
0
파일: Poker.cs 프로젝트: Zezis/ProjectZezi
 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);
 }
예제 #10
0
파일: Poker.cs 프로젝트: Zezis/ProjectZezi
 //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);
     }
 }
예제 #11
0
파일: Poker.cs 프로젝트: Zezis/ProjectZezi
 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);
     }
 }
예제 #12
0
파일: Poker.cs 프로젝트: Zezis/ProjectZezi
 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;
 }
예제 #13
0
파일: Poker.cs 프로젝트: Zezis/ProjectZezi
 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;
 }
예제 #14
0
파일: Poker.cs 프로젝트: Zezis/ProjectZezi
 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);
 }