Exemple #1
0
        private string GetName(PokerKind kind, int point)
        {
            string name;

            switch (kind)
            {
            case PokerKind.Spade:
                name = "♠";
                break;

            case PokerKind.Heart:
                name = "♥";
                break;

            case PokerKind.Club:
                name = "♣";
                break;

            case PokerKind.Diamond:
                name = "♦";
                break;

            case PokerKind.Joker:

                if (Point == 0)
                {
                    return("JOKER");
                }

                else
                {
                    return("joker");
                }

            default:
                throw new InvalidOperationException();
            }



            if (point == 11)
            {
                name += "J";
            }

            else if (point == 12)
            {
                name += "Q";
            }

            else if (point == 13)
            {
                name += "K";
            }

            else if (point == 1)
            {
                name += "A";
            }

            else if (point <= 10 && point > 1)
            {
                name += point;
            }

            else
            {
                throw new InvalidOperationException();
            }



            return(name);
        }
Exemple #2
0
 private PokerCard(PokerKind kind, int point)
 {
     Name = GetName(Kind = kind, Point = point);
 }