public void LoadArenaReward(ArenaReward reward)
 {
     TextBoxGold.Text           = reward.Gold.ToString();
     TextBoxDust.Text           = reward.Dust.ToString();
     ComboBoxPack1.SelectedItem = reward.Packs[0];
     ComboBoxPack2.SelectedItem = reward.Packs[1];
     if (!string.IsNullOrEmpty(reward.Cards[0]?.CardId))
     {
         TextBoxCard1.Text = Database.GetCardFromId(reward.Cards[0].CardId).LocalizedName;
     }
     if (!string.IsNullOrEmpty(reward.Cards[1]?.CardId))
     {
         TextBoxCard2.Text = Database.GetCardFromId(reward.Cards[1].CardId).LocalizedName;
     }
     if (!string.IsNullOrEmpty(reward.Cards[2]?.CardId))
     {
         TextBoxCard3.Text = Database.GetCardFromId(reward.Cards[2].CardId).LocalizedName;
     }
     if (reward.Cards[0] != null)
     {
         CheckBoxGolden1.IsChecked = reward.Cards[0].Golden;
     }
     if (reward.Cards[1] != null)
     {
         CheckBoxGolden2.IsChecked = reward.Cards[1].Golden;
     }
     if (reward.Cards[2] != null)
     {
         CheckBoxGolden3.IsChecked = reward.Cards[2].Golden;
     }
     if (reward.PaymentMethod == ArenaPaymentMethod.Gold)
     {
         RadioButtonPaymentGold.IsChecked = true;
     }
     else if (reward.PaymentMethod == ArenaPaymentMethod.Money)
     {
         RadioButtonPaymentMoney.IsChecked = true;
     }
 }
示例#2
0
		public Deck(string name, string className, IEnumerable<Card> cards, IEnumerable<string> tags, string note, string url,
		            DateTime lastEdited, bool archived, List<Card> missingCards, SerializableVersion version, IEnumerable<Deck> versions,
		            bool? syncWithHearthStats, string hearthStatsId, Guid deckId, string hearthStatsDeckVersionId,
		            string hearthStatsIdClone = null, SerializableVersion selectedVersion = null, bool? isArenaDeck = null, ArenaReward reward = null)

		{
			Name = name;
			Class = className;
			Cards = new ObservableCollection<Card>();
			MissingCards = missingCards;
			foreach(var card in cards.ToSortedCardList())
				Cards.Add((Card)card.Clone());
			Tags = new List<string>(tags);
			Note = note;
			Url = url;
			LastEdited = lastEdited;
			Archived = archived;
			Version = version;
			SyncWithHearthStats = syncWithHearthStats;
			HearthStatsId = hearthStatsId;
			SelectedVersion = selectedVersion ?? version;
			Versions = new List<Deck>();
			DeckId = deckId;
			if(hearthStatsIdClone != null)
				HearthStatsIdForUploading = hearthStatsIdClone;
			if(isArenaDeck.HasValue)
				IsArenaDeck = isArenaDeck.Value;
			HearthStatsDeckVersionId = hearthStatsDeckVersionId;
			if(versions != null)
			{
				foreach(var d in versions)
					Versions.Add(d.CloneWithNewId(true) as Deck);
			}
			if(reward != null)
				_arenaReward = reward;
		}
		public void LoadArenaReward(ArenaReward reward)
		{
			TextBoxGold.Text = reward.Gold.ToString();
			TextBoxDust.Text = reward.Dust.ToString();
			ComboBoxPack1.SelectedItem = reward.Packs[0];
			ComboBoxPack2.SelectedItem = reward.Packs[1];
			if(reward.Cards[0] != null && !string.IsNullOrEmpty(reward.Cards[0].CardId))
				TextBoxCard1.Text = Database.GetCardFromId(reward.Cards[0].CardId).LocalizedName;
			if(reward.Cards[1] != null && !string.IsNullOrEmpty(reward.Cards[1].CardId))
				TextBoxCard2.Text = Database.GetCardFromId(reward.Cards[1].CardId).LocalizedName;
			if(reward.Cards[2] != null && !string.IsNullOrEmpty(reward.Cards[2].CardId))
				TextBoxCard3.Text = Database.GetCardFromId(reward.Cards[2].CardId).LocalizedName;
			if(reward.Cards[0] != null)
				CheckBoxGolden1.IsChecked = reward.Cards[0].Golden;
			if(reward.Cards[1] != null)
				CheckBoxGolden2.IsChecked = reward.Cards[1].Golden;
			if(reward.Cards[2] != null)
				CheckBoxGolden3.IsChecked = reward.Cards[2].Golden;
			if(reward.PaymentMethod == ArenaPaymentMethod.Gold)
				RadioButtonPaymentGold.IsChecked = true;
			else if(reward.PaymentMethod == ArenaPaymentMethod.Money)
				RadioButtonPaymentMoney.IsChecked = true;
		}