controller piocher et lancer des

This commit is contained in:
Chiara 2020-05-06 15:24:39 +02:00
parent 624e12135f
commit 34e3690ba9
2 changed files with 125 additions and 0 deletions

View File

@ -0,0 +1,40 @@
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 main.Type;
import main.TypeLumiere;
import main.TypeTenebre;
import main.TypeVision;
public class PiocherCarte implements Initializable{
@FXML private Button lumiere;
@FXML private Button vision;
@FXML private Button tenebre;
private Type carte;
@Override
public void initialize(URL arg0, ResourceBundle arg1) {
lumiere.setOnAction(e ->{
carte = new TypeLumiere();
});
vision.setOnAction(e -> {
carte = new TypeVision();
});
tenebre.setOnAction(e -> {
carte = new TypeTenebre();
});
}
public Type getCarte() {
return carte;
}
}

View File

@ -0,0 +1,85 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.Pane?>
<?import javafx.scene.text.Font?>
<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.ChoisirJoueur">
<children>
<Pane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="180.0" prefWidth="255.0" stylesheets="@style/popUp.css">
<children>
<HBox fx:id="joueurHaut" layoutX="4.0" layoutY="14.0">
<children>
<Button mnemonicParsing="false" text="%joueur1">
<font>
<Font size="10.0" />
</font>
</Button>
<Button mnemonicParsing="false" text="%joueur2">
<font>
<Font size="10.0" />
</font>
<HBox.margin>
<Insets left="2.0" />
</HBox.margin>
</Button>
<Button mnemonicParsing="false" text="%joueur3">
<font>
<Font size="10.0" />
</font>
<HBox.margin>
<Insets left="2.0" />
</HBox.margin>
</Button>
<Button mnemonicParsing="false" text="%joueur4">
<font>
<Font size="10.0" />
</font>
<HBox.margin>
<Insets left="2.0" />
</HBox.margin>
</Button>
</children>
</HBox>
<HBox fx:id="joueurBas" layoutX="4.0" layoutY="139.0">
<children>
<Button mnemonicParsing="false" text="%joueur5">
<font>
<Font size="10.0" />
</font>
<HBox.margin>
<Insets right="2.0" />
</HBox.margin>
</Button>
<Button mnemonicParsing="false" text="%joueur6">
<font>
<Font size="10.0" />
</font>
<HBox.margin>
<Insets right="2.0" />
</HBox.margin>
</Button>
<Button mnemonicParsing="false" text="%joueur7">
<font>
<Font size="10.0" />
</font>
<HBox.margin>
<Insets right="2.0" />
</HBox.margin>
</Button>
<Button mnemonicParsing="false" text="%joueur8">
<font>
<Font size="10.0" />
</font>
</Button>
</children>
</HBox>
<Label fx:id="titre" layoutX="50.0" layoutY="82.0" text="Choisir un joueur à attaquer !" />
</children>
</Pane>
</children>
</AnchorPane>