It removes the current card from its current deck to a different deck, passed as
value
. It then *looks* like it raises some Deckchanged event. What
value
is I don't know (See below), it makes sense if looks like the Deck() method is made into a property (which it probably should be):
public DeckPile Deck
{
get {return deck;}
set
{
if (deck.Game != value.Game)
throw new InvalidOperationException("The new deck must be in the same game like the old deck of the card.");
if (deck != value)
{
deck.pile.remove(this);
deck = value;
deck.add(this);
if (DeckChanged != null)
DeckChanged(this, null);
}
}
}
The other thing is that the class os poorly designed: the move/shuffle methods properly belong in the Deck AFAICT. You also probably need a class that manages the game, looking after the various stacks/decks.