diff --git a/projetAgile/Makefile b/projetAgile/Makefile index a826fea..8af9f83 100644 --- a/projetAgile/Makefile +++ b/projetAgile/Makefile @@ -4,6 +4,7 @@ PACKAGE = fr.iutfbleau.projetAgile PACKAGE_PATH = fr/iutfbleau/projetAgile JAR_OPTION = cvfe projetAgile.jar $(PACKAGE).main.Main -C build fr -C res +#------- Dossiers ------ View : build/$(PACKAGE_PATH)/View/Pion.class \ build/$(PACKAGE_PATH)/View/Grille.class @@ -14,6 +15,8 @@ Events : build/$(PACKAGE_PATH)/Controlers/EventListener/GridChangedListener.clas build/$(PACKAGE_PATH)/Controlers/EventListener/GridEvent.class \ build/$(PACKAGE_PATH)/Controlers/EventListener/PlayerEvent.class +#------- Events ------ + build/$(PACKAGE_PATH)/Controlers/EventListener/PlayerEvent.class : src/$(PACKAGE_PATH)/Controlers/EventListener/PlayerEvent.java javac $(JAVAC_OPT) src/$(PACKAGE_PATH)/Controlers/EventListener/PlayerEvent.java @@ -25,18 +28,26 @@ build/$(PACKAGE_PATH)/Controlers/EventListener/GridChangedListener.class : src/$ build/$(PACKAGE_PATH)/Controlers/EventListener/GridEvent.class javac $(JAVAC_OPT) src/$(PACKAGE_PATH)/Controlers/EventListener/GridChangedListener.java +#------- Controleur ------ + build/$(PACKAGE_PATH)/Controlers/GrilleMouseListener.class : src/$(PACKAGE_PATH)/Controlers/GrilleMouseListener.java \ build/$(PACKAGE_PATH)/View/Grille.class \ build/$(PACKAGE_PATH)/Model/GrilleModel.class javac $(JAVAC_OPT) src/$(PACKAGE_PATH)/Controlers/GrilleMouseListener.java +#------- Modele ------ + build/$(PACKAGE_PATH)/Model/GrilleModel.class : src/$(PACKAGE_PATH)/Model/GrilleModel.java \ Events javac $(JAVAC_OPT) src/$(PACKAGE_PATH)/Model/GrilleModel.java +#------- Utils ------ + build/$(PACKAGE_PATH)/Utils/Constants.class : src/$(PACKAGE_PATH)/Utils/Constants.java javac $(JAVAC_OPT) src/$(PACKAGE_PATH)/Utils/Constants.java +#------- Vue ------ + build/$(PACKAGE_PATH)/View/Pion.class : src/$(PACKAGE_PATH)/View/Pion.java \ build/$(PACKAGE_PATH)/Utils/Constants.class javac $(JAVAC_OPT) src/$(PACKAGE_PATH)/View/Pion.java @@ -56,7 +67,7 @@ build/$(PACKAGE_PATH)/View/TestGrille.class : src/$(PACKAGE_PATH)/View/TestGril build/$(PACKAGE_PATH)/View/Puissance4Panel.class \ build/$(PACKAGE_PATH)/Model/GrilleModel.class \ build/$(PACKAGE_PATH)/Controlers/GrilleMouseListener.class \ - Events + javac $(JAVAC_OPT) src/$(PACKAGE_PATH)/View/TestGrille.java diff --git a/projetAgile/src/fr/iutfbleau/projetAgile/Model/GrilleModel.java b/projetAgile/src/fr/iutfbleau/projetAgile/Model/GrilleModel.java index 7320f33..f82a1c8 100644 --- a/projetAgile/src/fr/iutfbleau/projetAgile/Model/GrilleModel.java +++ b/projetAgile/src/fr/iutfbleau/projetAgile/Model/GrilleModel.java @@ -41,7 +41,9 @@ public class GrilleModel { } private void switchPlayer() { + int oldPlayer = this.playerTurn; this.playerTurn = (this.playerTurn + 1) % 2; + firePlayerChanged(oldPlayer, this.playerTurn); } public void addGridListener(GridChangedListener listener) { diff --git a/projetAgile/src/fr/iutfbleau/projetAgile/View/Grille.java b/projetAgile/src/fr/iutfbleau/projetAgile/View/Grille.java index c748970..3083e7c 100644 --- a/projetAgile/src/fr/iutfbleau/projetAgile/View/Grille.java +++ b/projetAgile/src/fr/iutfbleau/projetAgile/View/Grille.java @@ -65,14 +65,11 @@ public class Grille extends JPanel implements GridChangedListener{ @Override public void gridChanged(GridEvent e) { this.addPlayerPawn(e.getColumn(), e.getRow(), e.getPlayer()); - System.out.println("Appuie sur la colonne : " + e.getColumn()); - } @Override public void playerChanged(PlayerEvent e) { - System.out.println("Nouveau jouer : " + (e.getNewPlayer() == Constants.PLAYER_ONE ? Constants.PLAYER_ONE : Constants.PLAYER_TWO)); - + System.out.println("Tour du joueur : " + (e.getNewPlayer() == Constants.PLAYER_ONE ? "Rouge" : "Jaune")); } } \ No newline at end of file