예제 #1
0
 // TODO have the single card views inherit from the same base class
 public void Display(BoostCard boostCard)
 {
     _nameTextUI.text  = boostCard.Name;
     _graphicUI.sprite = boostCard.Graphic;
     _usesTextUI.text  = boostCard.Uses.ToString();
     _descText.text    = boostCard.Description;
 }
    public virtual void SetupBoostDeck(List <BoostCardData> boostDeckConfig)
    {
        if (BoostDeck.Count > 0)
        {
            BoostDeck.Empty();
        }

        foreach (BoostCardData boostData in boostDeckConfig)
        {
            BoostCard newBoostCard = new BoostCard(boostData);
            BoostDeck.Add(newBoostCard);
        }

        BoostDeck.Shuffle();
        RaiseBoost(BoostDeck);
    }
예제 #3
0
    private void ShowSelectedGraphic(Card selectedCard)
    {
        BoostCard boostCard = selectedCard as BoostCard;

        if (boostCard != null)
        {
            _boostObject.GetComponent <BoostCardView>().Display(boostCard);
            _boostObject.SetActive(true);
        }

        AbilityCard abilityCard = selectedCard as AbilityCard;

        if (abilityCard != null)
        {
            _abilityObject.GetComponent <AbilityCardView>().Display(abilityCard);
            _abilityObject.SetActive(true);
        }
    }
    public virtual void PlayBoostCard()
    {
        BoostCard lastCard = BoostDeck.TopItem;

        Actions--;
        lastCard.Play();
        // doesn't maintain boost card if it's out of uses
        if (lastCard.Uses == 0)
        {
            BoostDeck.Remove(BoostDeck.LastIndex);
        }
        else
        {
            BoostDeck.Remove(BoostDeck.LastIndex);
            BoostDeck.Add(lastCard, DeckPosition.Bottom);
        }
        RaiseActions(Actions);
        RaiseBoost(BoostDeck);
    }