// 置换主牌 public bool exchageMasterCard(ref Card changer) { if (masterCard == null) { return false; } Card exc = masterCard; masterCard = changer; changer = exc; return true; }
// 追加到手牌 public bool addToHand(Card c) { if (inhand.Count < Consta.HandCardMax) { inhand.Add(c); return true; } return false; }
// 取出一张牌 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; }
// 是否两张牌全等 public static bool isEquivalent(Card a, Card b) { return a.getNum() == b.getNum(); }