Makefile petit problème

This commit is contained in:
Justine Yannis 2022-10-13 16:09:07 +02:00
parent 90024948f9
commit 9fc468f0c4
3 changed files with 15 additions and 5 deletions

View File

@ -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

View File

@ -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) {

View File

@ -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"));
}
}