Пример #1
0
        internal TraditionalCard(CardSuit type, CardValue value, CardPacket holdingCardCollection)
        {
            switch (type)
            {
            case CardSuit.Club:
            case CardSuit.Diamond:
            case CardSuit.Heart:
            case CardSuit.Spade:
                break;

            default:
            {
                throw new ArgumentException(
                          "type must be single value", "type");
            }
            }

            switch (value)
            {
            case CardValue.Ace:
            case CardValue.Two:
            case CardValue.Three:
            case CardValue.Four:
            case CardValue.Five:
            case CardValue.Six:
            case CardValue.Seven:
            case CardValue.Eight:
            case CardValue.Nine:
            case CardValue.Ten:
            case CardValue.Jack:
            case CardValue.Queen:
            case CardValue.King:
            case CardValue.FirstJoker:
            case CardValue.SecondJoker:
                break;

            default:
            {
                throw new ArgumentException(
                          "value must be single value", "value");
            }
            }

            Type  = type;
            Value = value;
            HoldingCardCollection = holdingCardCollection;
        }
Пример #2
0
 public void MoveToHand(Hand hand)
 {
     HoldingCardCollection.Remove(this);
     HoldingCardCollection = hand;
     hand.Add(this);
 }