public void PlaceCard(PCColor color, PCValue value) /// Places a card in the pile (REMOVES it from my hand) /// If it's a super taki or a change color, the requested color needs to be specified { PlayingCard cardToPlace = null; foreach (PlayingCard card in myCards) { if (card.CardValue == value && (card.CardColor == color || card.CardColor == PCColor.All)) { cardToPlace = card; } } if (cardToPlace == null) { return; } myCards.Remove(cardToPlace); Controls.Remove(cardToPlace); cardToPlace.CardColor = color; // TODO: try to dispose // Change the pile card /*pile.CardColor = color; * pile.CardValue = value; * pile.Invalidate();*/ RearrangeMyCards(); }
public PlayingCard(PCColor color, PCValue value) { CardColor = color; CardValue = value; InitializeComponent(); AddPaintHandlers(); }
public PlayingCard() { CardColor = 0; CardValue = 0; InitializeComponent(); AddPaintHandlers(); }
public void AddToMyCards(PCColor color, PCValue value) /// Adds a card to my hand { PlayingCard card = new PlayingCard(color, value); card.Location = new Point(0, ClientSize.Height - pile.Height - handEdgeDistance); card.Anchor = AnchorStyles.Bottom; myCards.Add(card); Controls.Add(card); RearrangeMyCards(); }