public void AddCards(CardLists newCards) { int newCardIndex = 0; for (int i = 0; i < cards.Length; i++) { if (cards[i] == null) { string cardColor = newCards.cards[newCardIndex].color; string cardShape = newCards.cards[newCardIndex].shape; int cardCount = newCards.cards[newCardIndex].count; int[] cardPosition = newCards.cards[newCardIndex].pos; bool cardSelection = newCards.cards[newCardIndex].sel; cards[i] = cardGenerator.GenCardWithProperties(cardColor, cardShape, cardCount, cardPosition[0], cardPosition[1], cardSelection); newCardIndex += 1; } } }