controller 1 2 3
This commit is contained in:
parent
c1751ce394
commit
58eff398a7
@ -5,6 +5,7 @@ import java.net.URL;
|
|||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
import java.util.ResourceBundle;
|
import java.util.ResourceBundle;
|
||||||
|
|
||||||
|
import carte.CarteLieu;
|
||||||
import javafx.fxml.FXML;
|
import javafx.fxml.FXML;
|
||||||
import javafx.fxml.FXMLLoader;
|
import javafx.fxml.FXMLLoader;
|
||||||
import javafx.fxml.Initializable;
|
import javafx.fxml.Initializable;
|
||||||
@ -12,22 +13,38 @@ import javafx.scene.control.Label;
|
|||||||
import javafx.scene.input.MouseEvent;
|
import javafx.scene.input.MouseEvent;
|
||||||
import javafx.scene.layout.BorderPane;
|
import javafx.scene.layout.BorderPane;
|
||||||
import javafx.scene.layout.Pane;
|
import javafx.scene.layout.Pane;
|
||||||
|
import main.Joueur;
|
||||||
|
|
||||||
public class JouerSonTour1Controller implements Initializable{
|
public class JouerSonTour1Controller implements Initializable{
|
||||||
|
private Joueur joueur;
|
||||||
|
|
||||||
@FXML private Pane rootPane;
|
@FXML private Pane rootPane;
|
||||||
@FXML private Label d6;
|
@FXML private Label d6;
|
||||||
@FXML private Label d4;
|
@FXML private Label d4;
|
||||||
|
@FXML private Label nomJoueur;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initialize(URL arg0, ResourceBundle arg1) {
|
public void initialize(URL arg0, ResourceBundle arg1) {
|
||||||
|
//nomJoueur.setText(joueur.getNom());
|
||||||
}
|
}
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
public void lancerDes(MouseEvent mouseEvent) throws IOException{
|
public void lancerDes(MouseEvent mouseEvent) throws IOException, InterruptedException{
|
||||||
Random d6 = new Random();
|
//lancer d6
|
||||||
int valeurD6 = d6.nextInt(6) + 1;
|
int d6 = new Random().nextInt(6) + 1;
|
||||||
|
this.d6.setText(Integer.toString(d6));
|
||||||
|
|
||||||
|
//lancer d4
|
||||||
|
int d4 = new Random().nextInt(4) + 1;
|
||||||
|
this.d6.setText(Integer.toString(d4));
|
||||||
|
|
||||||
|
Thread.sleep(1000);
|
||||||
|
|
||||||
Pane pane = FXMLLoader.load(getClass().getResource("../ressources/Jouer_tour(2)carte_lieux.fxml"));
|
Pane pane = FXMLLoader.load(getClass().getResource("../ressources/Jouer_tour(2)carte_lieux.fxml"));
|
||||||
rootPane.getChildren().setAll(pane);
|
rootPane.getChildren().setAll(pane);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void deplacerPion(CarteLieu lieux) {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,20 +4,24 @@ import java.io.IOException;
|
|||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.util.ResourceBundle;
|
import java.util.ResourceBundle;
|
||||||
|
|
||||||
|
import carte.CarteLieu;
|
||||||
import javafx.fxml.FXML;
|
import javafx.fxml.FXML;
|
||||||
import javafx.fxml.FXMLLoader;
|
import javafx.fxml.FXMLLoader;
|
||||||
import javafx.fxml.Initializable;
|
import javafx.fxml.Initializable;
|
||||||
|
import javafx.scene.control.Label;
|
||||||
import javafx.scene.input.MouseEvent;
|
import javafx.scene.input.MouseEvent;
|
||||||
import javafx.scene.layout.BorderPane;
|
import javafx.scene.layout.BorderPane;
|
||||||
import javafx.scene.layout.Pane;
|
import javafx.scene.layout.Pane;
|
||||||
|
|
||||||
public class JouerSonTour2Controller implements Initializable{
|
public class JouerSonTour2Controller implements Initializable{
|
||||||
|
private CarteLieu lieu;
|
||||||
|
|
||||||
@FXML private Pane rootPane;
|
@FXML private Pane rootPane;
|
||||||
|
@FXML private Label descriptionLieu;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initialize(URL arg0, ResourceBundle arg1) {
|
public void initialize(URL arg0, ResourceBundle arg1) {
|
||||||
// TODO Auto-generated method stub
|
//descriptionLieu.setText(lieu.getDescription());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
@ -28,8 +32,19 @@ public class JouerSonTour2Controller implements Initializable{
|
|||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
public void capaciteLieu(MouseEvent mouseEvent) throws IOException{
|
public void capaciteLieu(MouseEvent mouseEvent) throws IOException{
|
||||||
//Pane pane = FXMLLoader.load(getClass().getResource("../ressources/jouerSonTour5.fxml"));
|
/*//si le lieu fait attaquer ou se soigner
|
||||||
//rootPane.getChildren().setAll(pane);
|
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);
|
||||||
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -26,6 +26,7 @@ public class JouerSonTour3Controller implements Initializable{
|
|||||||
rootPane.getChildren().setAll(pane);
|
rootPane.getChildren().setAll(pane);
|
||||||
|
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
public void pasAttaquer(MouseEvent mouseEvent) throws IOException{
|
public void pasAttaquer(MouseEvent mouseEvent) throws IOException{
|
||||||
Stage appStage = (Stage) ((Node) mouseEvent.getSource()).getScene().getWindow();
|
Stage appStage = (Stage) ((Node) mouseEvent.getSource()).getScene().getWindow();
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
<font>
|
<font>
|
||||||
<Font size="64.0" />
|
<Font size="64.0" />
|
||||||
</font></Label>
|
</font></Label>
|
||||||
<Label layoutX="405.0" layoutY="29.0" text="joueur 1">
|
<Label fx:id="nomJoueur" layoutX="405.0" layoutY="29.0" text="joueur 1">
|
||||||
<font>
|
<font>
|
||||||
<Font size="36.0" />
|
<Font size="36.0" />
|
||||||
</font>
|
</font>
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
<Pane fx:id="rootPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="480.0" prefWidth="640.0" stylesheets="@style/popUp.css" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ihm.controller.JouerSonTour2Controller">
|
<Pane fx:id="rootPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="480.0" prefWidth="640.0" stylesheets="@style/popUp.css" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ihm.controller.JouerSonTour2Controller">
|
||||||
<children>
|
<children>
|
||||||
<Label layoutX="315.0" layoutY="151.0" text="Description capacité de la carte lieux ">
|
<Label fx:id="descriptionLieu" layoutX="315.0" layoutY="151.0" text="Description capacité de la carte lieux ">
|
||||||
<font>
|
<font>
|
||||||
<Font size="18.0" />
|
<Font size="18.0" />
|
||||||
</font>
|
</font>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user