public void AddUsedCards(List <CardData> cards) { cards.ForEach(c => { var bitCard = CardUtility.ToBitCard(c.Suit, c.Number); if ((BitUsedCard & bitCard) != 0) { throw new Exception("Duplication Error"); } BitUsedCard |= bitCard; }); }
public void AddCards(List <CardData> cards) { cards.ForEach(c => { var bitCard = CardUtility.ToBitCard(c.Suit, c.Number); if ((BitFieldCard & bitCard) != 0) { throw new Exception("Duplication Error"); } BitFieldCard |= bitCard; }); viewer.Render(ToCardIDList(BitFieldCard)); }
protected override void Awake() { base.Awake(); viewer = GetComponent <HumanCardViewer>(); viewer.SelectedCardChanged += (s, e) => { var viewer = (HumanCardViewer)s; BitSelectedHand = CardUtility.ToBitCard(viewer.SelectedCard); var isLegal = IsLegalBitCard(gameData.BitFieldCard); playButton.gameObject.SetActive(isLegal); }; }