Exemple #1
0
 // 置换主牌
 public bool exchageMasterCard(ref Card changer)
 {
     if (masterCard == null) { return false; }
     Card exc = masterCard;
     masterCard = changer;
     changer = exc;
     return true;
 }
Exemple #2
0
 // 追加到手牌
 public bool addToHand(Card c)
 {
     if (inhand.Count < Consta.HandCardMax)
     {
         inhand.Add(c);
         return true;
     }
     return false;
 }
Exemple #3
0
 // 取出一张牌
 public Card getCard()
 {
     if (this.count() == 0) { return null; }
     Card myref = masterCard;
     if (heapList.Count == 0)
     {
         masterCard = null;
         return myref;
     }
     myref = heapList[0];
     heapList.RemoveAt(0);
     return myref;
 }
Exemple #4
0
 // 是否两张牌全等
 public static bool isEquivalent(Card a, Card b)
 {
     return a.getNum() == b.getNum();
 }