private void selectHandler(object sender, EventArgs e) { if (firstCard != null && secondCard != null) { return; } card clickedCard = ((card)sender); if (!clickedCard.Reveled) { clickedCard.flipCard(); if (!clickedCard.EmptyCard) { if (this.firstCard == null) { firstCard = clickedCard; } else if (clickedCard.compereTo(firstCard)) { reveledPears++; firstCard = null; secondCard = null; this.chekForWin(); } else { this.secondCard = clickedCard; lagTimer.Start(); } } } }
private void lagTimer_Tick(object sender, EventArgs e) { lagTimer.Stop(); firstCard.flipCard(); secondCard.flipCard(); firstCard = null; secondCard = null; }