本文整理汇总了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);
}
}
示例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);
}
示例3: SetDeck
public void SetDeck(Deck deck)
{
if(deck == null)
{
ClearDeck();
return;
}
_deck = deck;
deck.GetSelectedDeckVersion().Cards.CollectionChanged += (sender, args) => UpdateValues();
UpdateValues();
}
示例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;
}
示例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;
}
示例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;
}
示例7: SetPremadeDeck
public static void SetPremadeDeck(Deck deck)
{
PlayerDeck.Clear();
foreach(var card in deck.GetSelectedDeckVersion().Cards)
PlayerDeck.Add((Card)card.Clone());
IsUsingPremade = true;
}
示例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);
}
}
示例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;
}
示例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);
}
示例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;
}