Exemplo n.º 1
0
        // Deal nCards cards to player.
        public void Deal(IPlayer player, uint nCards)
        {
            for (uint i = 0; i < nCards; i++)
            {
                if (_cards.Count == 0)
                {
                    throw new CardGameException("Deck exhausted");
                }

                var card = _cards.GetCard(0);
                _cards.RemoveCard(0);
                player.AcceptCard(card);
            }
        }
Exemplo n.º 2
0
            void IInteractionRule.Interact(Card card, ICardCollection source)
            {
                _NextRule = InteractionRuleType.Peek2;

                if (_CardCollections.Inspect.Count < 2)
                {
                    source.RemoveCard(card);
                    _CardCollections.Inspect.AddCard(card);
                }
                else
                {
                    source.AddCard(_CardCollections.Inspect.RemoveFirstCard());
                    source.AddCard(_CardCollections.Inspect.RemoveFirstCard());
                    _NextRule = InteractionRuleType.Default;
                }
            }
Exemplo n.º 3
0
        internal async Task PlayCard(ElementAttachmentCard card, CancellationToken token)
        {
            await card.Play(this, token);

            CardCollection.RemoveCard(card);
        }