So the overview, I'm working on an assignment and I need to add a card to the next available slot in an Array. I have a Two classes, Card and Deck and im trying to make an add method for my Deck class so I can just select a card and a deck and just add it
to the right one.
So far I have.....
under my Deck Class
public int ReturnFirstAvalablePosition()
{
int lowest = Array.IndexOf(deck, null);
return lowest;
}
public void add(Card cardToAdd, Deck deckToAddTo)
{
deckToAddTo[ReturnFirstAvalablePosition] = cardToAdd;
}
//The return Works for the first free slot in my array but when I try and make it add to use that to add into a space on a Deck class it just does not work. :( I know I'm probably making a silly mistake.