diff --git a/shDBlatest.sql b/shDBlatest.sql index ec90c5a..f46bfe8 100644 Binary files a/shDBlatest.sql and b/shDBlatest.sql differ diff --git a/src/ihm/Main.java b/src/ihm/Main.java index f7b3361..0e263e3 100644 --- a/src/ihm/Main.java +++ b/src/ihm/Main.java @@ -31,7 +31,7 @@ public class Main extends Application { System.exit(0); } }); - //primaryStage.setMaximized(true); + primaryStage.setMaximized(true); primaryStage.show(); } diff --git a/src/ihm/controller/ChoisirBoolean.java b/src/ihm/controller/ChoisirBoolean.java index da7dd09..33dd2d1 100644 --- a/src/ihm/controller/ChoisirBoolean.java +++ b/src/ihm/controller/ChoisirBoolean.java @@ -6,12 +6,13 @@ import java.util.ResourceBundle; import javafx.fxml.FXML; import javafx.fxml.Initializable; import javafx.scene.control.Button; +import javafx.scene.control.Label; import main.GestionnaireJeu; public class ChoisirBoolean implements Initializable { - @FXML private Button ouiButton; @FXML private Button nonButton; + @FXML private Label titre; private boolean result; @Override @@ -32,4 +33,28 @@ public class ChoisirBoolean implements Initializable { public boolean getResult() { return this.result; } + + public Button getOuiButton() { + return ouiButton; + } + + public void setOuiButton(Button ouiButton) { + this.ouiButton = ouiButton; + } + + public Button getNonButton() { + return nonButton; + } + + public void setNonButton(Button nonButton) { + this.nonButton = nonButton; + } + + public Label getTitre() { + return titre; + } + + public void setTitre(Label titre) { + this.titre = titre; + } } diff --git a/src/ihm/controller/ChoisirJoueur.java b/src/ihm/controller/ChoisirJoueur.java new file mode 100644 index 0000000..4d2e971 --- /dev/null +++ b/src/ihm/controller/ChoisirJoueur.java @@ -0,0 +1,67 @@ +package ihm.controller; + +import java.net.URL; +import java.util.ResourceBundle; + +import javafx.fxml.FXML; +import javafx.fxml.Initializable; +import javafx.scene.control.Label; +import javafx.scene.layout.HBox; + +public class ChoisirJoueur implements Initializable{ + @FXML private HBox joueurHaut; + @FXML private HBox joueurBas; + @FXML private Label titre; + + private int joueurSelected; + + @Override + public void initialize(URL arg0, ResourceBundle arg1) { + for (int i=0; i { + this.joueurSelected = numJoueur; + }); + } + + for (int i=0; i { + this.joueurSelected = numJoueur; + }); + } + } + + //GETTERS AND SETTERS + public HBox getJoueurHaut() { + return joueurHaut; + } + + public void setJoueurHaut(HBox joueurHaut) { + this.joueurHaut = joueurHaut; + } + + public HBox getJoueurBas() { + return joueurBas; + } + + public void setJoueurBas(HBox joueurBas) { + this.joueurBas = joueurBas; + } + + public Label getTitre() { + return titre; + } + + public void setTitre(Label titre) { + this.titre = titre; + } + + public int getJoueurSelected() { + return joueurSelected; + } + + public void setJoueurSelected(int joueurSelected) { + this.joueurSelected = joueurSelected; + } +} diff --git a/src/ihm/controller/JouerSonTour1Controller.java b/src/ihm/controller/JouerSonTour1Controller.java index 1609768..56d668e 100644 --- a/src/ihm/controller/JouerSonTour1Controller.java +++ b/src/ihm/controller/JouerSonTour1Controller.java @@ -45,7 +45,7 @@ public class JouerSonTour1Controller implements Initializable{ btnLancer.setVisible(false); btnStop.setVisible(true); - for (int i=1; i<7; i++) { + /*for (int i=1; i<7; i++) { Thread.sleep(500); d6.setText(Integer.toString(i)); } @@ -53,7 +53,7 @@ public class JouerSonTour1Controller implements Initializable{ for (int i=1; i<5; i++) { Thread.sleep(500); d4.setText(Integer.toString(i)); - } + }*/ } @FXML diff --git a/src/ihm/controller/JouerSonTour2Controller.java b/src/ihm/controller/JouerSonTour2Controller.java index e30348d..6d47e56 100644 --- a/src/ihm/controller/JouerSonTour2Controller.java +++ b/src/ihm/controller/JouerSonTour2Controller.java @@ -1,51 +1,9 @@ package ihm.controller; -import java.io.IOException; -import java.net.URL; -import java.util.ResourceBundle; - -import carte.CarteLieu; -import javafx.fxml.FXML; -import javafx.fxml.FXMLLoader; -import javafx.fxml.Initializable; -import javafx.scene.control.Label; -import javafx.scene.input.MouseEvent; -import javafx.scene.layout.BorderPane; -import javafx.scene.layout.Pane; - -public class JouerSonTour2Controller implements Initializable{ - private CarteLieu lieu; - - @FXML private Pane rootPane; - @FXML private Label descriptionLieu; - - @Override - public void initialize(URL arg0, ResourceBundle arg1) { - System.out.println("\tDescrption du lieux"); - //descriptionLieu.setText(lieu.getDescription()); +public class JouerSonTour2Controller extends ChoisirBoolean{ + public void initButtons () { + super.getOuiButton().setText("utiliser.capaciter.lieux"); + super.getNonButton().setText("sauter.etape"); + super.getTitre().setText("description.capacite.carte.lieux"); } - - @FXML - public void ignorerEtape(MouseEvent mouseEvent) throws IOException{ - Pane pane = FXMLLoader.load(getClass().getResource("/ihm/ressources/Jouer_tour(3)attaquer.fxml")); - rootPane.getChildren().setAll(pane); - } - - @FXML - public void capaciteLieu(MouseEvent mouseEvent) throws IOException{ - /*//si le lieu fait attaquer ou se soigner - if (lieu.getNom().compareTo("foret hantee")) { - Pane pane = FXMLLoader.load(getClass().getResource("../ressources/Jouer_tour(2c)attaquer_soigner.fxml")); - rootPane.getChildren().setAll(pane); - //si le lieu fait voler une carte equipement - }else if(lieu.getNom().compareTo("sanctuaire ancien")) { - Pane pane = FXMLLoader.load(getClass().getResource("../ressources/Jouer_tour(2a)voler_equipement.fxml")); - rootPane.getChildren().setAll(pane); - //si le lieu fait piocher une carte - }else { - Pane pane = FXMLLoader.load(getClass().getResource("../ressources/Jouer_tour(2b)piocher_carte.fxml")); - rootPane.getChildren().setAll(pane); - }*/ - } - } \ No newline at end of file diff --git a/src/ihm/controller/JouerSonTour2c1Controller.java b/src/ihm/controller/JouerSonTour2c1Controller.java new file mode 100644 index 0000000..fb28624 --- /dev/null +++ b/src/ihm/controller/JouerSonTour2c1Controller.java @@ -0,0 +1,9 @@ +package ihm.controller; + +public class JouerSonTour2c1Controller extends ChoisirBoolean{ + public void initButtons () { + super.getOuiButton().setText("Attaquer !"); + super.getNonButton().setText("se.soigner"); + super.getTitre().setText("attaquer.ou.soigner"); + } +} diff --git a/src/ihm/controller/JouerSonTour3Controller.java b/src/ihm/controller/JouerSonTour3Controller.java index 7b5037f..9654a02 100644 --- a/src/ihm/controller/JouerSonTour3Controller.java +++ b/src/ihm/controller/JouerSonTour3Controller.java @@ -1,35 +1,9 @@ package ihm.controller; -import java.io.IOException; -import java.net.URL; -import java.util.ResourceBundle; - -import javafx.fxml.FXML; -import javafx.fxml.FXMLLoader; -import javafx.fxml.Initializable; -import javafx.scene.Node; -import javafx.scene.input.MouseEvent; -import javafx.scene.layout.Pane; -import javafx.stage.Stage; - -public class JouerSonTour3Controller implements Initializable{ - @FXML private Pane rootPane; - - @Override - public void initialize(URL arg0, ResourceBundle arg1) { - +public class JouerSonTour3Controller extends ChoisirBoolean{ + public void initButtons () { + super.getOuiButton().setText("Attaquer !"); + super.getNonButton().setText("Ne pas attaquer"); + super.getTitre().setText("Voulez-vous attaquer un joueur ?"); } - - /*@FXML - public void choixJoueur(MouseEvent mouseEvent) throws IOException{ - Pane pane = FXMLLoader.load(getClass().getResource("../ressources/jouerSonTour4.fxml")); - rootPane.getChildren().setAll(pane); - - }*/ - - @FXML - public void pasAttaquer(MouseEvent mouseEvent) throws IOException{ - Stage appStage = (Stage) ((Node) mouseEvent.getSource()).getScene().getWindow(); - appStage.close(); - } } diff --git a/src/ihm/controller/JouerSonTour4Controller.java b/src/ihm/controller/JouerSonTour4Controller.java deleted file mode 100644 index e654473..0000000 --- a/src/ihm/controller/JouerSonTour4Controller.java +++ /dev/null @@ -1,19 +0,0 @@ -package ihm.controller; - -import java.net.URL; -import java.util.ResourceBundle; - -import javafx.fxml.FXML; -import javafx.fxml.Initializable; -import javafx.scene.layout.Pane; - -public class JouerSonTour4Controller implements Initializable{ - @FXML private Pane rootPane; - - @Override - public void initialize(URL arg0, ResourceBundle arg1) { - // TODO Auto-generated method stub - - } - -} diff --git a/src/ihm/controller/JouerSonTour5Controller.java b/src/ihm/controller/JouerSonTour5Controller.java deleted file mode 100644 index 9e5d7e5..0000000 --- a/src/ihm/controller/JouerSonTour5Controller.java +++ /dev/null @@ -1,33 +0,0 @@ -package ihm.controller; - -import java.io.IOException; -import java.net.URL; -import java.util.Locale; -import java.util.ResourceBundle; - -import javafx.fxml.FXML; -import javafx.fxml.FXMLLoader; -import javafx.fxml.Initializable; -import javafx.scene.input.MouseEvent; -import javafx.scene.layout.Pane; - -public class JouerSonTour5Controller implements Initializable{ - @FXML private Pane rootPane; - - @Override - public void initialize(URL arg0, ResourceBundle arg1) { - // TODO Auto-generated method stub - - } - @FXML - public void equipementVole(MouseEvent mouseEvent) throws IOException{ - - final URL fxmlURL = getClass().getResource("/ihm/ressources/jouerSonTour6.fxml"); - final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", Locale.ENGLISH); - final FXMLLoader fxmlLoader = new FXMLLoader(fxmlURL, bundle); - Pane pane = fxmlLoader.load(); - rootPane.getChildren().setAll(pane); - - } - -} diff --git a/src/ihm/controller/JouerSonTour6Controller.java b/src/ihm/controller/JouerSonTour6Controller.java deleted file mode 100644 index 4f04389..0000000 --- a/src/ihm/controller/JouerSonTour6Controller.java +++ /dev/null @@ -1,44 +0,0 @@ -package ihm.controller; - -import java.io.IOException; -import java.net.URL; -import java.util.Locale; -import java.util.ResourceBundle; - -import javafx.fxml.FXML; -import javafx.fxml.FXMLLoader; -import javafx.fxml.Initializable; -import javafx.scene.input.MouseEvent; -import javafx.scene.layout.Pane; - -public class JouerSonTour6Controller implements Initializable{ - @FXML private Pane rootPane; - - @Override - public void initialize(URL arg0, ResourceBundle arg1) { - // TODO Auto-generated method stub - - } - @FXML - public void piocherVision(MouseEvent mouseEvent) throws IOException{ - - final URL fxmlURL = getClass().getResource("/ihm/ressources/jouer_Son_Tour_piocher_vision.fxml"); - final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", Locale.ENGLISH); - final FXMLLoader fxmlLoader = new FXMLLoader(fxmlURL, bundle); - Pane pane = fxmlLoader.load(); - - rootPane.getChildren().setAll(pane); - - } - @FXML - public void piocherTenebre(MouseEvent mouseEvent) throws IOException{ - - final URL fxmlURL = getClass().getResource("/ihm/ressources/jouer_Son_Tour_piocher_lum_et_ten.fxml"); - final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", Locale.ENGLISH); - final FXMLLoader fxmlLoader = new FXMLLoader(fxmlURL, bundle); - Pane pane = fxmlLoader.load(); - - rootPane.getChildren().setAll(pane); - - } -} diff --git a/src/ihm/controller/JouerSonTourDonnerVisionController.java b/src/ihm/controller/JouerSonTourDonnerVisionController.java deleted file mode 100644 index 895aba6..0000000 --- a/src/ihm/controller/JouerSonTourDonnerVisionController.java +++ /dev/null @@ -1,34 +0,0 @@ -package ihm.controller; - -import java.io.IOException; -import java.net.URL; -import java.util.Locale; -import java.util.ResourceBundle; - -import javafx.fxml.FXML; -import javafx.fxml.FXMLLoader; -import javafx.fxml.Initializable; -import javafx.scene.input.MouseEvent; -import javafx.scene.layout.Pane; - -public class JouerSonTourDonnerVisionController implements Initializable{ - @FXML private Pane rootPane; - @Override - public void initialize(URL arg0, ResourceBundle arg1) { - // TODO Auto-generated method stub - - } - @FXML - public void attaquer(MouseEvent mouseEvent) throws IOException{ - - final URL fxmlURL = getClass().getResource("/ihm/ressources/jouer_Son_Tour_recevoir_blessure.fxml"); - final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", Locale.ENGLISH); - final FXMLLoader fxmlLoader = new FXMLLoader(fxmlURL, bundle); - Pane pane = fxmlLoader.load(); - - rootPane.getChildren().setAll(pane); - - } - - -} diff --git a/src/ihm/controller/PiocherLumiereTenebreController.java b/src/ihm/controller/PiocherLumiereTenebreController.java deleted file mode 100644 index f1afaeb..0000000 --- a/src/ihm/controller/PiocherLumiereTenebreController.java +++ /dev/null @@ -1,19 +0,0 @@ -package ihm.controller; - -import java.net.URL; -import java.util.ResourceBundle; - -import javafx.fxml.FXML; -import javafx.fxml.Initializable; -import javafx.scene.layout.Pane; - -public class PiocherLumiereTenebreController implements Initializable{ - @FXML private Pane rootPane; - - @Override - public void initialize(URL arg0, ResourceBundle arg1) { - // TODO Auto-generated method stub - - } - -} diff --git a/src/ihm/controller/RecevoirBlessureController.java b/src/ihm/controller/RecevoirBlessureController.java deleted file mode 100644 index e7c373f..0000000 --- a/src/ihm/controller/RecevoirBlessureController.java +++ /dev/null @@ -1,19 +0,0 @@ -package ihm.controller; - -import java.net.URL; -import java.util.ResourceBundle; - -import javafx.fxml.FXML; -import javafx.fxml.Initializable; -import javafx.scene.layout.Pane; - -public class RecevoirBlessureController implements Initializable{ - @FXML private Pane rootPane; - - @Override - public void initialize(URL arg0, ResourceBundle arg1) { - // TODO Auto-generated method stub - - } - -} diff --git a/src/ihm/ressources/Jouer_tour(2)carte_lieux.fxml b/src/ihm/ressources/Jouer_tour(2)carte_lieux.fxml index 1d41dee..847be7e 100644 --- a/src/ihm/ressources/Jouer_tour(2)carte_lieux.fxml +++ b/src/ihm/ressources/Jouer_tour(2)carte_lieux.fxml @@ -12,8 +12,14 @@ - + diff --git a/src/ihm/ressources/Jouer_tour(3a)attaquer.fxml b/src/ihm/ressources/Jouer_tour(3a)attaquer.fxml new file mode 100644 index 0000000..f1ee422 --- /dev/null +++ b/src/ihm/ressources/Jouer_tour(3a)attaquer.fxml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + + + + + + + + + + + + + +