本文整理汇总了C#中Deck.Clone方法的典型用法代码示例。如果您正苦于以下问题:C# Deck.Clone方法的具体用法?C# Deck.Clone怎么用?C# Deck.Clone使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Deck
的用法示例。
在下文中一共展示了Deck.Clone方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UseDeck
public void UseDeck(Deck selected)
{
_game.Reset();
if(selected != null)
{
DeckList.Instance.ActiveDeck = selected;
_game.SetPremadeDeck((Deck)selected.Clone());
UpdateMenuItemVisibility();
}
//needs to be true for automatic deck detection to work
HsLogReaderV2.Instance.Reset(true);
Overlay.Update(false);
Overlay.SortViews();
}
示例2: UseDeck
public async void UseDeck(Deck selected)
{
_game.Reset();
if(selected != null)
{
DeckList.Instance.ActiveDeck = selected;
_game.SetPremadeDeck((Deck)selected.Clone());
UpdateMenuItemVisibility();
}
//needs to be true for automatic deck detection to work
await LogReaderManager.Restart();
Overlay.Update(false);
Overlay.UpdatePlayerCards();
PlayerWindow.UpdatePlayerCards();
}
示例3: 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);
}
}
示例4: RunTests
public static void RunTests()
{
Console.WriteLine("Testing the Deck class");
Deck d = new Deck();
Deck dc = d.Clone();
for (int i = 0; i < 20; i++)
{
d.shuffle();
Console.WriteLine("Shuffle {0}:", i + 1);
Console.WriteLine("Original:" + Environment.NewLine + dc.ToString());
Console.WriteLine("Shuffled:" + Environment.NewLine + d.ToString());
Console.WriteLine("Returned to original order: {0}", d.Equals(dc));
Console.WriteLine("-----------------------");
if (d.Equals(dc))
{
return;
}
}
}
示例5: SetNewDeck
public void SetNewDeck(Deck deck, bool editing = false)
{
if (deck != null)
{
ClearNewDeckSection();
_newContainsDeck = true;
EditingDeck = editing;
NewDeck = (Deck)deck.Clone();
ListViewNewDeck.ItemsSource = NewDeck.Cards;
Helper.SortCardCollection(ListViewNewDeck.ItemsSource, false);
if (ComboBoxSelectClass.Items.Contains(NewDeck.Class))
ComboBoxSelectClass.SelectedValue = NewDeck.Class;
TextBoxDeckName.Text = NewDeck.Name;
UpdateNewDeckHeader(true);
UpdateDbListView();
}
}
示例6: SetNewDeck
private void SetNewDeck(Deck deck, bool editing = false)
{
if (deck != null)
{
ClearNewDeckSection();
_newContainsDeck = true;
_editingDeck = editing;
_newDeck = (Deck)deck.Clone();
ListViewNewDeck.ItemsSource = _newDeck.Cards;
if (ComboBoxSelectClass.Items.Contains(_newDeck.Class))
ComboBoxSelectClass.SelectedValue = _newDeck.Class;
TextBoxDeckName.Text = _newDeck.Name;
UpdateNewDeckHeader(true);
UpdateDbListView();
}
}
示例7: UseDeck
private void UseDeck(Deck selected)
{
_game.Reset();
if (selected != null)
_game.SetPremadeDeck((Deck)selected.Clone());
_logReader.Reset(true);
_overlay.SortViews();
}
示例8: SetNewDeck
public void SetNewDeck(Deck deck, bool editing = false)
{
if(deck != null)
{
ClearNewDeckSection();
DeselectDeck();
EditingDeck = editing;
if(editing)
editedDeckName = deck.Name;
_newDeck = (Deck)deck.Clone();
ListViewDeck.ItemsSource = _newDeck.Cards;
Helper.SortCardCollection(ListViewDeck.ItemsSource, false);
TextBoxDeckName.Text = _newDeck.Name;
UpdateDbListView();
ExpandNewDeck();
UpdateTitle();
}
}