public void InitCardTypes() { // set types to show in the inspector and reset the count deck_types = CardTypeCount.Initialize(); total_card_count = 0; }
public static CardTypeCount[] Initialize() { CardTypeCount[] deck = new CardTypeCount[(int)CardType.CardType_Count]; for (int i = 0; i < (int)CardType.CardType_Count; ++i) { deck[i].type = (CardType)i; deck[i].count = 0; } return(deck); }
void SetUpReward(CardTypeCount[] reward) { Assert.IsTrue(reward.Length == (int)CardType.CardType_Count); reward_card_objects = new Dictionary <CardType, DeckCard>(); for (int i = 0; i < (int)CardType.CardType_Count; ++i) { CardTypeCount card = reward[i]; if (card.count > 0) { DeckCard dc = Instantiate(card_prefab, reward_panel) as DeckCard; dc.cardImage.type = card.type; dc.count_text_frame.SetActive(true); dc.UpdateText(card.count); dc.eventTrigger.enabled = false; reward_card_objects.Add(card.type, dc); } } }
void SetUpDeck(CardTypeCount[] deck) { Assert.IsTrue(deck.Length == (int)CardType.CardType_Count); deck_card_objects = new List <DeckCard>(); for (int i = 0; i < (int)CardType.CardType_Count; ++i) { CardTypeCount card = deck[i]; for (int j = 0; j < card.count; ++j) { DeckCard dc = Instantiate(card_prefab, current_deck_panel) as DeckCard; dc.cardImage.type = card.type; dc.count_text_frame.SetActive(false); dc.eventTrigger.enabled = false; deck_card_objects.Add(dc); } } card_count_text.text = "Army size: " + deck_card_objects.Count.ToString(); }
public CardTypeCount[] CopyTargetDeck() { CardTypeCount[] copy = new CardTypeCount[target_deck.Length]; target_deck.CopyTo(copy, 0); return(copy); }
public CardTypeCount[] CopyAttackDeck() { CardTypeCount[] copy = new CardTypeCount[attack_deck.Length]; attack_deck.CopyTo(copy, 0); return(copy); }