Esempio n. 1
0
    private LinkedCardDeck attackerDeck;     //the deck as a whole


    /////////////////////////////////////////////
    /// Functions
    /////////////////////////////////////////////


    //constructor
    public LinkedAttackerDeck()
    {
        LinkedCard[] values = new LinkedCard[] { new LinkedCard(1),
                                                 new LinkedCard(1),
                                                 new LinkedCard(2),
                                                 new LinkedCard(2),
                                                 new LinkedCard(3),
                                                 new LinkedCard(3),
                                                 new LinkedCard(4),
                                                 new LinkedCard(4) };
        attackerDeck = new LinkedCardDeck(values);
    }
Esempio n. 2
0
    public LinkedCard GetAttackerCard()
    {
        bool reshuffled = false;

        LinkedCard temp = attackerDeck.Draw(out reshuffled);

        if (reshuffled)
        {
            Services.UI.RecreateCombatDeck();
        }
        Services.UI.DrawCombatCard(temp.Value);
        Services.UI.RewriteDecklist();

        return(temp);
    }
        public void LinkToCatalog(CardLinkedEvent cardLinkedEvent)
        {
            var card = _cardContext.Card.Where(d => d.Id == cardLinkedEvent.CardId && d.Version == cardLinkedEvent.Version).FirstOrDefault();

            if (card == null)
            {
                _logger.LogError("No card exists with {id} and {version}", cardLinkedEvent.CardId, cardLinkedEvent.Version);
                return;
            }

            var cardtoBeLinked = new LinkedCard(cardLinkedEvent.CardId, cardLinkedEvent.Version, cardLinkedEvent.CatalogId);

            _cardContext.LinkedCard.Add(cardtoBeLinked);

            if (!card.IsLinked)
            {
                card.IsLinked = true;
                _cardEventHandler.Raise(new UrlLinkedEvent(card.ShortUrl, true));
            }
            _cardContext.SaveChanges();
        }
Esempio n. 4
0
 public bool DoesProduceManaOfColor(string color)
 {
     return(ThisFaceProducesManaOfColor(color) || linkedFaceType == enumLinkedFace.MDFC_Front && (LinkedCard?.ThisFaceProducesManaOfColor(color) == true));
 }