diff --git a/src/ihm/controller/ChoisirEquipement.java b/src/ihm/controller/ChoisirEquipement.java new file mode 100644 index 0000000..90a7906 --- /dev/null +++ b/src/ihm/controller/ChoisirEquipement.java @@ -0,0 +1,24 @@ +package ihm.controller; + +import java.net.URL; +import java.util.ResourceBundle; + +import carte.Equipement; +import javafx.fxml.FXML; +import javafx.fxml.Initializable; +import javafx.scene.layout.GridPane; +import main.Joueur; + +public class ChoisirEquipement implements Initializable{ + @FXML private GridPane equipement; + + private Joueur joueurVole; + private Equipement equipementVole; + + @Override + public void initialize(URL arg0, ResourceBundle arg1) { + // TODO Auto-generated method stub + + } + +} diff --git a/src/ihm/controller/JouerSonTour1Controller.java b/src/ihm/controller/JouerSonTour1Controller.java deleted file mode 100644 index 56d668e..0000000 --- a/src/ihm/controller/JouerSonTour1Controller.java +++ /dev/null @@ -1,68 +0,0 @@ -package ihm.controller; - -import java.io.IOException; -import java.net.URL; -import java.util.Locale; -import java.util.Random; -import java.util.ResourceBundle; - -import carte.CarteLieu; -import ihm.SpriteAnimation; -import javafx.animation.Animation; -import javafx.event.Event; -import javafx.event.EventHandler; -import javafx.fxml.FXML; -import javafx.fxml.FXMLLoader; -import javafx.fxml.Initializable; -import javafx.geometry.Rectangle2D; -import javafx.scene.Group; -import javafx.scene.control.Button; -import javafx.scene.control.Label; -import javafx.scene.image.ImageView; -import javafx.scene.input.MouseEvent; -import javafx.scene.layout.AnchorPane; -import javafx.scene.layout.BorderPane; -import javafx.scene.layout.Pane; -import javafx.util.Duration; -import main.Joueur; - -public class JouerSonTour1Controller implements Initializable{ - @FXML private Pane rootPane; - @FXML private Label d6; - @FXML private Label d4; - @FXML private Button btnStop; - @FXML private Button btnLancer; - - @Override - public void initialize(URL arg0, ResourceBundle arg1) { - btnStop.setVisible(false); - } - - @FXML - public void lancerDes(MouseEvent mouseEvent)throws InterruptedException{ - System.out.println("\tLancements des dès"); - - btnLancer.setVisible(false); - btnStop.setVisible(true); - - /*for (int i=1; i<7; i++) { - Thread.sleep(500); - d6.setText(Integer.toString(i)); - } - - for (int i=1; i<5; i++) { - Thread.sleep(500); - d4.setText(Integer.toString(i)); - }*/ - } - - @FXML - public void stop(MouseEvent mouseEvent) throws IOException, InterruptedException { - Thread.sleep(2000); - final URL fxmlURL = getClass().getResource("/ihm/ressources/Jouer_tour(2)carte_lieux.fxml"); - final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", Locale.ENGLISH); - final FXMLLoader fxmlLoader = new FXMLLoader(fxmlURL, bundle); - Pane root = fxmlLoader.load(); - rootPane.getChildren().setAll(root); - } -} \ No newline at end of file diff --git a/src/ihm/controller/JouerSonTour4Controller.java b/src/ihm/controller/JouerSonTour4Controller.java new file mode 100644 index 0000000..7018ffa --- /dev/null +++ b/src/ihm/controller/JouerSonTour4Controller.java @@ -0,0 +1,20 @@ +package ihm.controller; + +import java.net.URL; +import java.util.ResourceBundle; + +import javafx.fxml.FXML; +import javafx.scene.control.Label; +import main.Joueur; + +public class JouerSonTour4Controller extends LancerDes{ + @FXML private Label defenseur; + + private Joueur j; + + @Override + public void initialize(URL arg0, ResourceBundle arg1) { + super.initialize(arg0, arg1); + defenseur.setText(j.getNom()); + } +} diff --git a/src/ihm/controller/LancerDes.java b/src/ihm/controller/LancerDes.java new file mode 100644 index 0000000..79c0c3c --- /dev/null +++ b/src/ihm/controller/LancerDes.java @@ -0,0 +1,49 @@ +package ihm.controller; + +import java.net.URL; +import java.util.ResourceBundle; + +import javafx.fxml.FXML; +import javafx.fxml.Initializable; +import javafx.scene.control.Button; +import javafx.scene.control.Label; + +public class LancerDes implements Initializable{ + @FXML private Label d6; + @FXML private Label d4; + @FXML private Button btnStop; + @FXML private Button btnLancer; + + private int resultatD6; + private int resultatD4; + + @Override + public void initialize(URL arg0, ResourceBundle arg1) { + // TODO Auto-generated method stub + btnStop.setVisible(false); + + btnLancer.setOnAction(e -> { + lancement(); + btnLancer.setVisible(false); + btnStop.setVisible(true); + }); + + btnStop.setOnAction(e -> { + //à remplir avec les valeurs donné par le gestionnaire de jeux + d6.setText(Integer.toString(resultatD6)); + d4.setText(Integer.toString(resultatD4)); + }); + } + + public void lancement() { + /*for (int i=1; i<7; i++) { + Thread.sleep(500); + d6.setText(Integer.toString(i)); + } + + for (int i=1; i<5; i++) { + Thread.sleep(500); + d4.setText(Integer.toString(i)); + }*/ + } +} diff --git a/src/ihm/ressources/Jouer_tour(1)lancer_des.fxml b/src/ihm/ressources/Jouer_tour(1)lancer_des.fxml index 0b58c99..496c848 100644 --- a/src/ihm/ressources/Jouer_tour(1)lancer_des.fxml +++ b/src/ihm/ressources/Jouer_tour(1)lancer_des.fxml @@ -8,9 +8,9 @@ - + - @@ -35,7 +35,7 @@ -