示例#1
0
 public void Copy(DeckCollection collection, List<SuitEnum> availableSuits)
 {
     _decks.Clear();
     BackDeck = collection.BackDeck;
     _decks.Add(BackDeck.Name, BackDeck);
     WarehouseDeck = collection.WarehouseDeck;
     _decks.Add(WarehouseDeck.Name, WarehouseDeck);
     BorderChestDecks = collection.BorderChestDecks;
     for (int i = 0; i < BorderCount; i++)
     {
         _decks.Add(BorderChestDecks[i].Name, BorderChestDecks[i]);
     }
     MiddleChestDecks = collection.MiddleChestDecks;
     for (int i = 0; i < MiddleCount; i++)
     {
         _decks.Add(MiddleChestDecks[i].Name, MiddleChestDecks[i]);
     }
     ResultDecks = collection.ResultDecks;
     for (int i = 0; i < ResultCount; i++)
     {
         ResultDecks[i].AvailableSuits = availableSuits;
         _decks.Add(ResultDecks[i].Name, ResultDecks[i]);
     }
     TopDecks = collection.TopDecks;
     for (int i = 0; i < TopCount; i++)
     {
         _decks.Add(TopDecks[i].Name, TopDecks[i]);
     }
 }
示例#2
0
 public DeckCollection(List<SuitEnum> availableSuits)
 {
     _decks = new Dictionary<string, Deck>();
     BackDeck = new BackDeck();
     _decks.Add(BackDeck.Name, BackDeck);
     WarehouseDeck = new WarehouseDeck();
     _decks.Add(WarehouseDeck.Name, WarehouseDeck);
     BorderChestDecks = new BorderChestDeck[BorderCount];
     for (int i = 0; i < BorderCount; i++)
     {
         BorderChestDecks[i] = new BorderChestDeck(i);
         _decks.Add(BorderChestDecks[i].Name, BorderChestDecks[i]);
     }
     MiddleChestDecks = new MiddleChestDeck[MiddleCount];
     for (int i = 0; i < MiddleCount; i++)
     {
         MiddleChestDecks[i] = new MiddleChestDeck(i);
         _decks.Add(MiddleChestDecks[i].Name, MiddleChestDecks[i]);
     }
     ResultDecks = new ResultDeck[ResultCount];
     for (int i = 0; i < ResultCount; i++)
     {
         ResultDecks[i] = new ResultDeck(i, availableSuits);
         _decks.Add(ResultDecks[i].Name, ResultDecks[i]);
     }
     TopDecks = new TopDeck[TopCount];
     for (int i = 0; i < TopCount; i++)
     {
         TopDecks[i] = new TopDeck(i);
         _decks.Add(TopDecks[i].Name, TopDecks[i]);
     }
 }