Bouton des joueurs morts desactive (à finir)
This commit is contained in:
@ -1,22 +1,60 @@
|
||||
package ihm.controller;
|
||||
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
import carte.CarteEquipement;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.fxml.Initializable;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.layout.HBox;
|
||||
import main.Joueur;
|
||||
import main.Plateau;
|
||||
|
||||
public class ChoisirJoueur implements Initializable{
|
||||
@FXML private HBox joueurHaut;
|
||||
@FXML private HBox joueurBas;
|
||||
@FXML private Label titre;
|
||||
/* @FXML private Button btn1;
|
||||
@FXML private Button btn2;
|
||||
@FXML private Button btn3;
|
||||
@FXML private Button btn4;
|
||||
@FXML private Button btn5;
|
||||
@FXML private Button btn6;
|
||||
@FXML private Button btn7;
|
||||
@FXML private Button btn8;
|
||||
*/
|
||||
|
||||
|
||||
|
||||
private int joueurSelected;
|
||||
private List<Joueur> joueurs = Plateau.jselectionne;
|
||||
|
||||
@Override
|
||||
public void initialize(URL arg0, ResourceBundle arg1) {
|
||||
/* List<Button> buttons = new ArrayList();
|
||||
buttons.add(btn1);
|
||||
buttons.add(btn2);
|
||||
buttons.add(btn3);
|
||||
buttons.add(btn4);
|
||||
buttons.add(btn5);
|
||||
buttons.add(btn6);
|
||||
buttons.add(btn7);
|
||||
buttons.add(btn8);
|
||||
if(8-joueurs.size()>0) {
|
||||
for(int i=0;i<8-joueurs.size();i++) {
|
||||
buttons.get(buttons.size()-1-i).setVisible(false);
|
||||
}
|
||||
for(int i=0;i<joueurs.size();i++) {
|
||||
buttons.get(i).setText(joueurs.get(i).getNom());
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
|
||||
for (int i=0; i<joueurHaut.getChildren().size(); i++) {
|
||||
int numJoueur = i;
|
||||
joueurHaut.getChildren().get(i).setOnMouseClicked(e -> {
|
||||
@ -31,7 +69,7 @@ public class ChoisirJoueur implements Initializable{
|
||||
System.out.println("Vous avez choisi le joueur " + (numJoueur+1));
|
||||
this.joueurSelected = numJoueur;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//GETTERS AND SETTERS
|
||||
@ -66,4 +104,12 @@ public class ChoisirJoueur implements Initializable{
|
||||
public void setJoueurSelected(int joueurSelected) {
|
||||
this.joueurSelected = joueurSelected;
|
||||
}
|
||||
|
||||
public List<Joueur> getJoueur() {
|
||||
return joueurs;
|
||||
}
|
||||
|
||||
public void setJoueur(List<Joueur> joueur) {
|
||||
this.joueurs = joueur;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user