Merge Charles
This commit is contained in:
commit
50658387d9
@ -8,8 +8,10 @@ import javafx.stage.Stage;
|
||||
public class PopUp {
|
||||
private Scene scene;
|
||||
private Stage popupwindow;
|
||||
private Pane pane;
|
||||
|
||||
public PopUp (Pane p, String titre) {
|
||||
|
||||
popupwindow = new Stage();
|
||||
popupwindow.initModality(Modality.APPLICATION_MODAL);
|
||||
popupwindow.setTitle(titre);
|
||||
|
28
src/ihm/controller/AfficherCarteController.java
Normal file
28
src/ihm/controller/AfficherCarteController.java
Normal file
@ -0,0 +1,28 @@
|
||||
package ihm.controller;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import javafx.fxml.Initializable;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.layout.Pane;
|
||||
|
||||
public class AfficherCarteController implements Initializable{
|
||||
|
||||
@FXML private Label nom;
|
||||
@FXML private Label competence;
|
||||
@FXML private Pane root;
|
||||
|
||||
private PlateauController plateau;
|
||||
|
||||
@Override
|
||||
public void initialize(URL arg0, ResourceBundle arg1) {
|
||||
System.out.println(root.getUserData());
|
||||
//nom.setText((String) root.getUserData());
|
||||
competence.setText("dfghjk");
|
||||
}
|
||||
|
||||
}
|
@ -7,23 +7,26 @@ import java.util.ResourceBundle;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import javafx.fxml.Initializable;
|
||||
import javafx.scene.image.Image;
|
||||
import javafx.scene.image.ImageView;
|
||||
import javafx.scene.input.MouseEvent;
|
||||
import javafx.scene.layout.BorderPane;
|
||||
import javafx.scene.layout.Pane;
|
||||
|
||||
public class MenuController implements Initializable{
|
||||
@FXML
|
||||
private Pane rootPane;
|
||||
@FXML private Pane rootPane;
|
||||
@FXML private ImageView titre;
|
||||
|
||||
@Override
|
||||
public void initialize(URL arg0, ResourceBundle arg1) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
//Image image = new Image("../ressources/img/logo.png");
|
||||
//titre.setImage(image);
|
||||
}
|
||||
|
||||
@FXML
|
||||
public void commencerPartie(MouseEvent mouseEvent) throws IOException{
|
||||
System.out.println("Passage à l'écran de choix des joueurs");
|
||||
System.out.println("Passage à l'écran de choix des joueurs");
|
||||
BorderPane pane = FXMLLoader.load(getClass().getResource("../ressources/Choix_joueur.fxml"));
|
||||
rootPane.getChildren().setAll(pane);
|
||||
}
|
||||
|
@ -11,6 +11,7 @@ import ihm.PopUp;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import javafx.fxml.Initializable;
|
||||
import javafx.scene.Parent;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.layout.Pane;
|
||||
@ -38,9 +39,7 @@ public class PlateauController implements Initializable {
|
||||
|
||||
|
||||
/**
|
||||
* attribuer les cartes
|
||||
* ecrire le nom des joueurs au bon endroit
|
||||
* placer les cartes lieux
|
||||
* initialise les données du plateau
|
||||
*/
|
||||
@Override
|
||||
public void initialize(URL arg0, ResourceBundle arg1) {
|
||||
@ -84,8 +83,7 @@ public class PlateauController implements Initializable {
|
||||
/**
|
||||
* Affiche aux yeux de tous la carte personnage du joueur
|
||||
*
|
||||
* @param mouseEvent : clique sur le bouton "Se reveler"
|
||||
* @throws IOException
|
||||
* @param j : Le joueur sur lequel on a cliqué
|
||||
*/
|
||||
public void seReveler(Joueur j) throws IOException {
|
||||
System.out.println("Le joueur ... se revèle");
|
||||
@ -97,12 +95,13 @@ public class PlateauController implements Initializable {
|
||||
/**
|
||||
* Permet de consulter sa carte perssonage en cas d'oublie
|
||||
*
|
||||
* @param mouseEvent : clique sur le bouton "Carte personnage"
|
||||
* @throws IOException
|
||||
* @param j : Le joueur sur lequel on a cliqué
|
||||
*/
|
||||
public void consulterSaCarte(Joueur j) throws IOException {
|
||||
System.out.println("Le joueur ... consulte sa carte");
|
||||
Pane pane = FXMLLoader.load(getClass().getResource("../ressources/afficher_carte_perso.fxml"));
|
||||
pane.setUserData("blblblb");
|
||||
System.out.println(pane.getUserData());
|
||||
PopUp popup = new PopUp(pane, "Consulter sa carte");
|
||||
popup.display();
|
||||
}
|
||||
|
@ -17,7 +17,7 @@
|
||||
<Insets bottom="10.0" />
|
||||
</BorderPane.margin>
|
||||
<font>
|
||||
<Font size="36.0" />
|
||||
<Font size="24.0" />
|
||||
</font></Button>
|
||||
</bottom>
|
||||
<top>
|
||||
|
@ -1,26 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.scene.control.Button?>
|
||||
<?import javafx.scene.control.Label?>
|
||||
<?import javafx.scene.image.ImageView?>
|
||||
<?import javafx.scene.layout.Pane?>
|
||||
<?import javafx.scene.text.Font?>
|
||||
|
||||
<Pane id="rootPane" fx:id="rootPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="800.0" prefWidth="1280.0" styleClass="background" stylesheets="@style/menu.css" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ihm.controller.MenuController">
|
||||
<children>
|
||||
<Label layoutX="437.0" layoutY="193.0" styleClass="titre" text="Shadow Hunters">
|
||||
<font>
|
||||
<Font size="48.0" />
|
||||
</font>
|
||||
</Label>
|
||||
<Button layoutX="553.0" layoutY="296.0" mnemonicParsing="false" onMouseClicked="#commencerPartie" prefHeight="51.0" prefWidth="102.0" styleClass="bouton" text="Jouer">
|
||||
<Button layoutX="575.0" layoutY="303.0" mnemonicParsing="false" onMouseClicked="#commencerPartie" prefHeight="51.0" prefWidth="102.0" styleClass="bouton" text="Jouer">
|
||||
<font>
|
||||
<Font size="24.0" />
|
||||
</font>
|
||||
</Button>
|
||||
<Button layoutX="554.0" layoutY="387.0" mnemonicParsing="false" onMouseClicked="#afficherRegle" styleClass="bouton" text="Regles">
|
||||
<Button layoutX="574.0" layoutY="389.0" mnemonicParsing="false" onMouseClicked="#afficherRegle" styleClass="bouton" text="Regles">
|
||||
<font>
|
||||
<Font size="24.0" />
|
||||
</font>
|
||||
</Button>
|
||||
<ImageView fx:id="titre" fitHeight="190.0" fitWidth="528.0" layoutX="364.0" layoutY="69.0" pickOnBounds="true" preserveRatio="true" />
|
||||
</children>
|
||||
</Pane>
|
||||
|
@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import java.lang.String?>
|
||||
<?import javafx.geometry.Insets?>
|
||||
<?import javafx.scene.control.Button?>
|
||||
<?import javafx.scene.control.Label?>
|
||||
@ -312,15 +313,29 @@
|
||||
<HBox prefHeight="496.0" prefWidth="869.0" BorderPane.alignment="CENTER">
|
||||
<children>
|
||||
<VBox alignment="CENTER" prefHeight="496.0" prefWidth="22.0">
|
||||
<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" styleClass="background" />
|
||||
</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" />
|
||||
<ImageView fitHeight="97.8" fitWidth="70.05" pickOnBounds="true" preserveRatio="true">
|
||||
</children>
|
||||
<VBox.margin>
|
||||
<Insets bottom="30.0" top="30.0" />
|
||||
</VBox.margin>
|
||||
</ImageView>
|
||||
</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>
|
||||
<HBox.margin>
|
||||
<Insets right="15.0" />
|
||||
</HBox.margin>
|
||||
</VBox>
|
||||
<VBox prefHeight="496.0" prefWidth="739.0">
|
||||
<children>
|
||||
@ -419,7 +434,7 @@
|
||||
<HBox prefHeight="58.0" prefWidth="655.0">
|
||||
<children>
|
||||
<HBox prefHeight="100.0" prefWidth="0.0" />
|
||||
<HBox alignment="CENTER" prefHeight="64.0" prefWidth="50.0" styleClass="barreDeVie" stylesheets="@style/plateau.css">
|
||||
<HBox alignment="CENTER" prefHeight="64.0" prefWidth="50.0" stylesheets="@style/plateau.css">
|
||||
<children>
|
||||
<VBox prefHeight="87.0" prefWidth="2.0">
|
||||
<children>
|
||||
@ -438,30 +453,50 @@
|
||||
</children>
|
||||
</VBox>
|
||||
</children>
|
||||
<styleClass>
|
||||
<String fx:value="barreDeVie" />
|
||||
<String fx:value="zero" />
|
||||
</styleClass>
|
||||
</HBox>
|
||||
<HBox prefHeight="100.0" prefWidth="50.0" styleClass="barreDeVie" stylesheets="@style/plateau.css">
|
||||
<HBox prefHeight="100.0" prefWidth="50.0" stylesheets="@style/plateau.css">
|
||||
<children>
|
||||
<VBox prefHeight="64.0" prefWidth="25.0" />
|
||||
<VBox prefHeight="200.0" prefWidth="25.0" />
|
||||
</children>
|
||||
<styleClass>
|
||||
<String fx:value="barreDeVie" />
|
||||
<String fx:value="un" />
|
||||
</styleClass>
|
||||
</HBox>
|
||||
<HBox prefHeight="100.0" prefWidth="50.0" styleClass="barreDeVie" stylesheets="@style/plateau.css">
|
||||
<HBox prefHeight="100.0" prefWidth="50.0" stylesheets="@style/plateau.css">
|
||||
<children>
|
||||
<VBox prefHeight="64.0" prefWidth="25.0" />
|
||||
<VBox prefHeight="200.0" prefWidth="25.0" />
|
||||
</children>
|
||||
<styleClass>
|
||||
<String fx:value="barreDeVie" />
|
||||
<String fx:value="deux" />
|
||||
</styleClass>
|
||||
</HBox>
|
||||
<HBox prefHeight="100.0" prefWidth="50.0" styleClass="barreDeVie" stylesheets="@style/plateau.css">
|
||||
<HBox prefHeight="100.0" prefWidth="50.0" stylesheets="@style/plateau.css">
|
||||
<children>
|
||||
<VBox prefHeight="64.0" prefWidth="25.0" />
|
||||
<VBox prefHeight="200.0" prefWidth="25.0" />
|
||||
</children>
|
||||
<styleClass>
|
||||
<String fx:value="barreDeVie" />
|
||||
<String fx:value="trois" />
|
||||
</styleClass>
|
||||
</HBox>
|
||||
<HBox prefHeight="100.0" prefWidth="50.0" styleClass="barreDeVie" stylesheets="@style/plateau.css">
|
||||
<HBox prefHeight="100.0" prefWidth="50.0" stylesheets="@style/plateau.css">
|
||||
<children>
|
||||
<VBox prefHeight="64.0" prefWidth="25.0" />
|
||||
<VBox prefHeight="200.0" prefWidth="25.0" />
|
||||
</children>
|
||||
<styleClass>
|
||||
<String fx:value="barreDeVie" />
|
||||
<String fx:value="quatre" />
|
||||
</styleClass>
|
||||
</HBox>
|
||||
<HBox prefHeight="100.0" prefWidth="50.0" styleClass="barreDeVie" stylesheets="@style/plateau.css">
|
||||
<children>
|
||||
@ -548,15 +583,29 @@
|
||||
</children>
|
||||
</VBox>
|
||||
<VBox alignment="CENTER" prefHeight="496.0" prefWidth="29.0">
|
||||
<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" />
|
||||
<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>
|
||||
</ImageView>
|
||||
</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>
|
||||
<HBox.margin>
|
||||
<Insets left="15.0" />
|
||||
</HBox.margin>
|
||||
</VBox>
|
||||
</children>
|
||||
</HBox>
|
||||
|
@ -7,10 +7,9 @@
|
||||
<?import javafx.scene.layout.VBox?>
|
||||
<?import javafx.scene.text.Font?>
|
||||
|
||||
|
||||
<Pane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1">
|
||||
<Pane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ihm.controller.AfficherCarteController">
|
||||
<children>
|
||||
<VBox alignment="CENTER" layoutY="-1.0" prefHeight="400.0" prefWidth="600.0">
|
||||
<VBox fx:id="root" alignment="CENTER" layoutY="-1.0" prefHeight="400.0" prefWidth="600.0">
|
||||
<children>
|
||||
<Label text="Vous êtes :">
|
||||
<font>
|
||||
@ -22,7 +21,7 @@
|
||||
<ImageView fitHeight="326.0" fitWidth="233.5" pickOnBounds="true" preserveRatio="true" />
|
||||
<VBox alignment="CENTER" prefHeight="326.0" prefWidth="319.0">
|
||||
<children>
|
||||
<Label text="Nom Personnage">
|
||||
<Label fx:id="nom" text="Nom Personnage">
|
||||
<font>
|
||||
<Font size="18.0" />
|
||||
</font>
|
||||
@ -32,7 +31,7 @@
|
||||
<Font size="18.0" />
|
||||
</font>
|
||||
</Label>
|
||||
<Label text="Text compétance">
|
||||
<Label fx:id="competence" text="Text compétance">
|
||||
<font>
|
||||
<Font size="18.0" />
|
||||
</font>
|
||||
|
BIN
src/ihm/ressources/img/logo.png
Normal file
BIN
src/ihm/ressources/img/logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 262 KiB |
@ -7,17 +7,37 @@
|
||||
}
|
||||
|
||||
.barreDeVie{
|
||||
-fx-border-color: #e2e2e2;
|
||||
-fx-border-color: black;
|
||||
-fx-border-width: 2;
|
||||
-fx-background-color: #9b47a1;
|
||||
}
|
||||
|
||||
.zero {
|
||||
-fx-background-color: #7ab9e4;
|
||||
}
|
||||
|
||||
.un {
|
||||
-fx-background-color: #8e96d7;
|
||||
}
|
||||
|
||||
.deux {
|
||||
-fx-background-color: #9272bb;
|
||||
}
|
||||
|
||||
.trois {
|
||||
-fx-background-color: #9466b1;
|
||||
}
|
||||
|
||||
.quatre {
|
||||
-fx-background-color: #9855a5;
|
||||
}
|
||||
|
||||
.carteEquipement{
|
||||
-fx-border-color: #e2e2e2;
|
||||
-fx-border-width: 2;
|
||||
-fx-background-color: #353535;
|
||||
}
|
||||
|
||||
.lieux{
|
||||
-fx-border-color: #e2e2e2;
|
||||
-fx-border-color: #936b4a;
|
||||
-fx-border-width: 2;
|
||||
}
|
||||
|
||||
@ -29,3 +49,21 @@
|
||||
-fx-text-fill: #d8d8d8;
|
||||
-fx-background-insets: 0 0 0 0, 0, 1, 2;
|
||||
}
|
||||
|
||||
.carteLumiere {
|
||||
-fx-background-color: #edebea;
|
||||
-fx-border-color: #cecece;
|
||||
-fx-border-width: 2;
|
||||
}
|
||||
|
||||
.carteVision {
|
||||
-fx-background-color: #727e40;
|
||||
-fx-border-color: #53593a;
|
||||
-fx-border-width: 2;
|
||||
}
|
||||
|
||||
.carteTenebre {
|
||||
-fx-background-color: #2a2823;
|
||||
-fx-border-color: #5b5648;
|
||||
-fx-border-width: 2;
|
||||
}
|
@ -1,22 +1,37 @@
|
||||
package personnage;
|
||||
|
||||
import effet.Effet;
|
||||
import effet.EffetSelf;
|
||||
import effet.action.Action;
|
||||
import effet.action.ActionAltererStatistiquesJoueur;
|
||||
import main.Joueur;
|
||||
|
||||
public class Charles extends CartePersonnage{
|
||||
|
||||
//constructeur
|
||||
public Charles(String nom, String desc ,int hp, Joueur joueur) {
|
||||
super(nom,desc, hp, joueur);
|
||||
|
||||
public Charles(String nom, int hp, Joueur joueur) {
|
||||
super(nom, nom, hp, joueur);
|
||||
|
||||
Action action = new ActionAltererStatistiquesJoueur("HP",2,true);
|
||||
Effet effet = new EffetSelf(action);
|
||||
this.setEffet(effet);
|
||||
|
||||
}
|
||||
|
||||
//m<EFBFBD>thode
|
||||
public void attaquer(Joueur j) {
|
||||
|
||||
super.attaquer(j);
|
||||
if(this.getJoueur().getRevele())
|
||||
{
|
||||
utiliser(this.getJoueur());
|
||||
super.attaquer(j);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void utiliser() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
this.getEffet().utiliser(this.getJoueur());
|
||||
}
|
||||
}
|
||||
|
@ -95,4 +95,14 @@ class PlateauTest {
|
||||
assertNotEquals(lieuDepart, j1.getCarteLieu());
|
||||
}
|
||||
|
||||
@Test
|
||||
void deplacer_lieuDepartDifferentLieuArrive() {
|
||||
p.deplacer(j1);
|
||||
CarteLieu lieuDepart = j1.getCarteLieu();
|
||||
|
||||
p.deplacer(j1);
|
||||
|
||||
assertNotEquals(lieuDepart, j1.getCarteLieu());
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user