prise en compte des pions
This commit is contained in:
parent
8042514def
commit
b293b3ed01
@ -15,7 +15,7 @@ public class Main extends Application {
|
||||
public void start(Stage primaryStage) throws Exception {
|
||||
System.out.println("Lancement de l'application");
|
||||
|
||||
final URL fxmlURL = getClass().getResource("ressources/parametre.fxml"); // "ressources/Jouer_tour(1)lancer_des.fxml"
|
||||
final URL fxmlURL = getClass().getResource("ressources/Menu.fxml"); // "ressources/Jouer_tour(1)lancer_des.fxml"
|
||||
final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", Locale.ENGLISH);
|
||||
final FXMLLoader fxmlLoader = new FXMLLoader(fxmlURL, bundle);
|
||||
Pane root = fxmlLoader.load();
|
||||
|
@ -2,6 +2,7 @@ package ihm.controller;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.util.Locale;
|
||||
import java.util.Random;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
@ -34,6 +35,8 @@ public class JouerSonTour1Controller implements Initializable{
|
||||
|
||||
@Override
|
||||
public void initialize(URL arg0, ResourceBundle arg1) {
|
||||
System.out.println("\tLancements des dès");
|
||||
|
||||
//nomJoueur.setText(joueur.getNom());
|
||||
|
||||
int OFFSET_X = 0;
|
||||
@ -80,12 +83,11 @@ public class JouerSonTour1Controller implements Initializable{
|
||||
|
||||
@FXML
|
||||
public void lancerDes(MouseEvent mouseEvent) throws IOException, InterruptedException{
|
||||
|
||||
|
||||
Thread.sleep(1000);
|
||||
|
||||
Pane pane = FXMLLoader.load(getClass().getResource("../ressources/Jouer_tour(2)carte_lieux.fxml"));
|
||||
rootPane.getChildren().setAll(pane);
|
||||
final URL fxmlURL = getClass().getResource("../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);
|
||||
}
|
||||
|
||||
public void deplacerPion(CarteLieu lieux) {
|
||||
|
@ -21,6 +21,7 @@ public class JouerSonTour2Controller implements Initializable{
|
||||
|
||||
@Override
|
||||
public void initialize(URL arg0, ResourceBundle arg1) {
|
||||
System.out.println("\tDescrption du lieux");
|
||||
//descriptionLieu.setText(lieu.getDescription());
|
||||
}
|
||||
|
||||
|
@ -22,17 +22,12 @@ import javafx.scene.layout.AnchorPane;
|
||||
import javafx.scene.layout.HBox;
|
||||
import javafx.scene.layout.Pane;
|
||||
import javafx.scene.layout.VBox;
|
||||
import javafx.scene.shape.Circle;
|
||||
import main.Joueur;
|
||||
import main.View;
|
||||
|
||||
public class PlateauController implements Initializable {
|
||||
private List<Joueur> listJoueur = new ArrayList<Joueur>();
|
||||
private List<VBox> vboxJoueur = new ArrayList<VBox>();
|
||||
private List<HBox> hboxJoueur = new ArrayList<HBox>();
|
||||
private List<Button> btnRevelation = new ArrayList<Button>();
|
||||
private List<ImageView> cartePerso = new ArrayList<ImageView>();
|
||||
private List<Label> nomJoueur = new ArrayList<Label>();
|
||||
private List<AnchorPane> tour = new ArrayList<AnchorPane>();
|
||||
|
||||
@FXML private HBox joueur1;
|
||||
@FXML private HBox joueur2;
|
||||
@ -43,6 +38,19 @@ public class PlateauController implements Initializable {
|
||||
@FXML private VBox joueur7;
|
||||
@FXML private VBox joueur8;
|
||||
|
||||
private List<VBox> vboxJoueur = new ArrayList<VBox>();
|
||||
private List<HBox> hboxJoueur = new ArrayList<HBox>();
|
||||
private List<Button> btnRevelation = new ArrayList<Button>();
|
||||
private List<ImageView> cartePerso = new ArrayList<ImageView>();
|
||||
private List<Label> nomJoueur = new ArrayList<Label>();
|
||||
private List<AnchorPane> tour = new ArrayList<AnchorPane>();
|
||||
|
||||
@FXML private HBox lieux;
|
||||
@FXML private HBox vie;
|
||||
|
||||
private List<Circle> pionLieux = new ArrayList<Circle>();
|
||||
private List<Circle> pionVie = new ArrayList<Circle>();
|
||||
|
||||
public static int DICE_SIX = 2;
|
||||
public static int DICE_QUATRE = 1;
|
||||
public static int DICE_BOTH = 0;
|
||||
@ -53,8 +61,8 @@ public class PlateauController implements Initializable {
|
||||
@Override
|
||||
public void initialize(URL arg0, ResourceBundle arg1) {
|
||||
System.out.println("Création du plateau ...");
|
||||
//initialisation des attributs des joueurs
|
||||
|
||||
//initialisation des attributs des joueurs
|
||||
this.hboxJoueur.add(joueur1);
|
||||
this.hboxJoueur.add(joueur2);
|
||||
this.hboxJoueur.add(joueur3);
|
||||
@ -100,18 +108,39 @@ public class PlateauController implements Initializable {
|
||||
}
|
||||
|
||||
|
||||
//initialisation des pions
|
||||
VBox pionLieux14 = (VBox) lieux.getChildren().get(0);
|
||||
VBox pionLieux58 = (VBox) lieux.getChildren().get(4);
|
||||
for (int k=0; k<4; k++) {
|
||||
pionLieux.add((Circle) pionLieux14.getChildren().get(k));
|
||||
}
|
||||
for (int k=0; k<4; k++) {
|
||||
pionLieux.add((Circle) pionLieux58.getChildren().get(k));
|
||||
}
|
||||
|
||||
VBox pionVie14 = (VBox) lieux.getChildren().get(0);
|
||||
VBox pionVie58 = (VBox) lieux.getChildren().get(4);
|
||||
for (int k=0; k<4; k++) {
|
||||
pionVie.add((Circle) pionVie14.getChildren().get(k));
|
||||
}
|
||||
for (int k=0; k<4; k++) {
|
||||
pionVie.add((Circle) pionVie58.getChildren().get(k));
|
||||
}
|
||||
|
||||
System.out.println("Tour du joueur 1");
|
||||
try {
|
||||
final URL fxmlURL = getClass().getResource("../ressources/Jouer_tour(1)lancer_des.fxml");
|
||||
final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", Locale.ENGLISH);
|
||||
final FXMLLoader fxmlLoader = new FXMLLoader(fxmlURL, bundle);
|
||||
Pane root = fxmlLoader.load();
|
||||
root.setPrefSize(255, 180);
|
||||
tour.get(0).getChildren().setAll(root);
|
||||
tour.get(2).getChildren().setAll(root);
|
||||
} catch (IOException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
listJoueur = View.getJoueurs();
|
||||
}
|
||||
|
||||
@ -169,7 +198,7 @@ public class PlateauController implements Initializable {
|
||||
* @param j : map donnant le joueur et son numero
|
||||
*/
|
||||
public void showInformation(Map<Integer, Joueur> j) {
|
||||
System.out.println("\tplacement des joueurs");
|
||||
System.out.println("\tPlacement des joueurs");
|
||||
int taille = this.vboxJoueur.size() + this.hboxJoueur.size();
|
||||
|
||||
for (int i=0; i<taille; i++) {
|
||||
|
@ -3,24 +3,24 @@
|
||||
<?import javafx.scene.control.Button?>
|
||||
<?import javafx.scene.control.Label?>
|
||||
<?import javafx.scene.image.ImageView?>
|
||||
<?import javafx.scene.layout.AnchorPane?>
|
||||
<?import javafx.scene.layout.Pane?>
|
||||
<?import javafx.scene.text.Font?>
|
||||
|
||||
<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">
|
||||
|
||||
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="180.0" prefWidth="255.0" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ihm.controller.JouerSonTour2Controller">
|
||||
<children>
|
||||
<Label fx:id="descriptionLieu" layoutX="315.0" layoutY="151.0" text="%description.capacite.carte.lieux">
|
||||
<Pane fx:id="rootPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="180.0" prefWidth="255.0" stylesheets="@style/popUp.css">
|
||||
<children>
|
||||
<Button layoutX="112.0" layoutY="128.0" mnemonicParsing="false" onMouseClicked="#capaciteLieu" text="%utiliser.capaciter.lieux" />
|
||||
<Button layoutX="136.0" layoutY="90.0" mnemonicParsing="false" onMouseClicked="#ignorerEtape" text="%sauter.etape" />
|
||||
<ImageView fitHeight="114.0" fitWidth="82.0" layoutX="14.0" layoutY="33.0" pickOnBounds="true" preserveRatio="true" />
|
||||
<Label fx:id="descriptionLieu" layoutX="96.0" layoutY="33.0" text="%description.capacite.carte.lieux">
|
||||
<font>
|
||||
<Font size="18.0" />
|
||||
<Font size="11.0" />
|
||||
</font>
|
||||
</Label>
|
||||
<Button layoutX="356.0" layoutY="227.0" mnemonicParsing="false" onMouseClicked="#capaciteLieu" text="%utiliser.capaciter.lieux">
|
||||
<font>
|
||||
<Font size="18.0" />
|
||||
</font></Button>
|
||||
<Button layoutX="389.0" layoutY="307.0" mnemonicParsing="false" onMouseClicked="#ignorerEtape" text="%sauter.etape">
|
||||
<font>
|
||||
<Font size="18.0" />
|
||||
</font></Button>
|
||||
<ImageView fitHeight="326.0" fitWidth="233.5" layoutX="64.0" layoutY="84.0" pickOnBounds="true" preserveRatio="true" />
|
||||
</children>
|
||||
</Pane>
|
||||
</Pane>
|
||||
</children>
|
||||
</AnchorPane>
|
||||
|
@ -288,7 +288,7 @@
|
||||
</VBox>
|
||||
</left>
|
||||
<right>
|
||||
<VBox alignment="CENTER_RIGHT" prefHeight="854.0" prefWidth="436.0" BorderPane.alignment="CENTER">
|
||||
<VBox alignment="CENTER_RIGHT" prefHeight="864.0" prefWidth="444.0" BorderPane.alignment="CENTER">
|
||||
<children>
|
||||
<VBox fx:id="joueur7" alignment="CENTER" prefHeight="285.0" prefWidth="445.0" rotate="270.0">
|
||||
<children>
|
||||
@ -374,7 +374,7 @@
|
||||
</VBox>
|
||||
</right>
|
||||
<center>
|
||||
<HBox alignment="CENTER" prefHeight="720.0" prefWidth="1036.0" BorderPane.alignment="CENTER">
|
||||
<HBox alignment="CENTER" prefHeight="720.0" prefWidth="1078.0" BorderPane.alignment="CENTER">
|
||||
<children>
|
||||
<VBox alignment="CENTER_LEFT" prefWidth="22.0">
|
||||
<children>
|
||||
@ -409,7 +409,7 @@
|
||||
</VBox>
|
||||
<VBox alignment="CENTER" prefHeight="496.0" prefWidth="739.0">
|
||||
<children>
|
||||
<HBox alignment="TOP_CENTER" prefHeight="339.0" prefWidth="676.0">
|
||||
<HBox fx:id="lieux" alignment="TOP_CENTER" prefHeight="339.0" prefWidth="676.0">
|
||||
<children>
|
||||
<VBox alignment="CENTER" prefHeight="223.0" prefWidth="0.0">
|
||||
<children>
|
||||
@ -468,7 +468,7 @@
|
||||
</VBox>
|
||||
</children>
|
||||
</HBox>
|
||||
<VBox alignment="BOTTOM_CENTER" prefHeight="200.0" prefWidth="100.0">
|
||||
<VBox alignment="BOTTOM_CENTER" prefHeight="200.0" prefWidth="771.0">
|
||||
<children>
|
||||
<HBox alignment="CENTER_RIGHT" prefHeight="60.0" prefWidth="671.0">
|
||||
<children>
|
||||
@ -500,7 +500,7 @@
|
||||
</VBox>
|
||||
</children>
|
||||
</HBox>
|
||||
<HBox prefHeight="58.0" prefWidth="655.0">
|
||||
<HBox fx:id="vie" prefHeight="58.0" prefWidth="655.0">
|
||||
<children>
|
||||
<HBox prefHeight="100.0" prefWidth="0.0" />
|
||||
<HBox alignment="CENTER" prefHeight="64.0" prefWidth="50.0" stylesheets="@style/plateau.css">
|
||||
|
Loading…
x
Reference in New Issue
Block a user