Am designing a network card game. i have this method
CODE
public void AddCardToPile(int c, int index)
{
PictureBox[] pbCapturedPiles = { pictureBox41, pictureBox42, pictureBox43, pictureBox44 };
this.SuspendLayout();
Card.Card pcard = cc.FromIntToCard(c);
pcard.Location = pbCapturedPiles[index].Location;
pcard.Size = new System.Drawing.Size(55, 75);
this.Controls.Add(pcard);
this.ResumeLayout();
}
this method is called twice first for the card that you are capturing then for the capturing with. Moves them to a picture box for your captured cards. Problem it only redraws the one you were capturing with only. and leaves another copy of it on the table as well as the one you were suppose to b capturing is also not moved.
the above method is called from this method
CODE
public void AddToCaptured()
{
Card.Card c;
Point p = new Point(xIndex, yIndex);
c = (Card.Card)this.GetChildAtPoint(p);
//c.Location = pbPlayingCard.Location;
bl.DeleteOneGameTableCard(myGame.GameID, cc.CreateIntegerCard(someCard));
bl.AddToCapturedPile(username, myGame.GameID, cc.CreateIntegerCard(c), (int)bl.GetTotalCapturedCards(username));
DrawCardAtPile(cc.CreateIntegerCard(c), 0);
bl.AddToCapturedPile(username, myGame.GameID, cc.CreateIntegerCard(someCard), (int)bl.GetTotalCapturedCards(username));
DrawCardAtPile(cc.CreateIntegerCard(someCard), 0);
myGame.SetWhosTurn(username);
}