// ******************** MOUVEMENT ********************** // ******************** MOUVEMENT RETOUR ********************** public void RetourDpl(int retourNbr) { if (rtClic < cpClic) { monBouton btmp; //effacement for (int i = cpClic - 1; i >= (cpClic - retourNbr); --i) { btmp = dpl[i]; btmp.Reinitialiser(); CibleSup(btmp, piece); DD.OuvrirDispo(btmp.getNumLigne(), btmp.getNumCol()); dpl[i] = null; } //ajouter detail initiaux cpClic -= retourNbr; btmp = dpl[cpClic - 1]; btmp.Colorer(); btmp.ImageAj(piece.GetImg()); CibleAj(btmp, this.piece); piece.DeplacerF(btmp.getNumLigne(), btmp.getNumCol()); jouLig = btmp.getNumLigne(); jouCol = btmp.getNumCol(); DD.FermerDispo(btmp.getNumLigne(), btmp.getNumCol()); } }
private void PremierDeplacerPiece(monBouton bdest) { if (DD.IsDispo(bdest.getNumLigne(), bdest.getNumCol())) { depLig = bdest.getNumLigne(); depCol = bdest.getNumCol(); piece = new Cavalier(bdest, choixCav); bdest.ImageAj(piece.GetImg()); DD.FermerDispo(depLig, depCol); //CibleAj(bdest, piece); } }
// ************************* DEPLACEMENT PIECE ************************** private void DeplacerPiece(monBouton bori, monBouton bdest) { if ((piece.IsAtteignable(bdest.getNumLigne(), bdest.getNumCol()))) { bori.ImageSupp(); bori.Assombrir(); //CibleSup(bori, piece); piece.Deplacer(bdest.getNumLigne(), bdest.getNumCol()); bdest.ImageAj(piece.GetImg()); DD.FermerDispo(bdest.getNumLigne(), bdest.getNumCol()); //CibleAj(bdest, piece); } }
private void PremierDeplacerPiece(monBouton bdest) { if (DD.IsDispo(bdest.getNumLigne(), bdest.getNumCol())) { depLig = bdest.getNumLigne(); depCol = bdest.getNumCol(); this.piece = new Cavalier(bdest, choixCav); bdest.ImageAj(piece.GetImg()); DD.FermerDispo(depLig, depCol); jouLig = depLig; jouCol = depCol; dpl[cpClic] = bdest; ++cpClic; CibleAj(bdest, this.piece); } }
// ******************** MOUVEMENT JOUER ********************** private void DeplacerPiece(monBouton bori, monBouton bdest) { if ((piece.IsAtteignable(bdest.getNumLigne(), bdest.getNumCol()))) { bori.ImageSupp(); bori.Assombrir(); CibleSup(bori, piece); piece.Deplacer(bdest.getNumLigne(), bdest.getNumCol()); bdest.ImageAj(piece.GetImg()); DD.FermerDispo(bdest.getNumLigne(), bdest.getNumCol()); jouLig = bdest.getNumLigne(); jouCol = bdest.getNumCol(); dpl[cpClic] = bdest; ++cpClic; CibleAj(bdest, this.piece); } }