Пример #1
0
        public override Uklad Uklad(RozdaneKarty karty)
        {
            Dictionary <Figura, int> seen = new Dictionary <Figura, int>();

            foreach (Karta c in karty.Karty)
            {
                if (seen.ContainsKey(c.Figura))
                {
                    seen[c.Figura]++;
                }
                else
                {
                    seen[c.Figura] = 1;
                }
            }

            if (seen.Count == 2)
            {
                if (seen.ContainsValue(3) && seen.ContainsValue(2))
                {
                    return(Poker.Uklad.Full);
                }
            }

            return(Nastepny.Uklad(karty));
        }
        public override Uklad Uklad(RozdaneKarty karty)
        {
            if (WGrupie(4, karty))
            {
                return(Poker.Uklad.Kareta);
            }

            return(Nastepny.Uklad(karty));
        }
        public override Uklad Uklad(RozdaneKarty karty)
        {
            if (WKolorze(karty) && WStricie(karty) && karty.WysokaKarta.Figura == Figura.As)
            {
                return(Poker.Uklad.PokerKrolewski);
            }

            return(Nastepny.Uklad(karty));
        }
        public override Uklad Uklad(RozdaneKarty karty)
        {
            if (WKolorze(karty) && WStricie(karty))
            {
                return(Poker.Uklad.Poker);
            }

            return(Nastepny.Uklad(karty));
        }
        public override Uklad Uklad(RozdaneKarty karty)
        {
            if (WStricie(karty))
            {
                return(Poker.Uklad.Strit);
            }

            return(Nastepny.Uklad(karty));
        }
        public override Uklad Uklad(RozdaneKarty karty)
        {
            Dictionary <Figura, int> seen = new Dictionary <Figura, int>();

            foreach (Karta c in karty.Karty)
            {
                if (seen.ContainsKey(c.Figura))
                {
                    seen[c.Figura]++;
                }
                else
                {
                    seen[c.Figura] = 1;
                }
            }

            if (seen.Count == 3)
            {
                int twoSeen = 0;
                int oneSeen = 0;
                foreach (int val in seen.Values)
                {
                    switch (val)
                    {
                    case 1:
                        oneSeen++;
                        break;

                    case 2:
                        twoSeen++;
                        break;

                    default:
                        break;
                    }
                }

                if (oneSeen == 1 && twoSeen == 2)
                {
                    return(Poker.Uklad.DwiePary);
                }
            }

            return(Nastepny.Uklad(karty));
        }