Skip to content

Commit

Permalink
Merge pull request #31 from projet-gl2/imp/restructure
Browse files Browse the repository at this point in the history
Correction chargement et vérification
  • Loading branch information
enimaloc authored Apr 15, 2024
2 parents d1d8b1e + 4d52e5c commit 1b9df3b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ protected void paintComponent(Graphics g) {
g2.setColor(color);

// Si les deux ils du pont ne sont pas pleines
if(!isIsleFull(bridge.getIle1()) && !isIsleFull(bridge.getIle2())) {
if((!isIsleFull(bridge.getIle1()) && !isIsleFull(bridge.getIle2())) || isBridgeExist(bridge.getIle1(), bridge.getIle2())) {

// Si le pont est horizontal
if (estHorizontal(bridge)) {
Expand Down Expand Up @@ -330,7 +330,7 @@ public int getNearestBridge(int souris_x, int souris_y) {
*/
private boolean isIsleFull(Ile ile)
{
return ile.getNbPont() >= ile.getN();
return ile.isComplete();
}

/**
Expand Down
1 change: 1 addition & 0 deletions src/main/java/fr/hashimiste/impl/jeu/GrilleImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,7 @@ public void chargerSauvegarde(Sauvegarde sauvegarde) {
if (histo.getAction() == Historique.Action.UN_PONT) {
poserPont(histo.getIle1(), histo.getIle2(), 1);
} else if (histo.getAction() == Historique.Action.DEUX_PONTS) {
supprimerPont(histo.getIle1(), histo.getIle2());
poserPont(histo.getIle1(), histo.getIle2(), 2);
} else {
supprimerPont(histo.getIle1(), histo.getIle2());
Expand Down

0 comments on commit 1b9df3b

Please sign in to comment.