lancer des
This commit is contained in:
commit
d61a12324f
@ -17,6 +17,7 @@ public abstract class CarteEquipement extends CartePiochable{
|
|||||||
super(t, effet);
|
super(t, effet);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void utiliser(Joueur j) {
|
public void utiliser(Joueur j) {
|
||||||
if(!j.getEquipements().contains(this)) {
|
if(!j.getEquipements().contains(this)) {
|
||||||
j.ajouterEquipement(this);
|
j.ajouterEquipement(this);
|
||||||
|
@ -4,6 +4,7 @@ import java.io.Serializable;
|
|||||||
|
|
||||||
import condition.Condition;
|
import condition.Condition;
|
||||||
import effet.Effet;
|
import effet.Effet;
|
||||||
|
import main.GestionnaireJeu;
|
||||||
import main.Joueur;
|
import main.Joueur;
|
||||||
|
|
||||||
public class CartePiochable extends CarteCondition implements Serializable{
|
public class CartePiochable extends CarteCondition implements Serializable{
|
||||||
@ -41,6 +42,8 @@ public class CartePiochable extends CarteCondition implements Serializable{
|
|||||||
* @param j Appel la méthode utiliser de effet sur le joueur j
|
* @param j Appel la méthode utiliser de effet sur le joueur j
|
||||||
*/
|
*/
|
||||||
public void utiliser(Joueur j) {
|
public void utiliser(Joueur j) {
|
||||||
|
GestionnaireJeu gj = GestionnaireJeu.getGestionnaireJeu();
|
||||||
|
gj.piocher(j,this);
|
||||||
System.out.println("CartePiochable "+this + " Condition : "+this.getCondition()+" Effet : "+this.getEffet()+" Action : "+this.getEffet().getAction());
|
System.out.println("CartePiochable "+this + " Condition : "+this.getCondition()+" Effet : "+this.getEffet()+" Action : "+this.getEffet().getAction());
|
||||||
super.utiliser(j);
|
super.utiliser(j);
|
||||||
}
|
}
|
||||||
|
@ -62,6 +62,15 @@ public class PopUp{
|
|||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Stage getStage() {
|
||||||
|
return popup;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Scene getScene() {
|
||||||
|
return scene;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public void display() {
|
public void display() {
|
||||||
|
|
||||||
|
@ -42,7 +42,6 @@ public class ChoisirJoueur implements Initializable{
|
|||||||
this.buttons.add(btn6);
|
this.buttons.add(btn6);
|
||||||
this.buttons.add(btn7);
|
this.buttons.add(btn7);
|
||||||
this.buttons.add(btn8);
|
this.buttons.add(btn8);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void initButtons() {
|
public void initButtons() {
|
||||||
|
28
src/ihm/controller/Dialog.java
Normal file
28
src/ihm/controller/Dialog.java
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
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 javafx.scene.control.Label;
|
||||||
|
import main.GestionnaireJeu;
|
||||||
|
|
||||||
|
public class Dialog implements Initializable {
|
||||||
|
@FXML private Button button;
|
||||||
|
@FXML private Label label;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void initialize(URL arg0, ResourceBundle arg1) {
|
||||||
|
|
||||||
|
button.setOnAction(x -> {
|
||||||
|
GestionnaireJeu.notifyPlateau();
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setText(String text) {
|
||||||
|
this.label.setText(text);
|
||||||
|
}
|
||||||
|
}
|
@ -46,10 +46,13 @@ public class MenuController implements Initializable{
|
|||||||
AnchorPane pane = fxmlLoader.load();
|
AnchorPane pane = fxmlLoader.load();
|
||||||
Scene scene = new Scene(pane);
|
Scene scene = new Scene(pane);
|
||||||
Stage appStage = (Stage) ((Node) mouseEvent.getSource()).getScene().getWindow();
|
Stage appStage = (Stage) ((Node) mouseEvent.getSource()).getScene().getWindow();
|
||||||
appStage.setScene(scene);
|
|
||||||
appStage.show();
|
|
||||||
|
|
||||||
|
double width = appStage.getWidth();
|
||||||
|
double height = appStage.getHeight();
|
||||||
|
double X = appStage.getX();
|
||||||
|
double Y = appStage.getY();
|
||||||
|
|
||||||
|
appStage.setScene(scene);
|
||||||
}
|
}
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
@ -70,7 +73,7 @@ public class MenuController implements Initializable{
|
|||||||
@FXML
|
@FXML
|
||||||
public void quitterLappli(MouseEvent mouseEvent) throws IOException{
|
public void quitterLappli(MouseEvent mouseEvent) throws IOException{
|
||||||
System.exit(0);
|
System.exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
|
@ -7,21 +7,16 @@ import javafx.fxml.FXML;
|
|||||||
import javafx.fxml.Initializable;
|
import javafx.fxml.Initializable;
|
||||||
import javafx.scene.control.Button;
|
import javafx.scene.control.Button;
|
||||||
|
|
||||||
import main.Type;
|
|
||||||
import main.TypeLumiere;
|
|
||||||
import main.TypeTenebre;
|
|
||||||
import main.TypeVision;
|
|
||||||
|
|
||||||
public class PiocherCarte implements Initializable{
|
public class PiocherCarte implements Initializable{
|
||||||
@FXML private Button lumiere;
|
@FXML private Button lumiere;
|
||||||
@FXML private Button vision;
|
@FXML private Button vision;
|
||||||
@FXML private Button tenebre;
|
@FXML private Button tenebre;
|
||||||
|
|
||||||
private Type carte;
|
//private Type carte;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initialize(URL arg0, ResourceBundle arg1) {
|
public void initialize(URL arg0, ResourceBundle arg1) {
|
||||||
lumiere.setOnAction(e ->{
|
/*lumiere.setOnAction(e ->{
|
||||||
carte = new TypeLumiere();
|
carte = new TypeLumiere();
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -31,10 +26,10 @@ public class PiocherCarte implements Initializable{
|
|||||||
|
|
||||||
tenebre.setOnAction(e -> {
|
tenebre.setOnAction(e -> {
|
||||||
carte = new TypeTenebre();
|
carte = new TypeTenebre();
|
||||||
});
|
});*/
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
public Type getCarte() {
|
public Type getCarte() {
|
||||||
return carte;
|
return carte;
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
@ -15,6 +15,8 @@ import java.util.Set;
|
|||||||
import carte.Carte;
|
import carte.Carte;
|
||||||
import carte.CarteEquipement;
|
import carte.CarteEquipement;
|
||||||
import carte.CarteLieu;
|
import carte.CarteLieu;
|
||||||
|
import carte.CartePiochable;
|
||||||
|
import carte.CartePiochable.Type;
|
||||||
import database.RessourceLoader;
|
import database.RessourceLoader;
|
||||||
import ihm.EffetSonore;
|
import ihm.EffetSonore;
|
||||||
import ihm.PopUp;
|
import ihm.PopUp;
|
||||||
@ -25,6 +27,7 @@ import javafx.fxml.FXMLLoader;
|
|||||||
import javafx.fxml.Initializable;
|
import javafx.fxml.Initializable;
|
||||||
import javafx.scene.Group;
|
import javafx.scene.Group;
|
||||||
import javafx.scene.Parent;
|
import javafx.scene.Parent;
|
||||||
|
import javafx.scene.control.Button;
|
||||||
import javafx.scene.control.Label;
|
import javafx.scene.control.Label;
|
||||||
import javafx.scene.image.Image;
|
import javafx.scene.image.Image;
|
||||||
import javafx.scene.image.ImageView;
|
import javafx.scene.image.ImageView;
|
||||||
@ -36,6 +39,7 @@ import javafx.scene.layout.Pane;
|
|||||||
import javafx.scene.layout.StackPane;
|
import javafx.scene.layout.StackPane;
|
||||||
import javafx.scene.layout.VBox;
|
import javafx.scene.layout.VBox;
|
||||||
import javafx.scene.paint.Color;
|
import javafx.scene.paint.Color;
|
||||||
|
import javafx.scene.transform.Rotate;
|
||||||
import javafx.util.Duration;
|
import javafx.util.Duration;
|
||||||
import main.Contexte;
|
import main.Contexte;
|
||||||
import main.GestionnaireJeu;
|
import main.GestionnaireJeu;
|
||||||
@ -58,6 +62,8 @@ public class PlateauController implements Initializable {
|
|||||||
|
|
||||||
|
|
||||||
private Map<Carte,BufferedImage> mapRessourcesCartes;
|
private Map<Carte,BufferedImage> mapRessourcesCartes;
|
||||||
|
private Map<String,BufferedImage> mapRessourcesDosCartes;
|
||||||
|
|
||||||
public static int DICE_SIX = 2;
|
public static int DICE_SIX = 2;
|
||||||
public static int DICE_QUATRE = 1;
|
public static int DICE_QUATRE = 1;
|
||||||
public static int DICE_BOTH = 0;
|
public static int DICE_BOTH = 0;
|
||||||
@ -94,6 +100,7 @@ public class PlateauController implements Initializable {
|
|||||||
|
|
||||||
|
|
||||||
mapRessourcesCartes = rl.getRessourceCartes();
|
mapRessourcesCartes = rl.getRessourceCartes();
|
||||||
|
setMapRessourcesDosCartes(rl.getRessourceDosCartes());
|
||||||
|
|
||||||
List<CarteLieu> cl = gj.getCartesLieux();
|
List<CarteLieu> cl = gj.getCartesLieux();
|
||||||
List<ImageView> ivs = this.getLieux();
|
List<ImageView> ivs = this.getLieux();
|
||||||
@ -202,8 +209,6 @@ public class PlateauController implements Initializable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void applyImageLieu(ImageView iv, Image im) {
|
private void applyImageLieu(ImageView iv, Image im) {
|
||||||
|
|
||||||
StackPane sp = (StackPane) iv.getParent();
|
StackPane sp = (StackPane) iv.getParent();
|
||||||
@ -427,7 +432,6 @@ public class PlateauController implements Initializable {
|
|||||||
public void updateVieJoueur(Joueur joueur, int damage) {
|
public void updateVieJoueur(Joueur joueur, int damage) {
|
||||||
JoueurIHM jIHM = getJoueurIHM(joueur);
|
JoueurIHM jIHM = getJoueurIHM(joueur);
|
||||||
jIHM.deplacerPionVie(damage);
|
jIHM.deplacerPionVie(damage);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
@ -468,7 +472,6 @@ public class PlateauController implements Initializable {
|
|||||||
public void close () throws IOException {
|
public void close () throws IOException {
|
||||||
final URL fxmlURL = PlateauController.class.getResource("/ihm/ressources/Menu.fxml");
|
final URL fxmlURL = PlateauController.class.getResource("/ihm/ressources/Menu.fxml");
|
||||||
final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", Locale.FRANCE);
|
final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", Locale.FRANCE);
|
||||||
|
|
||||||
final FXMLLoader fxmlLoader = new FXMLLoader(fxmlURL, bundle);
|
final FXMLLoader fxmlLoader = new FXMLLoader(fxmlURL, bundle);
|
||||||
Pane pane = fxmlLoader.load();
|
Pane pane = fxmlLoader.load();
|
||||||
rootPane.getChildren().setAll(pane);
|
rootPane.getChildren().setAll(pane);
|
||||||
@ -487,6 +490,50 @@ public class PlateauController implements Initializable {
|
|||||||
public void afficherLancerDes(Joueur j, Contexte c) throws IOException {
|
public void afficherLancerDes(Joueur j, Contexte c) throws IOException {
|
||||||
this.ld=new LancerDes(c);
|
this.ld=new LancerDes(c);
|
||||||
JoueurIHM jihm = getJoueurIHM(j);
|
JoueurIHM jihm = getJoueurIHM(j);
|
||||||
jihm.setZoneJoueur(ld.initLancer());
|
jihm.setZoneJoueur(ld.initLancer());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void afficherLT(Joueur j, CartePiochable cartePiochable) throws IOException {
|
||||||
|
|
||||||
|
Image i = getImageCarte(cartePiochable);
|
||||||
|
ImageView iv = new ImageView(i);
|
||||||
|
Pane p = new Pane(iv);
|
||||||
|
PopUp pu = new PopUp(p,"Image");
|
||||||
|
pu.getStage().focusedProperty().addListener((obs,wasFocused,isNowFocused) -> {
|
||||||
|
|
||||||
|
if(!isNowFocused) {
|
||||||
|
GestionnaireJeu.notifyPlateau();
|
||||||
|
pu.getStage().hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
pu.display();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void afficherVision(Joueur j, CartePiochable cartePiochable) throws IOException {
|
||||||
|
|
||||||
|
final URL fxmlURL = getClass().getResource("/ihm/ressources/RecevoirCarte.fxml");
|
||||||
|
final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", Locale.FRANCE);
|
||||||
|
final FXMLLoader fxmlLoader = new FXMLLoader(fxmlURL, bundle);
|
||||||
|
Pane root = (Pane)fxmlLoader.load();
|
||||||
|
RecevoirCarte lzj = fxmlLoader.getController();
|
||||||
|
Image im = getImageCarte(cartePiochable);
|
||||||
|
lzj.setImageView(im);
|
||||||
|
lzj.setText("Cachez la carte vision");
|
||||||
|
JoueurIHM jihm = getJoueurIHM(j);
|
||||||
|
jihm.setZoneJoueur(root);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public Map<String,BufferedImage> getMapRessourcesDosCartes() {
|
||||||
|
return mapRessourcesDosCartes;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void setMapRessourcesDosCartes(Map<String,BufferedImage> mapRessourcesDosCartes) {
|
||||||
|
this.mapRessourcesDosCartes = mapRessourcesDosCartes;
|
||||||
}
|
}
|
||||||
}
|
}
|
36
src/ihm/controller/RecevoirCarte.java
Normal file
36
src/ihm/controller/RecevoirCarte.java
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
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 javafx.scene.control.Label;
|
||||||
|
import javafx.scene.image.Image;
|
||||||
|
import javafx.scene.image.ImageView;
|
||||||
|
import main.GestionnaireJeu;
|
||||||
|
|
||||||
|
public class RecevoirCarte implements Initializable {
|
||||||
|
@FXML private Button okButton;
|
||||||
|
@FXML private Label label;
|
||||||
|
@FXML private ImageView imageView;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void initialize(URL arg0, ResourceBundle arg1) {
|
||||||
|
|
||||||
|
okButton.setOnAction(x -> {
|
||||||
|
GestionnaireJeu.notifyPlateau();
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setText(String name) {
|
||||||
|
this.label.setText(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setImageView(Image imageCarte) {
|
||||||
|
this.imageView.setImage(imageCarte);
|
||||||
|
}
|
||||||
|
}
|
@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
<AnchorPane fx:id="rootPane" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ihm.controller.PlayersController">
|
<AnchorPane fx:id="rootPane" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ihm.controller.PlayersController">
|
||||||
<children>
|
<children>
|
||||||
<BorderPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="800.0" prefWidth="1280.0" styleClass="background" stylesheets="@style/menu.css" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
<BorderPane styleClass="background" stylesheets="@style/menu.css" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||||
<left>
|
<left>
|
||||||
<VBox alignment="CENTER" prefHeight="688.0" prefWidth="240.0" BorderPane.alignment="CENTER">
|
<VBox alignment="CENTER" prefHeight="688.0" prefWidth="240.0" BorderPane.alignment="CENTER">
|
||||||
<children>
|
<children>
|
||||||
@ -164,7 +164,7 @@
|
|||||||
<Insets top="20.0" />
|
<Insets top="20.0" />
|
||||||
</VBox.margin>
|
</VBox.margin>
|
||||||
</Button>
|
</Button>
|
||||||
<Button layoutX="283.0" layoutY="379.0" mnemonicParsing="false" onMouseClicked="#retour" prefHeight="55.0" prefWidth="247.0" styleClass="bouton" stylesheets="@style/menu.css" text="retour">
|
<Button layoutX="283.0" layoutY="379.0" mnemonicParsing="false" onMouseClicked="#retour" prefHeight="55.0" prefWidth="247.0" styleClass="bouton" stylesheets="@style/menu.css" text="Retour">
|
||||||
<font>
|
<font>
|
||||||
<Font size="24.0" />
|
<Font size="24.0" />
|
||||||
</font>
|
</font>
|
||||||
|
@ -8,14 +8,13 @@
|
|||||||
<?import javafx.scene.layout.VBox?>
|
<?import javafx.scene.layout.VBox?>
|
||||||
<?import javafx.scene.text.Font?>
|
<?import javafx.scene.text.Font?>
|
||||||
|
|
||||||
|
|
||||||
<AnchorPane xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ihm.controller.LieuZJ">
|
<AnchorPane xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ihm.controller.LieuZJ">
|
||||||
<children>
|
<children>
|
||||||
<SplitPane dividerPositions="0.6212121212121212" styleClass="background" stylesheets="@style/plateau.css" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
<SplitPane dividerPositions="0.6212121212121212" styleClass="background" stylesheets="@style/plateau.css" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||||
<items>
|
<items>
|
||||||
<AnchorPane>
|
<AnchorPane>
|
||||||
<children>
|
<children>
|
||||||
<VBox prefHeight="200.0" prefWidth="100.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
<VBox alignment="CENTER" spacing="30.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||||
<children>
|
<children>
|
||||||
<Label styleClass="text" text="Vous arrivez sur cette Carte Lieu" textOverrun="CLIP" wrapText="true">
|
<Label styleClass="text" text="Vous arrivez sur cette Carte Lieu" textOverrun="CLIP" wrapText="true">
|
||||||
<font>
|
<font>
|
||||||
|
@ -19,13 +19,13 @@
|
|||||||
<?import javafx.scene.shape.Circle?>
|
<?import javafx.scene.shape.Circle?>
|
||||||
<?import javafx.scene.text.Font?>
|
<?import javafx.scene.text.Font?>
|
||||||
|
|
||||||
<AnchorPane fx:id="rootPane" styleClass="background" stylesheets="@style/plateau.css" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ihm.controller.PlateauController">
|
<AnchorPane fx:id="rootPane" prefHeight="413.0" prefWidth="1559.0" styleClass="background" stylesheets="@style/plateau.css" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ihm.controller.PlateauController">
|
||||||
<children>
|
<children>
|
||||||
<HBox alignment="CENTER" layoutX="14.0" spacing="100.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
<HBox alignment="CENTER" layoutX="14.0" spacing="100.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||||
<children>
|
<children>
|
||||||
<Group>
|
<Group>
|
||||||
<children>
|
<children>
|
||||||
<GridPane hgap="50.0" prefWidth="885.0" rotate="90.0">
|
<GridPane hgap="50.0" rotate="90.0">
|
||||||
<columnConstraints>
|
<columnConstraints>
|
||||||
<ColumnConstraints hgrow="ALWAYS" />
|
<ColumnConstraints hgrow="ALWAYS" />
|
||||||
<ColumnConstraints hgrow="ALWAYS" />
|
<ColumnConstraints hgrow="ALWAYS" />
|
||||||
@ -252,7 +252,7 @@
|
|||||||
<Insets bottom="25.0" />
|
<Insets bottom="25.0" />
|
||||||
</padding>
|
</padding>
|
||||||
</GridPane>
|
</GridPane>
|
||||||
<HBox alignment="CENTER" prefHeight="366.0" prefWidth="810.0" spacing="50.0">
|
<HBox alignment="CENTER" prefHeight="366.0" prefWidth="1125.0" spacing="50.0">
|
||||||
<children>
|
<children>
|
||||||
<VBox alignment="TOP_CENTER">
|
<VBox alignment="TOP_CENTER">
|
||||||
<children>
|
<children>
|
||||||
@ -616,28 +616,6 @@
|
|||||||
</GridPane>
|
</GridPane>
|
||||||
</children>
|
</children>
|
||||||
</VBox>
|
</VBox>
|
||||||
<VBox alignment="TOP_CENTER">
|
|
||||||
<children>
|
|
||||||
<HBox prefHeight="100.0" prefWidth="200.0" styleClass="carteLumiere" stylesheets="@style/plateau.css">
|
|
||||||
<children>
|
|
||||||
<ImageView fitHeight="97.8" fitWidth="70.05" pickOnBounds="true" preserveRatio="true" />
|
|
||||||
</children>
|
|
||||||
</HBox>
|
|
||||||
<HBox prefHeight="100.0" prefWidth="200.0" styleClass="carteVision" stylesheets="@style/plateau.css">
|
|
||||||
<children>
|
|
||||||
<ImageView fitHeight="97.8" fitWidth="70.05" pickOnBounds="true" preserveRatio="true" />
|
|
||||||
</children>
|
|
||||||
<VBox.margin>
|
|
||||||
<Insets bottom="30.0" top="30.0" />
|
|
||||||
</VBox.margin>
|
|
||||||
</HBox>
|
|
||||||
<HBox prefHeight="100.0" prefWidth="200.0" styleClass="carteTenebre" stylesheets="@style/plateau.css">
|
|
||||||
<children>
|
|
||||||
<ImageView fitHeight="97.8" fitWidth="70.05" pickOnBounds="true" preserveRatio="true" />
|
|
||||||
</children>
|
|
||||||
</HBox>
|
|
||||||
</children>
|
|
||||||
</VBox>
|
|
||||||
</children>
|
</children>
|
||||||
</HBox>
|
</HBox>
|
||||||
<GridPane hgap="50.0" VBox.vgrow="ALWAYS">
|
<GridPane hgap="50.0" VBox.vgrow="ALWAYS">
|
||||||
@ -757,7 +735,7 @@
|
|||||||
</VBox>
|
</VBox>
|
||||||
<Group>
|
<Group>
|
||||||
<children>
|
<children>
|
||||||
<GridPane hgap="50.0" prefWidth="885.0" rotate="-90.0">
|
<GridPane hgap="50.0" rotate="-90.0">
|
||||||
<columnConstraints>
|
<columnConstraints>
|
||||||
<ColumnConstraints hgrow="ALWAYS" />
|
<ColumnConstraints hgrow="ALWAYS" />
|
||||||
<ColumnConstraints hgrow="ALWAYS" />
|
<ColumnConstraints hgrow="ALWAYS" />
|
||||||
|
37
src/ihm/ressources/RecevoirCarte.fxml
Normal file
37
src/ihm/ressources/RecevoirCarte.fxml
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<?import javafx.scene.control.Button?>
|
||||||
|
<?import javafx.scene.control.Label?>
|
||||||
|
<?import javafx.scene.control.SplitPane?>
|
||||||
|
<?import javafx.scene.image.ImageView?>
|
||||||
|
<?import javafx.scene.layout.AnchorPane?>
|
||||||
|
<?import javafx.scene.layout.VBox?>
|
||||||
|
<?import javafx.scene.text.Font?>
|
||||||
|
|
||||||
|
<AnchorPane xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ihm.controller.RecevoirCarte">
|
||||||
|
<children>
|
||||||
|
<SplitPane dividerPositions="0.6212121212121212" styleClass="background" stylesheets="@style/plateau.css" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||||
|
<items>
|
||||||
|
<AnchorPane>
|
||||||
|
<children>
|
||||||
|
<VBox alignment="CENTER" spacing="30.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||||
|
<children>
|
||||||
|
<Label fx:id="label" styleClass="text" text="Vous arrivez sur cette Carte Lieu" textOverrun="CLIP" wrapText="true">
|
||||||
|
<font>
|
||||||
|
<Font size="14.0" />
|
||||||
|
</font>
|
||||||
|
</Label>
|
||||||
|
<Button fx:id="okButton" mnemonicParsing="false" styleClass="bouton" text="Ok" />
|
||||||
|
</children>
|
||||||
|
</VBox>
|
||||||
|
</children>
|
||||||
|
</AnchorPane>
|
||||||
|
<AnchorPane>
|
||||||
|
<children>
|
||||||
|
<ImageView fx:id="imageView" fitHeight="158.0" fitWidth="132.0" pickOnBounds="true" preserveRatio="true" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" />
|
||||||
|
</children>
|
||||||
|
</AnchorPane>
|
||||||
|
</items>
|
||||||
|
</SplitPane>
|
||||||
|
</children>
|
||||||
|
</AnchorPane>
|
@ -10,6 +10,8 @@ import java.util.concurrent.FutureTask;
|
|||||||
|
|
||||||
import carte.CarteEquipement;
|
import carte.CarteEquipement;
|
||||||
import carte.CarteLieu;
|
import carte.CarteLieu;
|
||||||
|
import carte.CartePiochable;
|
||||||
|
import carte.CartePiochable.Type;
|
||||||
import database.RessourceLoader;
|
import database.RessourceLoader;
|
||||||
import effet.Effet;
|
import effet.Effet;
|
||||||
import ihm.controller.PlateauController;
|
import ihm.controller.PlateauController;
|
||||||
@ -44,11 +46,6 @@ public class GestionnaireJeu {
|
|||||||
plateau.start();
|
plateau.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Joueur choisirParmisListe(Joueur joueur, List<Joueur> joueurs) {
|
|
||||||
return joueurs.get(0);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public Effet choisirEffet(Joueur joueur, Effet[] effets) {
|
public Effet choisirEffet(Joueur joueur, Effet[] effets) {
|
||||||
return effets[0];
|
return effets[0];
|
||||||
}
|
}
|
||||||
@ -306,5 +303,20 @@ public class GestionnaireJeu {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void piocher(Joueur j, CartePiochable cartePiochable) {
|
||||||
|
Platform.runLater(() -> {
|
||||||
|
try {
|
||||||
|
if(cartePiochable.getType() == Type.VISION) {
|
||||||
|
pc.afficherVision(j, cartePiochable);
|
||||||
|
}else {
|
||||||
|
pc.afficherLT(j, cartePiochable);
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
waitPlateau();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -257,6 +257,10 @@ public class Joueur {
|
|||||||
public Joueur choisirAdjacents() {
|
public Joueur choisirAdjacents() {
|
||||||
return this.plateau.choisirAdjacents(this);
|
return this.plateau.choisirAdjacents(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Joueur choisiParmisTous() {
|
||||||
|
return this.plateau.choisirParmisTous(this);
|
||||||
|
}
|
||||||
|
|
||||||
public void ajouterEquipementIHM(CarteEquipement e) {
|
public void ajouterEquipementIHM(CarteEquipement e) {
|
||||||
this.plateau.ajouterEquipementIHM(this,e);
|
this.plateau.ajouterEquipementIHM(this,e);
|
||||||
@ -267,12 +271,6 @@ public class Joueur {
|
|||||||
this.plateau.retirerEquipementIHM(this,e);
|
this.plateau.retirerEquipementIHM(this,e);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Joueur choisiParmisTous() {
|
|
||||||
return this.plateau.choisirParmisTous(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -17,8 +17,6 @@ public class Pioche {
|
|||||||
melanger();
|
melanger();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void melanger()
|
public void melanger()
|
||||||
{
|
{
|
||||||
Collections.shuffle(cartesPiochables);
|
Collections.shuffle(cartesPiochables);
|
||||||
@ -28,8 +26,6 @@ public class Pioche {
|
|||||||
return cartesPiochables.pop();
|
return cartesPiochables.pop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public Stack<CartePiochable> getStack() {
|
public Stack<CartePiochable> getStack() {
|
||||||
return cartesPiochables;
|
return cartesPiochables;
|
||||||
}
|
}
|
||||||
|
@ -442,8 +442,7 @@ public class Plateau extends Thread{
|
|||||||
joueurs.remove(joueur);
|
joueurs.remove(joueur);
|
||||||
joueurs.addAll(cl.getJoueursAdjacents());
|
joueurs.addAll(cl.getJoueursAdjacents());
|
||||||
|
|
||||||
return gj.choisirParmisListe(joueur, joueurs);
|
return (Joueur) gj.choisir(joueur, joueurs, Joueur.class);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Effet choisirEffet(Joueur joueur, Effet[] effets) {
|
public Effet choisirEffet(Joueur joueur, Effet[] effets) {
|
||||||
@ -452,7 +451,7 @@ public class Plateau extends Thread{
|
|||||||
|
|
||||||
public Joueur choisirParmisTous(Joueur joueur) {
|
public Joueur choisirParmisTous(Joueur joueur) {
|
||||||
List<Joueur> joueurs = this.getJoueurs();
|
List<Joueur> joueurs = this.getJoueurs();
|
||||||
return gj.choisirParmisListe(joueur,joueurs);
|
return (Joueur) gj.choisir(joueur, joueurs, Joueur.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,5 +0,0 @@
|
|||||||
package main;
|
|
||||||
|
|
||||||
public interface Type {
|
|
||||||
|
|
||||||
}
|
|
@ -1,5 +0,0 @@
|
|||||||
package main;
|
|
||||||
|
|
||||||
public class TypeLumiere implements Type {
|
|
||||||
|
|
||||||
}
|
|
@ -1,5 +0,0 @@
|
|||||||
package main;
|
|
||||||
|
|
||||||
public class TypeTenebre implements Type{
|
|
||||||
|
|
||||||
}
|
|
@ -1,5 +0,0 @@
|
|||||||
package main;
|
|
||||||
|
|
||||||
public class TypeVision implements Type {
|
|
||||||
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user