当前位置: 首页>>代码示例>>C#>>正文


C# Deck.GetSelectedDeckVersion方法代码示例

本文整理汇总了C#中Hearthstone_Deck_Tracker.Hearthstone.Deck.GetSelectedDeckVersion方法的典型用法代码示例。如果您正苦于以下问题:C# Deck.GetSelectedDeckVersion方法的具体用法?C# Deck.GetSelectedDeckVersion怎么用?C# Deck.GetSelectedDeckVersion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Hearthstone_Deck_Tracker.Hearthstone.Deck的用法示例。


在下文中一共展示了Deck.GetSelectedDeckVersion方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ExportDeck

		private async void ExportDeck(Deck deck)
		{
			var export = true;
			if(Config.Instance.ShowExportingDialog)
			{
				var message =
					string.Format(
					              "1) create a new, empty {0}-Deck {1}.\n\n2) leave the deck creation screen open.\n\n3)do not move your mouse or type after clicking \"export\"",
					              deck.Class, (Config.Instance.AutoClearDeck ? "(or open an existing one to be cleared automatically)" : ""));

				if(deck.GetSelectedDeckVersion().Cards.Any(c => c.Name == "Stalagg" || c.Name == "Feugen"))
				{
					message +=
						"\n\nIMPORTANT: If you own golden versions of Feugen or Stalagg please make sure to configure\nOptions > Other > Exporting";
				}

				var settings = new MetroDialogSettings {AffirmativeButtonText = "export"};
				var result =
					await
					this.ShowMessageAsync("Export " + deck.Name + " to Hearthstone", message, MessageDialogStyle.AffirmativeAndNegative, settings);
				export = result == MessageDialogResult.Affirmative;
			}
			if(export)
			{
				var controller = await this.ShowProgressAsync("Creating Deck", "Please do not move your mouse or type.");
				Topmost = false;
				await Task.Delay(500);
				await DeckExporter.Export(deck);
				await controller.CloseAsync();

				if(deck.MissingCards.Any())
					this.ShowMissingCardsMessage(deck);
			}
		}
开发者ID:GatherHere,项目名称:Hearthstone-Deck-Tracker,代码行数:34,代码来源:MainWindow_Export.cs

示例2: UpdateDeckList

		public void UpdateDeckList(Deck selected)
		{
			ListViewDeck.ItemsSource = null;
			if(selected == null)
				return;
			ListViewDeck.ItemsSource = selected.GetSelectedDeckVersion().Cards;
			Helper.SortCardCollection(ListViewDeck.Items, Config.Instance.CardSortingClassFirst);
		}
开发者ID:Rob2K2,项目名称:Hearthstone-Deck-Tracker,代码行数:8,代码来源:MainWindow.xaml.cs

示例3: SetDeck

		public void SetDeck(Deck deck)
		{
			if(deck == null)
			{
				ClearDeck();
				return;
			}
			_deck = deck;
			deck.GetSelectedDeckVersion().Cards.CollectionChanged += (sender, args) => UpdateValues();
			UpdateValues();
		}
开发者ID:christopher7694,项目名称:Hearthstone-Deck-Tracker,代码行数:11,代码来源:ManaCurve.xaml.cs

示例4: SetDeck

		public void SetDeck(Deck deck)
		{
			if(deck == null)
			{
				ClearDeck();
				return;
			}
			_deck = deck;
			deck.GetSelectedDeckVersion().Cards.CollectionChanged += (sender, args) => UpdateValues();
			UpdateValues();
			ItemsControlMechanics.ItemsSource = deck.Mechanics;
		}
开发者ID:BROK3N-DRE4M,项目名称:Hearthstone-Deck-Tracker,代码行数:12,代码来源:ManaCurve.xaml.cs

示例5: SetDeck

		public void SetDeck(Deck deck)
		{
			if(deck == null)
			{
				ClearDeck();
				TextBlockNoMechanics.Visibility = Visible;
				return;
			}
			_deck = deck;
			deck.GetSelectedDeckVersion().Cards.CollectionChanged += (sender, args) => UpdateValues();
			UpdateValues();
			ItemsControlMechanics.ItemsSource = deck.Mechanics;
			TextBlockNoMechanics.Visibility = deck.Mechanics.Any() ? Collapsed : Visible;
		}
开发者ID:irufus,项目名称:Hearthstone-Deck-Tracker,代码行数:14,代码来源:ManaCurve.xaml.cs

示例6: ShowAddGameDialog

		public static async Task<bool> ShowAddGameDialog(this MetroWindow window, Deck deck)
		{
			if(deck == null)
				return false;
			var dialog = new AddGameDialog(deck);
			await window.ShowMetroDialogAsync(dialog, new MetroDialogSettings {AffirmativeButtonText = "save", NegativeButtonText = "cancel"});
			var game = await dialog.WaitForButtonPressAsync();
			await window.HideMetroDialogAsync(dialog);
			if(game == null)
				return false;
			deck.DeckStats.AddGameResult(game);
			if(Config.Instance.HearthStatsAutoUploadNewGames)
			{
				if(game.GameMode == GameMode.Arena)
					HearthStatsManager.UploadArenaMatchAsync(game, deck, true, true);
				else
					HearthStatsManager.UploadMatchAsync(game, deck.GetSelectedDeckVersion(), true, true);
			}
			DeckStatsList.Save();
			Core.MainWindow.DeckPickerList.UpdateDecks(forceUpdate: new[] {deck});
			return true;
		}
开发者ID:modulexcite,项目名称:Hearthstone-Deck-Tracker,代码行数:22,代码来源:MessageDialogs.cs

示例7: SetPremadeDeck

		public static void SetPremadeDeck(Deck deck)
		{
			PlayerDeck.Clear();
			foreach(var card in deck.GetSelectedDeckVersion().Cards)
				PlayerDeck.Add((Card)card.Clone());
			IsUsingPremade = true;
		}
开发者ID:radoraykov,项目名称:Hearthstone-Deck-Tracker,代码行数:7,代码来源:Game.cs

示例8: SetNewDeck

		public void SetNewDeck(Deck deck, bool editing = false)
		{
			if(deck != null)
			{
				ClearNewDeckSection();
				SelectDeck(null, false);
				EditingDeck = editing;
				if(editing)
				{
					editedDeckName = deck.Name;
					_originalDeck = deck;
				}
				_newDeck = (Deck)deck.Clone();

				_newDeck.Cards.Clear();
				foreach(var card in deck.GetSelectedDeckVersion().Cards)
					_newDeck.Cards.Add(card.Clone() as Card);
				_newDeck.SelectedVersion = _newDeck.Version;
				UpdateExpansionIcons();

				ListViewDeck.ItemsSource = _newDeck.Cards;
				Helper.SortCardCollection(ListViewDeck.ItemsSource, false);
				TextBoxDeckName.Text = _newDeck.Name;
				UpdateDeckHistoryPanel(deck, !editing);
				UpdateDbListView();
				ExpandNewDeck();
				UpdateCardCount();
				ManaCurveMyDecks.SetDeck(_newDeck);
			}
		}
开发者ID:christopher7694,项目名称:Hearthstone-Deck-Tracker,代码行数:30,代码来源:MainWindow_NewDeck.cs

示例9: SetPremadeDeck

		public void SetPremadeDeck(Deck deck)
		{
			foreach(var card in deck.GetSelectedDeckVersion().Cards)
			{
				for(var i = 0; i < card.Count; i++)
					Player.RevealDeckCard(card.Id, -1);
			}
			IsUsingPremade = true;
		}
开发者ID:natorius,项目名称:Hearthstone-Deck-Tracker,代码行数:9,代码来源:GameV2.cs

示例10: SetNewDeck

		public void SetNewDeck(Deck deck, bool editing = false)
		{
			if(deck == null)
				return;
			ClearNewDeckSection();
			SelectDeck(null, false);
			EditingDeck = editing;
			if(editing)
			{
				_editedDeckName = deck.Name;
				_originalDeck = deck;
			}
			_newDeck = (Deck)deck.Clone();

			_newDeck.Cards.Clear();
			foreach(var card in deck.GetSelectedDeckVersion().Cards)
				_newDeck.Cards.Add(card.Clone() as Card);
			_newDeck.SelectedVersion = _newDeck.Version;
			UpdateExpansionIcons();

			ListViewDeck.ItemsSource = _newDeck.Cards;
			Helper.SortCardCollection(ListViewDeck.ItemsSource, false);
			TextBoxDeckName.Text = _newDeck.Name;
			BorderConstructedCardLimits.Visibility = _newDeck.IsArenaDeck ? Collapsed : Visible;
			CheckBoxConstructedCardLimits.IsChecked = true;
			UpdateDeckHistoryPanel(deck, !editing);
			UpdateDbListView();
			ExpandNewDeck();
			UpdateCardCount();
			ManaCurveMyDecks.SetDeck(_newDeck);
		}
开发者ID:JDurman,项目名称:Hearthstone-Deck-Tracker,代码行数:31,代码来源:MainWindow.NewDeck.cs

示例11: CreateDeck

		/// <summary>
		/// Returns true if Hearthstone lost focus in the process
		/// </summary>
		public static async Task<bool> CreateDeck(Deck deck, ExportingInfo info)
		{
			Log.Info("Creating deck...");
			deck.MissingCards.Clear();
			foreach(var card in deck.GetSelectedDeckVersion().Cards.ToSortedCardList())
			{
				var missingCardsCount = await AddCardToDeck(card, info);
				if(missingCardsCount < 0)
					return true;
				if(missingCardsCount > 0)
				{
					var missingCard = (Card)card.Clone();
					missingCard.Count = missingCardsCount;
					deck.MissingCards.Add(missingCard);
				}
			}
			Log.Info(deck.MissingCards.Count + " missing cards");
			if(deck.MissingCards.Any())
				DeckList.Save();
			return false;
		}
开发者ID:ChuckJrster,项目名称:Hearthstone-Deck-Tracker,代码行数:24,代码来源:ExportingActions.cs


注:本文中的Hearthstone_Deck_Tracker.Hearthstone.Deck.GetSelectedDeckVersion方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。