PlateauController et JoueurIHM
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
package ihm.controller;
|
||||
|
||||
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 main.Joueur;
|
||||
|
||||
@@ -10,11 +14,57 @@ public class JoueurIHM {
|
||||
private Pane pane;
|
||||
|
||||
public JoueurIHM(int i, Joueur joueur, Pane pane) {
|
||||
this.position = i;
|
||||
this.joueur = joueur;
|
||||
this.setPosition(i);
|
||||
this.setJoueur(joueur);
|
||||
this.pane = pane;
|
||||
|
||||
String name = joueur.getNom();
|
||||
setLabelJoueur(name);
|
||||
}
|
||||
|
||||
|
||||
public Button getRevealButton() {
|
||||
Pane p = (Pane) pane.getChildren().get(1);
|
||||
return (Button) p.getChildren().get(1);
|
||||
}
|
||||
|
||||
public ImageView getCartePersonnage() {
|
||||
Pane p = (Pane) pane.getChildren().get(1);
|
||||
return (ImageView) p.getChildren().get(0);
|
||||
}
|
||||
|
||||
public AnchorPane getZoneJoueur() {
|
||||
return (AnchorPane) pane.getChildren().get(0);
|
||||
}
|
||||
|
||||
public Label getLabelJoueur() {
|
||||
Pane p = (Pane) pane.getChildren().get(2);
|
||||
return (Label) p.getChildren().get(0);
|
||||
}
|
||||
|
||||
public void setLabelJoueur(String name) {
|
||||
Label label = getLabelJoueur();
|
||||
label.setText(name);
|
||||
}
|
||||
|
||||
public Label getPaneEquipement() {
|
||||
Pane p = (Pane) pane.getChildren().get(2);
|
||||
return (Label) p.getChildren().get(1);
|
||||
}
|
||||
|
||||
public int getPosition() {
|
||||
return position;
|
||||
}
|
||||
|
||||
public void setPosition(int position) {
|
||||
this.position = position;
|
||||
}
|
||||
|
||||
public Joueur getJoueur() {
|
||||
return joueur;
|
||||
}
|
||||
|
||||
public void setJoueur(Joueur joueur) {
|
||||
this.joueur = joueur;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -67,7 +67,7 @@ public class PlateauController implements Initializable {
|
||||
*/
|
||||
@Override
|
||||
public void initialize(URL arg0, ResourceBundle arg1) {
|
||||
System.out.println("Création du plateau ...");
|
||||
//System.out.println("Création du plateau ...");
|
||||
|
||||
this.joueursIHM = new ArrayList<JoueurIHM>();
|
||||
|
||||
@@ -81,6 +81,7 @@ public class PlateauController implements Initializable {
|
||||
|
||||
//System.out.println(this.joueursPane);
|
||||
|
||||
|
||||
this.hboxJoueur.add(joueur1);
|
||||
this.hboxJoueur.add(joueur2);
|
||||
this.hboxJoueur.add(joueur3);
|
||||
@@ -158,7 +159,7 @@ public class PlateauController implements Initializable {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private Pane getPaneJoueur(int i) {
|
||||
|
Reference in New Issue
Block a user