//Update holded Card private void holdcard(ACard cardin) { hold12.Image = hold11.Image; hold11.Image = hold10.Image; hold10.Image = hold9.Image; hold9.Image = hold8.Image; hold8.Image = hold7.Image; hold7.Image = hold6.Image; hold6.Image = hold5.Image; hold5.Image = hold4.Image; hold4.Image = hold3.Image; hold3.Image = hold2.Image; hold2.Image = hold1.Image; hold1.Image = Image.FromFile(getAddress(cardin.getRank(), cardin.getSuit())); chold12.Image = chold11.Image; chold11.Image = chold10.Image; chold10.Image = chold9.Image; chold9.Image = chold8.Image; chold8.Image = chold7.Image; chold7.Image = chold6.Image; chold6.Image = chold5.Image; chold5.Image = chold4.Image; chold4.Image = chold3.Image; chold3.Image = chold2.Image; chold2.Image = chold1.Image; chold1.Image = Image.FromFile("back.jpg"); }
private void showPileB(ACard incard) { lastB3.Image = lastB2.Image; lastB2.Image = lastB1.Image; lastB1.Image = pileB.Image; pileB.Image = Image.FromFile(getAddress(incard.getRank(), incard.getSuit())); tempb = incard; }
//Show Last Card in pile private void showPileA(ACard incard) { lastA3.Image = lastA2.Image; lastA2.Image = lastA1.Image; lastA1.Image = pileA.Image; pileA.Image = Image.FromFile(getAddress(incard.getRank(), incard.getSuit())); tempa = incard; }
//Draw Function public void Draw() { clearcard(); checkFirstCompare = false; checkManyHitCompare = false; checkManyHitDraw = true; if (!checkFirstPileA && tempa != pilea) //If last card in pileA called 'pilea' not show as 'tempa', update it. { if (a.getRank() == b.getRank()) { showPileA(currB); showPileA(currA); } showPileA(b); showPileA(a); if (Player1.getNumpile() > 4) { numpileA.Text = "+" + Convert.ToString(Player1.getNumpile() - 4); } } if (!checkFirstPileB && tempb != pileb) { if (a.getRank() == b.getRank()) { showPileB(currA); showPileB(currB); } showPileB(a); showPileB(b); if (Player2.getNumpile() > 4) { numpileB.Text = "+" + Convert.ToString(Player2.getNumpile() - 4); } } a = Player1.getCard(); b = Player2.getCard(); showA.Image = Image.FromFile(getAddress(a.getRank(), a.getSuit())); showB.Image = Image.FromFile("back.jpg"); }
//Draw Function public void Draw() { clearcard(); checkFirstCompare = false; checkManyHitCompare = false; checkManyHitDraw = true; if (!checkFirstPileA && tempa != pilea) //If last card in pileA called 'pilea' not show as 'tempa', update it. { if (a.getRank() == b.getRank()) { showPileA(currB); showPileA(currA); } showPileA(b); showPileA(a); if (Player1.getNumpile() > 4) numpileA.Text = "+" + Convert.ToString(Player1.getNumpile() - 4); } if (!checkFirstPileB && tempb != pileb) { if (a.getRank() == b.getRank()) { showPileB(currA); showPileB(currB); } showPileB(a); showPileB(b); if (Player2.getNumpile() > 4) numpileB.Text = "+" + Convert.ToString(Player2.getNumpile() - 4); } a = Player1.getCard(); b = Player2.getCard(); showA.Image = Image.FromFile(getAddress(a.getRank(), a.getSuit())); showB.Image = Image.FromFile("back.jpg"); }