Take damages ihm
This commit is contained in:
parent
3851b72149
commit
b0b506cfb0
@ -41,6 +41,7 @@ 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) {
|
||||||
|
System.out.println("CartePiochable "+this + " Condition : "+this.getCondition()+" Effet : "+this.getEffet()+" Action : "+this.getEffet().getAction());
|
||||||
super.utiliser(j);
|
super.utiliser(j);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
26
src/ihm/ImageViewEquipement.java
Normal file
26
src/ihm/ImageViewEquipement.java
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
package ihm;
|
||||||
|
|
||||||
|
import carte.CarteEquipement;
|
||||||
|
import javafx.scene.image.ImageView;
|
||||||
|
|
||||||
|
public class ImageViewEquipement extends ImageView{
|
||||||
|
|
||||||
|
private CarteEquipement ce;
|
||||||
|
|
||||||
|
public ImageViewEquipement(CarteEquipement ce) {
|
||||||
|
this.ce = ce;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CarteEquipement getCp() {
|
||||||
|
return ce;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCp(CarteEquipement ce) {
|
||||||
|
this.ce = ce;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean contains(CarteEquipement ce) {
|
||||||
|
return this.ce == ce;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
26
src/ihm/controller/AlterationVieZJ.java
Normal file
26
src/ihm/controller/AlterationVieZJ.java
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
package ihm.controller;
|
||||||
|
|
||||||
|
import java.net.URL;
|
||||||
|
import java.util.ResourceBundle;
|
||||||
|
|
||||||
|
import javafx.fxml.FXML;
|
||||||
|
import javafx.fxml.Initializable;
|
||||||
|
import javafx.scene.control.Label;
|
||||||
|
|
||||||
|
public class AlterationVieZJ implements Initializable {
|
||||||
|
|
||||||
|
@FXML private Label label;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void initialize(URL arg0, ResourceBundle arg1) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void changeLabel(int valeur) {
|
||||||
|
if(valeur > 0 ) {
|
||||||
|
this.label.setText("Vous êtes soigné de "+valeur+"PV");
|
||||||
|
}else {
|
||||||
|
this.label.setText("Vous êtes blessé de "+valeur+"PV");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,7 +1,11 @@
|
|||||||
package ihm.controller;
|
package ihm.controller;
|
||||||
|
|
||||||
|
import carte.CarteEquipement;
|
||||||
|
import ihm.ImageViewEquipement;
|
||||||
|
import javafx.scene.Node;
|
||||||
import javafx.scene.control.Button;
|
import javafx.scene.control.Button;
|
||||||
import javafx.scene.control.Label;
|
import javafx.scene.control.Label;
|
||||||
|
import javafx.scene.control.ScrollPane;
|
||||||
import javafx.scene.image.Image;
|
import javafx.scene.image.Image;
|
||||||
import javafx.scene.image.ImageView;
|
import javafx.scene.image.ImageView;
|
||||||
import javafx.scene.layout.AnchorPane;
|
import javafx.scene.layout.AnchorPane;
|
||||||
@ -11,6 +15,7 @@ import javafx.scene.layout.BorderStrokeStyle;
|
|||||||
import javafx.scene.layout.BorderWidths;
|
import javafx.scene.layout.BorderWidths;
|
||||||
import javafx.scene.layout.CornerRadii;
|
import javafx.scene.layout.CornerRadii;
|
||||||
import javafx.scene.layout.GridPane;
|
import javafx.scene.layout.GridPane;
|
||||||
|
import javafx.scene.layout.HBox;
|
||||||
import javafx.scene.layout.Pane;
|
import javafx.scene.layout.Pane;
|
||||||
import javafx.scene.paint.Color;
|
import javafx.scene.paint.Color;
|
||||||
import main.Joueur;
|
import main.Joueur;
|
||||||
@ -71,6 +76,7 @@ public class JoueurIHM {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setZoneJoueur(Pane p) {
|
public void setZoneJoueur(Pane p) {
|
||||||
|
|
||||||
AnchorPane ap = (AnchorPane) zoneJoueur.getChildren().get(1);
|
AnchorPane ap = (AnchorPane) zoneJoueur.getChildren().get(1);
|
||||||
ap.getChildren().setAll(p);
|
ap.getChildren().setAll(p);
|
||||||
|
|
||||||
@ -94,11 +100,6 @@ public class JoueurIHM {
|
|||||||
Label label = getLabelJoueur();
|
Label label = getLabelJoueur();
|
||||||
label.setText(name);
|
label.setText(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Label getPaneEquipement() {
|
|
||||||
Pane p = (Pane) zoneJoueur.getChildren().get(2);
|
|
||||||
return (Label) p.getChildren().get(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getPosition() {
|
public int getPosition() {
|
||||||
return position;
|
return position;
|
||||||
@ -129,4 +130,36 @@ public class JoueurIHM {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void resetZoneJoueur() {
|
||||||
|
this.getZoneJoueur().getChildren().setAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
public HBox getPaneEquipement(){
|
||||||
|
ScrollPane sp = (ScrollPane) this.zoneJoueur.getChildren().get(3);
|
||||||
|
HBox p = (HBox) sp.getContent();
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ajouterEquipement(CarteEquipement e) {
|
||||||
|
HBox hb = getPaneEquipement();
|
||||||
|
ImageViewEquipement ive = new ImageViewEquipement(e);
|
||||||
|
hb.getChildren().add(new ImageViewEquipement(e));
|
||||||
|
ive.fitHeightProperty().bind(hb.heightProperty());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void retirerEquipement(CarteEquipement e) {
|
||||||
|
HBox hb = getPaneEquipement();
|
||||||
|
for(Node n : hb.getChildren()) {
|
||||||
|
if(n instanceof ImageViewEquipement) {
|
||||||
|
ImageViewEquipement ive = (ImageViewEquipement) n;
|
||||||
|
if(ive.contains(e)) {
|
||||||
|
hb.getChildren().remove(ive);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,8 @@ import carte.CarteLieu;
|
|||||||
import database.RessourceLoader;
|
import database.RessourceLoader;
|
||||||
import ihm.EffetSonore;
|
import ihm.EffetSonore;
|
||||||
import ihm.PopUp;
|
import ihm.PopUp;
|
||||||
|
import javafx.animation.KeyFrame;
|
||||||
|
import javafx.animation.Timeline;
|
||||||
import javafx.fxml.FXML;
|
import javafx.fxml.FXML;
|
||||||
import javafx.fxml.FXMLLoader;
|
import javafx.fxml.FXMLLoader;
|
||||||
import javafx.fxml.Initializable;
|
import javafx.fxml.Initializable;
|
||||||
@ -28,22 +30,16 @@ import javafx.scene.image.Image;
|
|||||||
import javafx.scene.image.ImageView;
|
import javafx.scene.image.ImageView;
|
||||||
import javafx.scene.input.MouseEvent;
|
import javafx.scene.input.MouseEvent;
|
||||||
import javafx.scene.layout.AnchorPane;
|
import javafx.scene.layout.AnchorPane;
|
||||||
import javafx.scene.layout.Background;
|
|
||||||
import javafx.scene.layout.BackgroundImage;
|
|
||||||
import javafx.scene.layout.BackgroundPosition;
|
|
||||||
import javafx.scene.layout.BackgroundRepeat;
|
|
||||||
import javafx.scene.layout.BackgroundSize;
|
|
||||||
import javafx.scene.layout.FlowPane;
|
|
||||||
import javafx.scene.layout.GridPane;
|
import javafx.scene.layout.GridPane;
|
||||||
import javafx.scene.layout.HBox;
|
import javafx.scene.layout.HBox;
|
||||||
import javafx.scene.layout.Pane;
|
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.util.Duration;
|
||||||
import main.Contexte;
|
import main.Contexte;
|
||||||
import main.GestionnaireJeu;
|
import main.GestionnaireJeu;
|
||||||
import main.Joueur;
|
import main.Joueur;
|
||||||
import personnage.CartePersonnage;
|
|
||||||
|
|
||||||
public class PlateauController implements Initializable {
|
public class PlateauController implements Initializable {
|
||||||
|
|
||||||
@ -357,6 +353,26 @@ public class PlateauController implements Initializable {
|
|||||||
jihm.setZoneJoueur(root);
|
jihm.setZoneJoueur(root);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void afficherAlterationVie(Joueur j, int valeur) throws IOException, InterruptedException {
|
||||||
|
|
||||||
|
final URL fxmlURL = getClass().getResource("/ihm/ressources/AlterationVieZJ.fxml");
|
||||||
|
final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", Locale.FRANCE);
|
||||||
|
final FXMLLoader fxmlLoader = new FXMLLoader(fxmlURL, bundle);
|
||||||
|
Pane root = (Pane)fxmlLoader.load();
|
||||||
|
AlterationVieZJ avzj = fxmlLoader.getController();
|
||||||
|
avzj.changeLabel(valeur);
|
||||||
|
JoueurIHM jihm = getJoueurIHM(j);
|
||||||
|
jihm.setZoneJoueur(root);
|
||||||
|
|
||||||
|
Timeline timeline = new Timeline(new KeyFrame(
|
||||||
|
Duration.millis(2500),
|
||||||
|
ae -> {
|
||||||
|
jihm.resetZoneJoueur();
|
||||||
|
GestionnaireJeu.notifyPlateau();
|
||||||
|
}));
|
||||||
|
timeline.play();
|
||||||
|
}
|
||||||
|
|
||||||
public void afficherLieu(Joueur j) throws IOException {
|
public void afficherLieu(Joueur j) throws IOException {
|
||||||
|
|
||||||
final URL fxmlURL = getClass().getResource("/ihm/ressources/LieuZJ.fxml");
|
final URL fxmlURL = getClass().getResource("/ihm/ressources/LieuZJ.fxml");
|
||||||
@ -367,20 +383,16 @@ public class PlateauController implements Initializable {
|
|||||||
lzj.setImageView(this.getImageCarte(j.getCarteLieu()));
|
lzj.setImageView(this.getImageCarte(j.getCarteLieu()));
|
||||||
JoueurIHM jihm = getJoueurIHM(j);
|
JoueurIHM jihm = getJoueurIHM(j);
|
||||||
jihm.setZoneJoueur(root);
|
jihm.setZoneJoueur(root);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
public void afficherChoisirJoueur(Joueur j, List<Joueur> joueurs, Contexte contexte) throws IOException {
|
public void afficherChoisirJoueur(Joueur j, List<Joueur> joueurs, Contexte contexte) throws IOException {
|
||||||
final URL fxmlURL = getClass().getResource("/ihm/ressources/choixJoueurAttq.fxml");
|
final URL fxmlURL = getClass().getResource("/ihm/ressources/choixJoueurAttq.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 root = (Pane)fxmlLoader.load();
|
||||||
Pane root = (Pane)fxmlLoader.load();
|
this.cj = fxmlLoader.getController();
|
||||||
this.cj = fxmlLoader.getController();
|
JoueurIHM jihm = getJoueurIHM(j);
|
||||||
|
jihm.setZoneJoueur(root);
|
||||||
JoueurIHM jihm = getJoueurIHM(j);
|
}
|
||||||
jihm.setZoneJoueur(root);
|
|
||||||
}
|
|
||||||
|
|
||||||
public CarteEquipement getChoixEquipementVole(Joueur joueur) {
|
public CarteEquipement getChoixEquipementVole(Joueur joueur) {
|
||||||
JoueurIHM jihm = getJoueurIHM(joueur);
|
JoueurIHM jihm = getJoueurIHM(joueur);
|
||||||
@ -441,5 +453,21 @@ public class PlateauController implements Initializable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void ajouterEquipement(Joueur j, CarteEquipement e) {
|
||||||
|
JoueurIHM jihm = getJoueurIHM(j);
|
||||||
|
jihm.ajouterEquipement(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void retirerEquipement(Joueur j, CarteEquipement e) {
|
||||||
|
JoueurIHM jihm = getJoueurIHM(j);
|
||||||
|
jihm.retirerEquipement(e);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
15
src/ihm/ressources/AlterationVieZJ.fxml
Normal file
15
src/ihm/ressources/AlterationVieZJ.fxml
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<?import javafx.scene.control.Label?>
|
||||||
|
<?import javafx.scene.layout.AnchorPane?>
|
||||||
|
<?import javafx.scene.layout.Pane?>
|
||||||
|
|
||||||
|
<AnchorPane 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.AlterationVieZJ">
|
||||||
|
<children>
|
||||||
|
<Pane prefHeight="200.0" prefWidth="200.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||||
|
<children>
|
||||||
|
<Label fx:id="label" alignment="CENTER" contentDisplay="CENTER" layoutX="86.0" layoutY="92.0" styleClass="text" text="Label" />
|
||||||
|
</children>
|
||||||
|
</Pane>
|
||||||
|
</children>
|
||||||
|
</AnchorPane>
|
@ -5,6 +5,7 @@
|
|||||||
<?import javafx.scene.Group?>
|
<?import javafx.scene.Group?>
|
||||||
<?import javafx.scene.control.Button?>
|
<?import javafx.scene.control.Button?>
|
||||||
<?import javafx.scene.control.Label?>
|
<?import javafx.scene.control.Label?>
|
||||||
|
<?import javafx.scene.control.ScrollPane?>
|
||||||
<?import javafx.scene.image.Image?>
|
<?import javafx.scene.image.Image?>
|
||||||
<?import javafx.scene.image.ImageView?>
|
<?import javafx.scene.image.ImageView?>
|
||||||
<?import javafx.scene.layout.AnchorPane?>
|
<?import javafx.scene.layout.AnchorPane?>
|
||||||
@ -63,11 +64,18 @@
|
|||||||
<Button mnemonicParsing="false" styleClass="bouton" stylesheets="@style/plateau.css" text="%se.reveler" GridPane.rowIndex="1" />
|
<Button mnemonicParsing="false" styleClass="bouton" stylesheets="@style/plateau.css" text="%se.reveler" GridPane.rowIndex="1" />
|
||||||
</children>
|
</children>
|
||||||
</GridPane>
|
</GridPane>
|
||||||
<FlowPane prefWidth="144.0" styleClass="tour" GridPane.columnIndex="2" GridPane.rowIndex="1">
|
<ScrollPane hbarPolicy="NEVER" prefHeight="144.0" prefWidth="144.0" styleClass="pane" vbarPolicy="NEVER" GridPane.columnIndex="2" GridPane.rowIndex="1">
|
||||||
<children>
|
<content>
|
||||||
<ImageView pickOnBounds="true" preserveRatio="true" />
|
<AnchorPane prefHeight="143.0" prefWidth="270.0">
|
||||||
</children>
|
<children>
|
||||||
</FlowPane>
|
<HBox prefHeight="144.0" prefWidth="270.0" styleClass="background" AnchorPane.bottomAnchor="-1.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" />
|
||||||
|
</children>
|
||||||
|
</AnchorPane>
|
||||||
|
</content>
|
||||||
|
<padding>
|
||||||
|
<Insets bottom="2.0" left="2.0" right="2.0" top="2.0" />
|
||||||
|
</padding>
|
||||||
|
</ScrollPane>
|
||||||
<Label styleClass="text" stylesheets="@style/plateau.css" text="Equipements" GridPane.columnIndex="2" />
|
<Label styleClass="text" stylesheets="@style/plateau.css" text="Equipements" GridPane.columnIndex="2" />
|
||||||
</children>
|
</children>
|
||||||
<padding>
|
<padding>
|
||||||
@ -104,11 +112,18 @@
|
|||||||
<Button mnemonicParsing="false" styleClass="bouton" stylesheets="@style/plateau.css" text="%se.reveler" GridPane.rowIndex="1" />
|
<Button mnemonicParsing="false" styleClass="bouton" stylesheets="@style/plateau.css" text="%se.reveler" GridPane.rowIndex="1" />
|
||||||
</children>
|
</children>
|
||||||
</GridPane>
|
</GridPane>
|
||||||
<FlowPane prefHeight="144.0" prefWidth="144.0" styleClass="tour" GridPane.columnIndex="2" GridPane.rowIndex="1">
|
<ScrollPane hbarPolicy="NEVER" prefHeight="144.0" prefWidth="144.0" styleClass="pane" vbarPolicy="NEVER" GridPane.columnIndex="2" GridPane.rowIndex="1">
|
||||||
<children>
|
<content>
|
||||||
<ImageView pickOnBounds="true" preserveRatio="true" />
|
<AnchorPane prefHeight="143.0" prefWidth="270.0">
|
||||||
</children>
|
<children>
|
||||||
</FlowPane>
|
<HBox prefHeight="144.0" prefWidth="270.0" styleClass="background" AnchorPane.bottomAnchor="-1.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" />
|
||||||
|
</children>
|
||||||
|
</AnchorPane>
|
||||||
|
</content>
|
||||||
|
<padding>
|
||||||
|
<Insets bottom="2.0" left="2.0" right="2.0" top="2.0" />
|
||||||
|
</padding>
|
||||||
|
</ScrollPane>
|
||||||
<Label styleClass="text" stylesheets="@style/plateau.css" text="Equipements" GridPane.columnIndex="2" />
|
<Label styleClass="text" stylesheets="@style/plateau.css" text="Equipements" GridPane.columnIndex="2" />
|
||||||
</children>
|
</children>
|
||||||
<padding>
|
<padding>
|
||||||
@ -166,11 +181,18 @@
|
|||||||
<Button mnemonicParsing="false" styleClass="bouton" stylesheets="@style/plateau.css" text="%se.reveler" GridPane.rowIndex="1" />
|
<Button mnemonicParsing="false" styleClass="bouton" stylesheets="@style/plateau.css" text="%se.reveler" GridPane.rowIndex="1" />
|
||||||
</children>
|
</children>
|
||||||
</GridPane>
|
</GridPane>
|
||||||
<FlowPane prefWidth="144.0" styleClass="tour" GridPane.columnIndex="2" GridPane.rowIndex="1">
|
<ScrollPane hbarPolicy="NEVER" prefHeight="144.0" prefWidth="144.0" styleClass="pane" vbarPolicy="NEVER" GridPane.columnIndex="2" GridPane.rowIndex="1">
|
||||||
<children>
|
<content>
|
||||||
<ImageView pickOnBounds="true" preserveRatio="true" />
|
<AnchorPane prefHeight="143.0" prefWidth="270.0">
|
||||||
</children>
|
<children>
|
||||||
</FlowPane>
|
<HBox prefHeight="144.0" prefWidth="270.0" styleClass="background" AnchorPane.bottomAnchor="-1.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" />
|
||||||
|
</children>
|
||||||
|
</AnchorPane>
|
||||||
|
</content>
|
||||||
|
<padding>
|
||||||
|
<Insets bottom="2.0" left="2.0" right="2.0" top="2.0" />
|
||||||
|
</padding>
|
||||||
|
</ScrollPane>
|
||||||
<Label styleClass="text" stylesheets="@style/plateau.css" text="Equipements" GridPane.columnIndex="2" />
|
<Label styleClass="text" stylesheets="@style/plateau.css" text="Equipements" GridPane.columnIndex="2" />
|
||||||
</children>
|
</children>
|
||||||
<padding>
|
<padding>
|
||||||
@ -207,11 +229,18 @@
|
|||||||
<Button mnemonicParsing="false" styleClass="bouton" stylesheets="@style/plateau.css" text="%se.reveler" GridPane.rowIndex="1" />
|
<Button mnemonicParsing="false" styleClass="bouton" stylesheets="@style/plateau.css" text="%se.reveler" GridPane.rowIndex="1" />
|
||||||
</children>
|
</children>
|
||||||
</GridPane>
|
</GridPane>
|
||||||
<FlowPane prefWidth="144.0" styleClass="tour" GridPane.columnIndex="2" GridPane.rowIndex="1">
|
<ScrollPane hbarPolicy="NEVER" prefHeight="144.0" prefWidth="144.0" styleClass="pane" vbarPolicy="NEVER" GridPane.columnIndex="2" GridPane.rowIndex="1">
|
||||||
<children>
|
<content>
|
||||||
<ImageView pickOnBounds="true" preserveRatio="true" />
|
<AnchorPane prefHeight="143.0" prefWidth="270.0">
|
||||||
</children>
|
<children>
|
||||||
</FlowPane>
|
<HBox prefHeight="144.0" prefWidth="270.0" styleClass="background" AnchorPane.bottomAnchor="-1.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" />
|
||||||
|
</children>
|
||||||
|
</AnchorPane>
|
||||||
|
</content>
|
||||||
|
<padding>
|
||||||
|
<Insets bottom="2.0" left="2.0" right="2.0" top="2.0" />
|
||||||
|
</padding>
|
||||||
|
</ScrollPane>
|
||||||
<Label styleClass="text" stylesheets="@style/plateau.css" text="Equipements" GridPane.columnIndex="2" />
|
<Label styleClass="text" stylesheets="@style/plateau.css" text="Equipements" GridPane.columnIndex="2" />
|
||||||
</children>
|
</children>
|
||||||
<padding>
|
<padding>
|
||||||
@ -650,11 +679,21 @@
|
|||||||
<Button mnemonicParsing="false" styleClass="bouton" stylesheets="@style/plateau.css" text="%se.reveler" GridPane.rowIndex="1" />
|
<Button mnemonicParsing="false" styleClass="bouton" stylesheets="@style/plateau.css" text="%se.reveler" GridPane.rowIndex="1" />
|
||||||
</children>
|
</children>
|
||||||
</GridPane>
|
</GridPane>
|
||||||
<FlowPane prefHeight="144.0" prefWidth="144.0" styleClass="tour" GridPane.columnIndex="2" GridPane.rowIndex="1">
|
<ScrollPane fitToWidth="true" hbarPolicy="NEVER" prefHeight="144.0" prefWidth="144.0" styleClass="pane" vbarPolicy="NEVER" GridPane.columnIndex="2" GridPane.rowIndex="1">
|
||||||
<children>
|
<content>
|
||||||
<ImageView pickOnBounds="true" preserveRatio="true" />
|
<AnchorPane prefHeight="143.0" prefWidth="270.0">
|
||||||
</children>
|
<children>
|
||||||
</FlowPane>
|
<HBox styleClass="background" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" />
|
||||||
|
</children>
|
||||||
|
</AnchorPane>
|
||||||
|
</content>
|
||||||
|
<GridPane.margin>
|
||||||
|
<Insets />
|
||||||
|
</GridPane.margin>
|
||||||
|
<padding>
|
||||||
|
<Insets bottom="2.0" left="2.0" right="2.0" top="2.0" />
|
||||||
|
</padding>
|
||||||
|
</ScrollPane>
|
||||||
<Label styleClass="text" stylesheets="@style/plateau.css" text="Equipements" GridPane.columnIndex="2" />
|
<Label styleClass="text" stylesheets="@style/plateau.css" text="Equipements" GridPane.columnIndex="2" />
|
||||||
</children>
|
</children>
|
||||||
<padding>
|
<padding>
|
||||||
@ -691,11 +730,18 @@
|
|||||||
<Button mnemonicParsing="false" styleClass="bouton" stylesheets="@style/plateau.css" text="%se.reveler" GridPane.rowIndex="1" />
|
<Button mnemonicParsing="false" styleClass="bouton" stylesheets="@style/plateau.css" text="%se.reveler" GridPane.rowIndex="1" />
|
||||||
</children>
|
</children>
|
||||||
</GridPane>
|
</GridPane>
|
||||||
<FlowPane prefHeight="144.0" prefWidth="144.0" styleClass="tour" GridPane.columnIndex="2" GridPane.rowIndex="1">
|
<ScrollPane hbarPolicy="NEVER" prefHeight="144.0" prefWidth="144.0" styleClass="pane" vbarPolicy="NEVER" GridPane.columnIndex="2" GridPane.rowIndex="1">
|
||||||
<children>
|
<content>
|
||||||
<ImageView pickOnBounds="true" preserveRatio="true" />
|
<AnchorPane prefHeight="143.0" prefWidth="270.0">
|
||||||
</children>
|
<children>
|
||||||
</FlowPane>
|
<HBox styleClass="background" AnchorPane.bottomAnchor="-1.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" />
|
||||||
|
</children>
|
||||||
|
</AnchorPane>
|
||||||
|
</content>
|
||||||
|
<padding>
|
||||||
|
<Insets bottom="2.0" left="2.0" right="2.0" top="2.0" />
|
||||||
|
</padding>
|
||||||
|
</ScrollPane>
|
||||||
<Label styleClass="text" stylesheets="@style/plateau.css" text="Equipements" GridPane.columnIndex="2" />
|
<Label styleClass="text" stylesheets="@style/plateau.css" text="Equipements" GridPane.columnIndex="2" />
|
||||||
</children>
|
</children>
|
||||||
<padding>
|
<padding>
|
||||||
@ -750,11 +796,22 @@
|
|||||||
<Button mnemonicParsing="false" styleClass="bouton" stylesheets="@style/plateau.css" text="%se.reveler" GridPane.rowIndex="1" />
|
<Button mnemonicParsing="false" styleClass="bouton" stylesheets="@style/plateau.css" text="%se.reveler" GridPane.rowIndex="1" />
|
||||||
</children>
|
</children>
|
||||||
</GridPane>
|
</GridPane>
|
||||||
<FlowPane prefWidth="144.0" styleClass="tour" GridPane.columnIndex="2" GridPane.rowIndex="1">
|
<ScrollPane hbarPolicy="NEVER" prefHeight="144.0" prefWidth="144.0" styleClass="pane" vbarPolicy="NEVER" GridPane.columnIndex="2" GridPane.rowIndex="1">
|
||||||
<children>
|
<content>
|
||||||
<ImageView pickOnBounds="true" preserveRatio="true" />
|
<AnchorPane prefHeight="143.0" prefWidth="270.0">
|
||||||
</children>
|
<children>
|
||||||
</FlowPane>
|
<HBox prefHeight="144.0" prefWidth="270.0" styleClass="background" AnchorPane.bottomAnchor="-1.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||||
|
<children>
|
||||||
|
<ImageView fitHeight="95.0" fitWidth="88.0" pickOnBounds="true" preserveRatio="true" />
|
||||||
|
</children>
|
||||||
|
</HBox>
|
||||||
|
</children>
|
||||||
|
</AnchorPane>
|
||||||
|
</content>
|
||||||
|
<padding>
|
||||||
|
<Insets bottom="2.0" left="2.0" right="2.0" top="2.0" />
|
||||||
|
</padding>
|
||||||
|
</ScrollPane>
|
||||||
<Label styleClass="text" stylesheets="@style/plateau.css" text="Equipements" GridPane.columnIndex="2" />
|
<Label styleClass="text" stylesheets="@style/plateau.css" text="Equipements" GridPane.columnIndex="2" />
|
||||||
</children>
|
</children>
|
||||||
<padding>
|
<padding>
|
||||||
@ -791,11 +848,22 @@
|
|||||||
<Button mnemonicParsing="false" styleClass="bouton" stylesheets="@style/plateau.css" text="%se.reveler" GridPane.rowIndex="1" />
|
<Button mnemonicParsing="false" styleClass="bouton" stylesheets="@style/plateau.css" text="%se.reveler" GridPane.rowIndex="1" />
|
||||||
</children>
|
</children>
|
||||||
</GridPane>
|
</GridPane>
|
||||||
<FlowPane prefHeight="144.0" prefWidth="144.0" styleClass="tour" GridPane.columnIndex="2" GridPane.rowIndex="1">
|
<ScrollPane hbarPolicy="NEVER" prefHeight="144.0" prefWidth="144.0" styleClass="pane" vbarPolicy="NEVER" GridPane.columnIndex="2" GridPane.rowIndex="1">
|
||||||
<children>
|
<content>
|
||||||
<ImageView pickOnBounds="true" preserveRatio="true" />
|
<AnchorPane prefHeight="143.0" prefWidth="270.0">
|
||||||
</children>
|
<children>
|
||||||
</FlowPane>
|
<HBox prefHeight="144.0" prefWidth="270.0" styleClass="background" AnchorPane.bottomAnchor="-1.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||||
|
<children>
|
||||||
|
<ImageView fitHeight="95.0" fitWidth="88.0" pickOnBounds="true" preserveRatio="true" />
|
||||||
|
</children>
|
||||||
|
</HBox>
|
||||||
|
</children>
|
||||||
|
</AnchorPane>
|
||||||
|
</content>
|
||||||
|
<padding>
|
||||||
|
<Insets bottom="2.0" left="2.0" right="2.0" top="2.0" />
|
||||||
|
</padding>
|
||||||
|
</ScrollPane>
|
||||||
<Label styleClass="text" stylesheets="@style/plateau.css" text="Equipements" GridPane.columnIndex="2" />
|
<Label styleClass="text" stylesheets="@style/plateau.css" text="Equipements" GridPane.columnIndex="2" />
|
||||||
</children>
|
</children>
|
||||||
<padding>
|
<padding>
|
||||||
|
@ -19,6 +19,7 @@ public class GestionnaireEquipements {
|
|||||||
this.equipements.add(e);
|
this.equipements.add(e);
|
||||||
e.utiliser(this.j);
|
e.utiliser(this.j);
|
||||||
this.j.addToStat(Joueur.PLAYER_NB_EQUIPEMENTS, 1);
|
this.j.addToStat(Joueur.PLAYER_NB_EQUIPEMENTS, 1);
|
||||||
|
this.j.ajouterEquipementIHM(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void retirer(CarteEquipement e) {
|
public void retirer(CarteEquipement e) {
|
||||||
@ -26,7 +27,11 @@ public class GestionnaireEquipements {
|
|||||||
e.reverse(j);
|
e.reverse(j);
|
||||||
this.equipements.remove(e);
|
this.equipements.remove(e);
|
||||||
this.j.addToStat(Joueur.PLAYER_NB_EQUIPEMENTS, -1);
|
this.j.addToStat(Joueur.PLAYER_NB_EQUIPEMENTS, -1);
|
||||||
|
this.j.removeEquipementIHM(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<CarteEquipement> getEquipements() {
|
public List<CarteEquipement> getEquipements() {
|
||||||
|
@ -153,6 +153,21 @@ public class GestionnaireJeu {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void alterationVie(Joueur joueur, int valeur) {
|
||||||
|
|
||||||
|
Platform.runLater(() -> {
|
||||||
|
try {
|
||||||
|
pc.afficherAlterationVie(joueur,valeur);
|
||||||
|
|
||||||
|
} catch (IOException | InterruptedException e1) {
|
||||||
|
e1.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
this.waitPlateau();
|
||||||
|
}
|
||||||
|
|
||||||
public Joueur choisirJoueur(Joueur joueur, List<Joueur> joueurs, Contexte contexte) {
|
public Joueur choisirJoueur(Joueur joueur, List<Joueur> joueurs, Contexte contexte) {
|
||||||
Platform.runLater(() -> {
|
Platform.runLater(() -> {
|
||||||
try {
|
try {
|
||||||
@ -246,5 +261,17 @@ public class GestionnaireJeu {
|
|||||||
|
|
||||||
public RessourceLoader getRessourceLoader() {
|
public RessourceLoader getRessourceLoader() {
|
||||||
return this.ressourceLoader;
|
return this.ressourceLoader;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void ajouterEquipement(Joueur joueur, CarteEquipement e) {
|
||||||
|
pc.ajouterEquipement(joueur,e);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void retirerEquipement(Joueur joueur, CarteEquipement e) {
|
||||||
|
pc.retirerEquipement(joueur,e);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -68,6 +68,10 @@ public class Joueur {
|
|||||||
this.stats.put(key, valeur);
|
this.stats.put(key, valeur);
|
||||||
}
|
}
|
||||||
public void setStat(String key, int valeur) {
|
public void setStat(String key, int valeur) {
|
||||||
|
System.out.println(this.nom+" "+this);
|
||||||
|
if(key.contentEquals(PLAYER_HP)) {
|
||||||
|
this.plateau.alerationVie(this,valeur);
|
||||||
|
}
|
||||||
this.stats.put(key, valeur);
|
this.stats.put(key, valeur);
|
||||||
updateVictoirePlateau();
|
updateVictoirePlateau();
|
||||||
updateVie();
|
updateVie();
|
||||||
@ -250,9 +254,23 @@ public class Joueur {
|
|||||||
return this.plateau.choisirAdjacents(this);
|
return this.plateau.choisirAdjacents(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void ajouterEquipementIHM(CarteEquipement e) {
|
||||||
|
this.plateau.ajouterEquipementIHM(this,e);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void removeEquipementIHM(CarteEquipement e) {
|
||||||
|
this.plateau.retirerEquipementIHM(this,e);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public Joueur choisiParmisTous() {
|
public Joueur choisiParmisTous() {
|
||||||
return this.plateau.choisirParmisTous(this);
|
return this.plateau.choisirParmisTous(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -296,9 +296,7 @@ public class Plateau extends Thread{
|
|||||||
}else {
|
}else {
|
||||||
System.out.println("Il n'y a personne a attaquer.");
|
System.out.println("Il n'y a personne a attaquer.");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -465,4 +463,18 @@ public class Plateau extends Thread{
|
|||||||
public Object choisir(Joueur joueur, List<?> list, Class cls) {
|
public Object choisir(Joueur joueur, List<?> list, Class cls) {
|
||||||
return gj.choisir(joueur,list,cls);
|
return gj.choisir(joueur,list,cls);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void alerationVie(Joueur joueur, int valeur) {
|
||||||
|
gj.alterationVie(joueur,valeur);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ajouterEquipementIHM(Joueur joueur, CarteEquipement e) {
|
||||||
|
gj.ajouterEquipement(joueur,e);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void retirerEquipementIHM(Joueur joueur, CarteEquipement e) {
|
||||||
|
gj.retirerEquipement(joueur,e);
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user