public void Copy(DecksCollection decks) { int count = decks.m_Decks.Count; for (int i = 0; i < count; i++) { PlayedDeck deck = new PlayedDeck(); deck.Copy(decks.m_Decks[i]); m_Decks.Add(deck); } }
public void OnOpponentPlayCard(Hearthstone_Deck_Tracker.Hearthstone.Card card) { if (m_NeedFilterByClass) { var game = Hearthstone_Deck_Tracker.API.Core.Game; if (game != null) //для игры { m_GameDecks = m_GameDecks.FilterDeck(utils.KlassConverter(game.Opponent.Class)); m_NeedFilterByClass = false; } else if (card.IsClassCard)//для отладки тестов (игры то нет) { m_GameDecks = m_GameDecks.FilterDeck(utils.KlassConverter(card.PlayerClass)); m_NeedFilterByClass = false; } } if (!card.Collectible) { return; } if (card.IsCreated) { return; } m_CurrentDeck.AddCard(card); List <PlayedDeck> deckList = m_GameDecks.GetBestDeckList(m_CurrentDeck); deckList.Sort(delegate(PlayedDeck d1, PlayedDeck d2) { return(d2.GetFoundPercent().CompareTo(d1.GetFoundPercent())); }); m_BestDeck = deckList[0]; if (m_procentForm != null) { if (deckList.Count <= 8) //иначе по ширине в экран не влезет { m_procentForm.SetShowDeckList(deckList); } else { m_procentForm.SetShowDeck(m_BestDeck); } } }