changement plateau
BIN
lib/postgresql-42.2.12.jar
Normal file
20
src/database/ByteaToCardImage.java
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
package database;
|
||||||
|
|
||||||
|
import java.io.ByteArrayInputStream;
|
||||||
|
import java.awt.image.BufferedImage;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import javax.imageio.ImageIO;
|
||||||
|
|
||||||
|
public class ByteaToCardImage {
|
||||||
|
|
||||||
|
public static BufferedImage getImg(byte[] imageData) {
|
||||||
|
ByteArrayInputStream bais = new ByteArrayInputStream(imageData);
|
||||||
|
try {
|
||||||
|
return ImageIO.read(bais);
|
||||||
|
} catch (IOException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,5 +1,7 @@
|
|||||||
package database;
|
package database;
|
||||||
|
|
||||||
|
import java.awt.image.BufferedImage;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
import java.sql.DriverManager;
|
import java.sql.DriverManager;
|
||||||
@ -10,30 +12,21 @@ import java.sql.Statement;
|
|||||||
|
|
||||||
public class DatabaseTesting {
|
public class DatabaseTesting {
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
Table a = new Table("a");
|
||||||
|
a.remplirTableAllFrom("CartesAll");
|
||||||
|
System.out.println(a.toString());
|
||||||
|
BufferedImage jpg = new BufferedImage(467, 652, 1);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
try (Connection connection = DriverManager.getConnection("jdbc:postgresql://localhost:5432/ShadowHunterDatabase", "shManager", "shadowhunter1234")) { //notre utilisateur que l'on utilisera (:
|
try {
|
||||||
|
ByteaToCardImage.getImg(a.getList().get(5).getImg());
|
||||||
System.out.println("Connected to PostgreSQL database!");
|
} catch (Exception e) {
|
||||||
Statement statement = connection.createStatement();
|
// TODO Auto-generated catch block
|
||||||
System.out.println("Reading records...");
|
|
||||||
System.out.printf("%-20.30s %-30.30s %-30.30s%n", "id", "nom", "image");
|
|
||||||
ResultSet resultSet = statement.executeQuery(QueryGenerator.AllFrom("CartesAll"));
|
|
||||||
//ResultSet resultSet = statement.executeQuery(QueryGenerator.WithId("CartesAll", 15));
|
|
||||||
//ResultSet resultSet = statement.executeQuery(QueryGenerator.WithName("CartesAll", "Vision Cupide"));
|
|
||||||
while (resultSet.next()) {
|
|
||||||
System.out.printf("%-20.30s %-30.30s %-20.30s%n", resultSet.getString("id"), resultSet.getString("nom"), resultSet.getBytes("image")); //resultSet.getBytes("image"));
|
|
||||||
}
|
|
||||||
|
|
||||||
} catch (SQLException e) {
|
|
||||||
System.out.println("Connection failure.");
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Table a = new Table("a");
|
|
||||||
a.remplirTable("CartesLumiere");
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,12 +10,12 @@ public class QueryGenerator {
|
|||||||
return "SELECT * FROM " + getTable(table) + "WHERE id =" + d;
|
return "SELECT * FROM " + getTable(table) + "WHERE id =" + d;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String WithName(String s, String name) {
|
public static String WithName(String table, String name) {
|
||||||
return "SELECT * FROM " + getTable(s) + "WHERE nom ='" + name + "'";
|
return "SELECT * FROM " + getTable(table) + "WHERE nom ='" + name + "'";
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getTable(String s) {
|
public static String getTable(String s) {
|
||||||
return "public.\"" + s + "\"";
|
return "public." + '"' + s + '"';
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -36,5 +36,9 @@ public class Record {
|
|||||||
return img;
|
return img;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String toString() {
|
||||||
|
return String.format("%-20.30s %-30.30s %-20.30s%n", this.getId(), this.getNom(), this.getImg());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,7 @@ public class Table {
|
|||||||
this.name = JavaTableName;
|
this.name = JavaTableName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void remplirTable(String DatabaseTableName) {
|
public void remplirTableAllFrom(String DatabaseTableName) {
|
||||||
try (Connection connection = DriverManager.getConnection("jdbc:postgresql://localhost:5432/ShadowHunterDatabase", "shManager", "shadowhunter1234")) { //notre utilisateur que l'on utilisera (:
|
try (Connection connection = DriverManager.getConnection("jdbc:postgresql://localhost:5432/ShadowHunterDatabase", "shManager", "shadowhunter1234")) { //notre utilisateur que l'on utilisera (:
|
||||||
|
|
||||||
System.out.println("Connected to PostgreSQL database!");
|
System.out.println("Connected to PostgreSQL database!");
|
||||||
@ -25,9 +25,41 @@ public class Table {
|
|||||||
System.out.println("Reading records...");
|
System.out.println("Reading records...");
|
||||||
ResultSet retour = statement.executeQuery(QueryGenerator.AllFrom(DatabaseTableName));
|
ResultSet retour = statement.executeQuery(QueryGenerator.AllFrom(DatabaseTableName));
|
||||||
while (retour.next()) {
|
while (retour.next()) {
|
||||||
Record r = new Record(retour.getString("id"), retour.getString("nom"), retour.getBytes("image"));
|
list.add(new Record(retour.getString("id"), retour.getString("nom"), retour.getBytes("image")));
|
||||||
list.add(r);
|
}
|
||||||
System.out.printf("%-20.30s %-30.30s %-20.30s%n", retour.getString("id"), retour.getString("nom"), retour.getBytes("image"));
|
|
||||||
|
} catch (SQLException e) {
|
||||||
|
System.out.println("Connection failure.");
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void remplirTableWithId(String DatabaseTableName, int id) {
|
||||||
|
try (Connection connection = DriverManager.getConnection("jdbc:postgresql://localhost:5432/ShadowHunterDatabase", "shManager", "shadowhunter1234")) { //notre utilisateur que l'on utilisera (:
|
||||||
|
|
||||||
|
System.out.println("Connected to PostgreSQL database!");
|
||||||
|
Statement statement = connection.createStatement();
|
||||||
|
System.out.println("Reading records...");
|
||||||
|
ResultSet retour = statement.executeQuery(QueryGenerator.WithId(DatabaseTableName, id));
|
||||||
|
while (retour.next()) {
|
||||||
|
list.add(new Record(retour.getString("id"), retour.getString("nom"), retour.getBytes("image")));
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (SQLException e) {
|
||||||
|
System.out.println("Connection failure.");
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void remplirTableWithName(String DatabaseTableName, String s) {
|
||||||
|
try (Connection connection = DriverManager.getConnection("jdbc:postgresql://localhost:5432/ShadowHunterDatabase", "shManager", "shadowhunter1234")) { //notre utilisateur que l'on utilisera (:
|
||||||
|
|
||||||
|
System.out.println("Connected to PostgreSQL database!");
|
||||||
|
Statement statement = connection.createStatement();
|
||||||
|
System.out.println("Reading records...");
|
||||||
|
ResultSet retour = statement.executeQuery(QueryGenerator.WithName(DatabaseTableName, s));
|
||||||
|
while (retour.next()) {
|
||||||
|
list.add(new Record(retour.getString("id"), retour.getString("nom"), retour.getBytes("image")));
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
@ -48,6 +80,10 @@ public class Table {
|
|||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String toString() {
|
||||||
|
return " " + this.getList();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
60
src/ihm/Dice.java
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
package ihm;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author https://www.programcreek.com/java-api-examples/?code=AlmasB%2FFXTutorials%2FFXTutorials-master%2Fsrc%2Fcom%2Falmasb%2Ftutorial5%2FDice.java
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
import javafx.animation.RotateTransition;
|
||||||
|
import javafx.beans.property.SimpleIntegerProperty;
|
||||||
|
import javafx.geometry.Pos;
|
||||||
|
import javafx.scene.layout.StackPane;
|
||||||
|
import javafx.scene.paint.Color;
|
||||||
|
import javafx.scene.shape.Rectangle;
|
||||||
|
import javafx.scene.text.Text;
|
||||||
|
import javafx.util.Duration;
|
||||||
|
|
||||||
|
public class Dice extends StackPane {
|
||||||
|
|
||||||
|
public static int MAX_VALUE = 6;
|
||||||
|
public static final int MIN_VALUE = 1;
|
||||||
|
|
||||||
|
public final SimpleIntegerProperty valueProperty = new SimpleIntegerProperty();
|
||||||
|
|
||||||
|
int i = 0;
|
||||||
|
|
||||||
|
public Dice(int valeurMax) {
|
||||||
|
|
||||||
|
MAX_VALUE = valeurMax;
|
||||||
|
Rectangle rect = new Rectangle(50, 50);
|
||||||
|
|
||||||
|
Text text = new Text();
|
||||||
|
text.setFill(Color.WHITE);
|
||||||
|
text.textProperty().bind(valueProperty.asString());
|
||||||
|
|
||||||
|
this.setAlignment(Pos.CENTER);
|
||||||
|
getChildren().addAll(rect, text);
|
||||||
|
|
||||||
|
this.setOnMouseClicked(event -> roll());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void roll() {
|
||||||
|
RotateTransition rt = new RotateTransition(Duration.seconds(0.5), this);
|
||||||
|
rt.setFromAngle(0);
|
||||||
|
rt.setToAngle(360);
|
||||||
|
int cycles = 2000;
|
||||||
|
|
||||||
|
rt.setOnFinished(event -> {
|
||||||
|
|
||||||
|
valueProperty.set((int)(Math.random() * (MAX_VALUE - MIN_VALUE + 1)) + MIN_VALUE);
|
||||||
|
|
||||||
|
if(cycles < i) {
|
||||||
|
|
||||||
|
rt.play();
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
rt.play();
|
||||||
|
}
|
||||||
|
}
|
@ -23,6 +23,7 @@ public class Main extends Application {
|
|||||||
primaryStage.setTitle("Shadow Hunters");
|
primaryStage.setTitle("Shadow Hunters");
|
||||||
primaryStage.setScene(new Scene(root));
|
primaryStage.setScene(new Scene(root));
|
||||||
primaryStage.centerOnScreen();
|
primaryStage.centerOnScreen();
|
||||||
|
primaryStage.setMaximized(true);
|
||||||
primaryStage.show();
|
primaryStage.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,10 +21,6 @@ public class PopUpBoolean {
|
|||||||
private double xOffSet = 0;
|
private double xOffSet = 0;
|
||||||
private double yOffSet = 0;
|
private double yOffSet = 0;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public PopUpBoolean (Parent p, String titre) {
|
public PopUpBoolean (Parent p, String titre) {
|
||||||
|
|
||||||
|
|
||||||
@ -62,8 +58,6 @@ public class PopUpBoolean {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public boolean display() {
|
public boolean display() {
|
||||||
|
|
||||||
popup.setScene(scene);
|
popup.setScene(scene);
|
||||||
|
@ -45,3 +45,4 @@ public class SpriteAnimation extends Transition {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,14 +23,13 @@ public class ChoisirBoolean implements Initializable{
|
|||||||
public void initialize(URL arg0, ResourceBundle arg1) {
|
public void initialize(URL arg0, ResourceBundle arg1) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
public void choixOui(MouseEvent mouseEvent) throws IOException{
|
public void choixOui(MouseEvent mouseEvent) throws IOException{
|
||||||
PopUpBoolean.result = true;
|
PopUpBoolean.result = true;
|
||||||
final Node source = (Node) mouseEvent.getSource();
|
final Node source = (Node) mouseEvent.getSource();
|
||||||
final Stage stage = (Stage) source.getScene().getWindow();
|
final Stage stage = (Stage) source.getScene().getWindow();
|
||||||
stage.close();
|
stage.close();
|
||||||
return;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
@ -40,6 +39,5 @@ public class ChoisirBoolean implements Initializable{
|
|||||||
final Node source = (Node) mouseEvent.getSource();
|
final Node source = (Node) mouseEvent.getSource();
|
||||||
final Stage stage = (Stage) source.getScene().getWindow();
|
final Stage stage = (Stage) source.getScene().getWindow();
|
||||||
stage.close();
|
stage.close();
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
37
src/ihm/controller/MenuJoueurController.java
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
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.Parent;
|
||||||
|
import javafx.scene.control.SplitPane;
|
||||||
|
import javafx.scene.image.ImageView;
|
||||||
|
import javafx.scene.input.MouseEvent;
|
||||||
|
import javafx.scene.layout.AnchorPane;
|
||||||
|
|
||||||
|
public class MenuJoueurController implements Initializable{
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void initialize(URL arg0, ResourceBundle arg1) {
|
||||||
|
//nomJoueur.setText(joueur.getNom());
|
||||||
|
}
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
public void changeZoneToScrollPaneJoueur(MouseEvent me) throws IOException {
|
||||||
|
|
||||||
|
AnchorPane bp = FXMLLoader.load(getClass().getResource("../ressources/ScrollPaneJoueur.fxml"));
|
||||||
|
ImageView iv = ((ImageView)me.getSource());
|
||||||
|
Parent p = iv.getParent().getParent();
|
||||||
|
AnchorPane ap = (AnchorPane)p;
|
||||||
|
ap.getChildren().setAll(bp);
|
||||||
|
AnchorPane.setTopAnchor(bp, 0.0);
|
||||||
|
AnchorPane.setBottomAnchor(bp, 0.0);
|
||||||
|
AnchorPane.setLeftAnchor(bp, 0.0);
|
||||||
|
AnchorPane.setRightAnchor(bp, 0.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -11,9 +11,15 @@ import java.util.ResourceBundle;
|
|||||||
|
|
||||||
import ihm.PopUp;
|
import ihm.PopUp;
|
||||||
import ihm.PopUpBoolean;
|
import ihm.PopUpBoolean;
|
||||||
|
import ihm.SpriteAnimation;
|
||||||
|
import javafx.animation.Animation;
|
||||||
|
import javafx.event.Event;
|
||||||
|
import javafx.event.EventHandler;
|
||||||
import javafx.fxml.FXML;
|
import javafx.fxml.FXML;
|
||||||
import javafx.fxml.FXMLLoader;
|
import javafx.fxml.FXMLLoader;
|
||||||
import javafx.fxml.Initializable;
|
import javafx.fxml.Initializable;
|
||||||
|
import javafx.geometry.Rectangle2D;
|
||||||
|
import javafx.scene.Group;
|
||||||
import javafx.scene.Parent;
|
import javafx.scene.Parent;
|
||||||
import javafx.scene.control.Button;
|
import javafx.scene.control.Button;
|
||||||
import javafx.scene.control.Label;
|
import javafx.scene.control.Label;
|
||||||
@ -21,6 +27,10 @@ import javafx.scene.image.ImageView;
|
|||||||
import javafx.scene.layout.AnchorPane;
|
import javafx.scene.layout.AnchorPane;
|
||||||
import javafx.scene.layout.HBox;
|
import javafx.scene.layout.HBox;
|
||||||
import javafx.scene.layout.VBox;
|
import javafx.scene.layout.VBox;
|
||||||
|
<<<<<<< HEAD
|
||||||
|
=======
|
||||||
|
import javafx.util.Duration;
|
||||||
|
>>>>>>> eea99d2341b1df015a2831034aa39534addff16e
|
||||||
import main.Joueur;
|
import main.Joueur;
|
||||||
import main.View;
|
import main.View;
|
||||||
|
|
||||||
@ -41,6 +51,10 @@ public class PlateauController implements Initializable {
|
|||||||
@FXML private VBox joueur7;
|
@FXML private VBox joueur7;
|
||||||
@FXML private VBox joueur8;
|
@FXML private VBox joueur8;
|
||||||
|
|
||||||
|
public static int DICE_SIX = 2;
|
||||||
|
public static int DICE_QUATRE = 1;
|
||||||
|
public static int DICE_BOTH = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* initialise les données du plateau
|
* initialise les données du plateau
|
||||||
*/
|
*/
|
||||||
@ -121,8 +135,6 @@ public class PlateauController implements Initializable {
|
|||||||
|
|
||||||
PopUpBoolean popup = new PopUpBoolean(root, "Consulter sa carte");
|
PopUpBoolean popup = new PopUpBoolean(root, "Consulter sa carte");
|
||||||
return popup.display();
|
return popup.display();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -162,4 +174,11 @@ public class PlateauController implements Initializable {
|
|||||||
}
|
}
|
||||||
}*/
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void rollDice(Joueur joueur, int typeDice, int[] rolls) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
182
src/ihm/controller/PlateauControllerTest.java
Normal file
@ -0,0 +1,182 @@
|
|||||||
|
package ihm.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.net.URL;
|
||||||
|
import java.util.ResourceBundle;
|
||||||
|
|
||||||
|
import ihm.PopUpBoolean;
|
||||||
|
import javafx.fxml.FXML;
|
||||||
|
import javafx.fxml.FXMLLoader;
|
||||||
|
import javafx.fxml.Initializable;
|
||||||
|
import javafx.scene.Parent;
|
||||||
|
import javafx.scene.control.ScrollPane;
|
||||||
|
import javafx.scene.image.ImageView;
|
||||||
|
import javafx.scene.layout.AnchorPane;
|
||||||
|
import javafx.scene.layout.BorderPane;
|
||||||
|
import javafx.scene.layout.GridPane;
|
||||||
|
import javafx.scene.layout.Pane;
|
||||||
|
import main.Joueur;
|
||||||
|
|
||||||
|
public class PlateauControllerTest implements Initializable {
|
||||||
|
|
||||||
|
|
||||||
|
@FXML private BorderPane root;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* initialise les donn<EFBFBD>es du plateau
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void initialize(URL arg0, ResourceBundle arg1) {
|
||||||
|
//initialisation des attributs des joueurs
|
||||||
|
|
||||||
|
for(int i = 0; i < 8; i++) {
|
||||||
|
|
||||||
|
|
||||||
|
AnchorPane ap = getAnchorPaneJoueur(i);
|
||||||
|
Pane p;
|
||||||
|
try {
|
||||||
|
p = FXMLLoader.load(getClass().getResource("../ressources/MenuJoueur.fxml"));
|
||||||
|
if(i > 1 && i < 3) {
|
||||||
|
rotateContent(p, 90);
|
||||||
|
}
|
||||||
|
setContentAnchorPane(ap, p);
|
||||||
|
} catch (IOException e) {
|
||||||
|
// TODO Auto-generated catch block
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public GridPane getGridPaneJoueur(int pos) {
|
||||||
|
|
||||||
|
int position = pos%8 / 2;
|
||||||
|
|
||||||
|
position++;
|
||||||
|
|
||||||
|
AnchorPane apParent = (AnchorPane) root.getChildren().get(position);
|
||||||
|
|
||||||
|
GridPane gp = (GridPane) apParent.getChildren().get(0);
|
||||||
|
|
||||||
|
return (GridPane) gp.getChildren().get(pos%2);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public AnchorPane getAnchorPaneJoueur(int pos) {
|
||||||
|
|
||||||
|
GridPane gp = getGridPaneJoueur(pos);
|
||||||
|
return (AnchorPane) gp.getChildren().get(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ImageView getImageViewJoueur(int pos) {
|
||||||
|
|
||||||
|
GridPane gp = getGridPaneJoueur(pos);
|
||||||
|
return (ImageView) gp.getChildren().get(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ScrollPane getScrollPaneJoueur(int pos) {
|
||||||
|
|
||||||
|
GridPane gp = getGridPaneJoueur(pos);
|
||||||
|
return (ScrollPane) gp.getChildren().get(2);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void setContentAnchorPane(AnchorPane ap, Pane p) {
|
||||||
|
|
||||||
|
ap.getChildren().setAll(p);
|
||||||
|
|
||||||
|
AnchorPane.setTopAnchor(p, 0.0);
|
||||||
|
AnchorPane.setBottomAnchor(p, 0.0);
|
||||||
|
AnchorPane.setLeftAnchor(p, 0.0);
|
||||||
|
AnchorPane.setRightAnchor(p, 0.0);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void rotateContent(Pane p, double rotation) {
|
||||||
|
p.setRotate(rotation);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
int OFFSET_X = 0;
|
||||||
|
int OFFSET_Y = 0;
|
||||||
|
int WIDTH = 557;
|
||||||
|
int HEIGHT = 557;
|
||||||
|
int COUNT = 6;
|
||||||
|
int COLUMNS = 6;
|
||||||
|
|
||||||
|
//anchorPane1.getChildren().setAll(imageView);
|
||||||
|
|
||||||
|
|
||||||
|
ImageView imageView;
|
||||||
|
try {
|
||||||
|
imageView = FXMLLoader.load(getClass().getResource("../ressources/Dés.fxml"));
|
||||||
|
imageView.setViewport(new Rectangle2D(OFFSET_X, OFFSET_Y, WIDTH, HEIGHT));
|
||||||
|
|
||||||
|
imageView.fitWidthProperty().bind(anchorPane1.widthProperty());
|
||||||
|
final SpriteAnimation animation = new SpriteAnimation(
|
||||||
|
imageView,
|
||||||
|
Duration.millis(250),
|
||||||
|
COUNT, COLUMNS,
|
||||||
|
OFFSET_X, OFFSET_Y,
|
||||||
|
WIDTH, HEIGHT
|
||||||
|
);
|
||||||
|
animation.setCycleCount(Animation.INDEFINITE);
|
||||||
|
animation.play();
|
||||||
|
anchorPane1.getChildren().addAll(new Group(imageView));
|
||||||
|
anchorPane1.setOnMousePressed(new EventHandler<Event>(
|
||||||
|
|
||||||
|
) {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void handle(Event arg0) {
|
||||||
|
animation.stop();
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} catch (IOException e) {
|
||||||
|
// TODO Auto-generated catch block
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Affiche aux yeux de tous la carte personnage du joueur
|
||||||
|
*
|
||||||
|
* @param j : Le joueur sur lequel on a cliqu<EFBFBD>
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
public boolean choisir(Joueur j) throws IOException {
|
||||||
|
|
||||||
|
FXMLLoader loader = new FXMLLoader(getClass().getResource("../ressources/choisirBoolean.fxml"));
|
||||||
|
Parent root = loader.load();
|
||||||
|
|
||||||
|
PopUpBoolean popup = new PopUpBoolean(root, "Consulter sa carte");
|
||||||
|
return popup.display();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void rollDice(Joueur j, int typeDice, int[] resultats) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Permet de consulter sa carte perssonage en cas d'oublie
|
||||||
|
*
|
||||||
|
* @param j : Le joueur sur lequel on a cliqu<EFBFBD>
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -16,8 +16,6 @@ import javafx.fxml.Initializable;
|
|||||||
import javafx.scene.Node;
|
import javafx.scene.Node;
|
||||||
import javafx.scene.Parent;
|
import javafx.scene.Parent;
|
||||||
import javafx.scene.Scene;
|
import javafx.scene.Scene;
|
||||||
import javafx.scene.control.Alert;
|
|
||||||
import javafx.scene.control.Alert.AlertType;
|
|
||||||
import javafx.scene.control.Button;
|
import javafx.scene.control.Button;
|
||||||
import javafx.scene.control.CheckBox;
|
import javafx.scene.control.CheckBox;
|
||||||
import javafx.scene.control.TextField;
|
import javafx.scene.control.TextField;
|
||||||
|
44
src/ihm/controller/ScrollPaneJoueurController.java
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
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.Parent;
|
||||||
|
import javafx.scene.control.SplitPane;
|
||||||
|
import javafx.scene.image.ImageView;
|
||||||
|
import javafx.scene.input.MouseEvent;
|
||||||
|
import javafx.scene.layout.AnchorPane;
|
||||||
|
import javafx.scene.layout.BorderPane;
|
||||||
|
import javafx.scene.layout.Pane;
|
||||||
|
|
||||||
|
public class ScrollPaneJoueurController implements Initializable{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void initialize(URL arg0, ResourceBundle arg1) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
public void changeZoneJoueurToMenuJoueur(MouseEvent me) throws IOException {
|
||||||
|
|
||||||
|
BorderPane bp = FXMLLoader.load(getClass().getResource("../ressources/MenuJoueur.fxml"));
|
||||||
|
ImageView iv = ((ImageView)me.getSource());
|
||||||
|
Parent p = iv.getParent().getParent().getParent().getParent();
|
||||||
|
AnchorPane ap = (AnchorPane)p;
|
||||||
|
|
||||||
|
System.out.println(bp.getRotate()+" "+ ap.getRotate());
|
||||||
|
ap.getChildren().setAll(bp);
|
||||||
|
|
||||||
|
AnchorPane.setTopAnchor(bp, 0.0);
|
||||||
|
AnchorPane.setBottomAnchor(bp, 0.0);
|
||||||
|
AnchorPane.setLeftAnchor(bp, 0.0);
|
||||||
|
AnchorPane.setRightAnchor(bp, 0.0);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
11
src/ihm/ressources/Dialog.fxml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<?import javafx.scene.image.Image?>
|
||||||
|
<?import javafx.scene.image.ImageView?>
|
||||||
|
|
||||||
|
|
||||||
|
<ImageView fitHeight="202.0" fitWidth="173.0" preserveRatio="true" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1">
|
||||||
|
<image>
|
||||||
|
<Image url="@img/dé.png" />
|
||||||
|
</image>
|
||||||
|
</ImageView>
|
11
src/ihm/ressources/Dés.fxml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<?import javafx.scene.image.Image?>
|
||||||
|
<?import javafx.scene.image.ImageView?>
|
||||||
|
|
||||||
|
|
||||||
|
<ImageView fitHeight="189.0" fitWidth="379.0" preserveRatio="true" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1">
|
||||||
|
<image>
|
||||||
|
<Image url="@img/dice.sprite.png" />
|
||||||
|
</image>
|
||||||
|
</ImageView>
|
15
src/ihm/ressources/MenuJoueur.fxml
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<?import javafx.scene.image.Image?>
|
||||||
|
<?import javafx.scene.image.ImageView?>
|
||||||
|
<?import javafx.scene.layout.BorderPane?>
|
||||||
|
|
||||||
|
<BorderPane prefHeight="200.0" prefWidth="200.0" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ihm.controller.MenuJoueurController">
|
||||||
|
<top>
|
||||||
|
<ImageView fitHeight="34.0" fitWidth="32.0" onMousePressed="#changeZoneToScrollPaneJoueur" pickOnBounds="true" preserveRatio="true" BorderPane.alignment="CENTER_RIGHT">
|
||||||
|
<image>
|
||||||
|
<Image url="@img/menuButton.png" />
|
||||||
|
</image>
|
||||||
|
</ImageView>
|
||||||
|
</top>
|
||||||
|
</BorderPane>
|
585
src/ihm/ressources/PlateauTestPaul.fxml
Normal file
@ -0,0 +1,585 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<?import java.lang.String?>
|
||||||
|
<?import javafx.geometry.Insets?>
|
||||||
|
<?import javafx.scene.control.Label?>
|
||||||
|
<?import javafx.scene.control.ScrollPane?>
|
||||||
|
<?import javafx.scene.image.Image?>
|
||||||
|
<?import javafx.scene.image.ImageView?>
|
||||||
|
<?import javafx.scene.layout.AnchorPane?>
|
||||||
|
<?import javafx.scene.layout.BorderPane?>
|
||||||
|
<?import javafx.scene.layout.ColumnConstraints?>
|
||||||
|
<?import javafx.scene.layout.GridPane?>
|
||||||
|
<?import javafx.scene.layout.HBox?>
|
||||||
|
<?import javafx.scene.layout.RowConstraints?>
|
||||||
|
<?import javafx.scene.layout.VBox?>
|
||||||
|
<?import javafx.scene.shape.Circle?>
|
||||||
|
|
||||||
|
<AnchorPane prefHeight="976.0" prefWidth="1198.0" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ihm.controller.PlateauControllerTest">
|
||||||
|
<children>
|
||||||
|
<BorderPane fx:id="root" styleClass="background" stylesheets="@style/plateau.css" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||||
|
<center>
|
||||||
|
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" BorderPane.alignment="CENTER">
|
||||||
|
<children>
|
||||||
|
<HBox alignment="CENTER" spacing="10.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||||
|
<children>
|
||||||
|
<VBox alignment="CENTER" prefWidth="22.0" HBox.hgrow="NEVER">
|
||||||
|
<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" />
|
||||||
|
</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>
|
||||||
|
<VBox alignment="CENTER" HBox.hgrow="NEVER">
|
||||||
|
<children>
|
||||||
|
<HBox alignment="TOP_CENTER">
|
||||||
|
<children>
|
||||||
|
<VBox alignment="CENTER">
|
||||||
|
<children>
|
||||||
|
<Circle fill="#ff1f1f" radius="10.0" stroke="BLACK" strokeType="INSIDE" />
|
||||||
|
<Circle fill="#ffd71f" radius="10.0" stroke="BLACK" strokeType="INSIDE" />
|
||||||
|
<Circle fill="#ecff1f" radius="10.0" stroke="BLACK" strokeType="INSIDE" />
|
||||||
|
<Circle fill="#64ff1f" radius="10.0" stroke="BLACK" strokeType="INSIDE" />
|
||||||
|
</children>
|
||||||
|
</VBox>
|
||||||
|
<HBox alignment="TOP_CENTER" styleClass="lieux" stylesheets="@style/plateau.css">
|
||||||
|
<children>
|
||||||
|
<ImageView fitHeight="132.03" fitWidth="94.5675" pickOnBounds="true" preserveRatio="true" />
|
||||||
|
<ImageView fitHeight="132.03" fitWidth="94.5675" pickOnBounds="true" preserveRatio="true">
|
||||||
|
<HBox.margin>
|
||||||
|
<Insets left="5.0" />
|
||||||
|
</HBox.margin>
|
||||||
|
</ImageView>
|
||||||
|
</children>
|
||||||
|
<HBox.margin>
|
||||||
|
<Insets left="10.0" />
|
||||||
|
</HBox.margin>
|
||||||
|
</HBox>
|
||||||
|
<HBox alignment="BOTTOM_CENTER" styleClass="lieux" stylesheets="@style/plateau.css">
|
||||||
|
<children>
|
||||||
|
<ImageView fitHeight="132.03" fitWidth="94.5675" pickOnBounds="true" preserveRatio="true" />
|
||||||
|
<ImageView fitHeight="132.03" fitWidth="94.5675" pickOnBounds="true" preserveRatio="true">
|
||||||
|
<HBox.margin>
|
||||||
|
<Insets left="5.0" />
|
||||||
|
</HBox.margin>
|
||||||
|
</ImageView>
|
||||||
|
</children>
|
||||||
|
<HBox.margin>
|
||||||
|
<Insets left="5.0" />
|
||||||
|
</HBox.margin>
|
||||||
|
</HBox>
|
||||||
|
<HBox alignment="TOP_CENTER" styleClass="lieux" stylesheets="@style/plateau.css">
|
||||||
|
<children>
|
||||||
|
<ImageView fitHeight="132.03" fitWidth="94.5675" pickOnBounds="true" preserveRatio="true" />
|
||||||
|
<ImageView fitHeight="132.03" fitWidth="94.5675" pickOnBounds="true" preserveRatio="true">
|
||||||
|
<HBox.margin>
|
||||||
|
<Insets left="5.0" />
|
||||||
|
</HBox.margin>
|
||||||
|
</ImageView>
|
||||||
|
</children>
|
||||||
|
<HBox.margin>
|
||||||
|
<Insets left="5.0" right="10.0" />
|
||||||
|
</HBox.margin>
|
||||||
|
</HBox>
|
||||||
|
<VBox alignment="CENTER">
|
||||||
|
<children>
|
||||||
|
<Circle fill="#21ffee" radius="10.0" stroke="BLACK" strokeType="INSIDE" />
|
||||||
|
<Circle fill="#2168ff" radius="10.0" stroke="BLACK" strokeType="INSIDE" />
|
||||||
|
<Circle fill="#d921ff" radius="10.0" stroke="BLACK" strokeType="INSIDE" />
|
||||||
|
<Circle fill="#ff21ad" radius="10.0" stroke="BLACK" strokeType="INSIDE" />
|
||||||
|
</children>
|
||||||
|
</VBox>
|
||||||
|
</children>
|
||||||
|
</HBox>
|
||||||
|
<VBox alignment="BOTTOM_CENTER">
|
||||||
|
<children>
|
||||||
|
<HBox alignment="CENTER_RIGHT">
|
||||||
|
<children>
|
||||||
|
<Label alignment="CENTER" contentDisplay="CENTER" styleClass="text" stylesheets="@style/plateau.css" text="Allie" />
|
||||||
|
<VBox alignment="CENTER">
|
||||||
|
<children>
|
||||||
|
<Label styleClass="text" stylesheets="@style/plateau.css" text="Bob" />
|
||||||
|
<Label styleClass="text" stylesheets="@style/plateau.css" text="Emi" />
|
||||||
|
</children>
|
||||||
|
</VBox>
|
||||||
|
<VBox alignment="CENTER">
|
||||||
|
<children>
|
||||||
|
<Label styleClass="text" stylesheets="@style/plateau.css" text="Inconnu" />
|
||||||
|
<Label styleClass="text" stylesheets="@style/plateau.css" text="Charles" />
|
||||||
|
</children>
|
||||||
|
</VBox>
|
||||||
|
<Label alignment="CENTER" contentDisplay="CENTER" styleClass="text" stylesheets="@style/plateau.css" text="Franklin" />
|
||||||
|
<VBox alignment="CENTER">
|
||||||
|
<children>
|
||||||
|
<Label styleClass="text" stylesheets="@style/plateau.css" text="Vampire" />
|
||||||
|
<Label styleClass="text" stylesheets="@style/plateau.css" text="Daniel" />
|
||||||
|
</children>
|
||||||
|
</VBox>
|
||||||
|
<VBox alignment="CENTER">
|
||||||
|
<children>
|
||||||
|
<Label styleClass="text" stylesheets="@style/plateau.css" text="Loup-" />
|
||||||
|
<Label styleClass="text" stylesheets="@style/plateau.css" text="garou" />
|
||||||
|
<Label styleClass="text" stylesheets="@style/plateau.css" text="George" />
|
||||||
|
</children>
|
||||||
|
</VBox>
|
||||||
|
</children>
|
||||||
|
</HBox>
|
||||||
|
<HBox>
|
||||||
|
<children>
|
||||||
|
<HBox prefHeight="100.0" prefWidth="0.0" />
|
||||||
|
<HBox alignment="CENTER" prefHeight="64.0" prefWidth="50.0" stylesheets="@style/plateau.css">
|
||||||
|
<children>
|
||||||
|
<VBox prefHeight="87.0" prefWidth="2.0">
|
||||||
|
<children>
|
||||||
|
<Circle fill="#ff1f1f" radius="8.0" stroke="BLACK" strokeType="INSIDE" />
|
||||||
|
<Circle fill="#ffd71f" radius="8.0" stroke="BLACK" strokeType="INSIDE" />
|
||||||
|
<Circle fill="#ecff1f" radius="8.0" stroke="BLACK" strokeType="INSIDE" />
|
||||||
|
<Circle fill="#64ff1f" radius="8.0" stroke="BLACK" strokeType="INSIDE" />
|
||||||
|
</children>
|
||||||
|
</VBox>
|
||||||
|
<VBox prefHeight="87.0" prefWidth="4.0">
|
||||||
|
<children>
|
||||||
|
<Circle fill="#21ffee" radius="8.0" stroke="BLACK" strokeType="INSIDE" />
|
||||||
|
<Circle fill="#2168ff" radius="8.0" stroke="BLACK" strokeType="INSIDE" />
|
||||||
|
<Circle fill="#d921ff" radius="8.0" stroke="BLACK" strokeType="INSIDE" />
|
||||||
|
<Circle fill="#ff21ad" radius="8.0" stroke="BLACK" strokeType="INSIDE" />
|
||||||
|
</children>
|
||||||
|
</VBox>
|
||||||
|
</children>
|
||||||
|
<styleClass>
|
||||||
|
<String fx:value="barreDeVie" />
|
||||||
|
<String fx:value="zero" />
|
||||||
|
</styleClass>
|
||||||
|
</HBox>
|
||||||
|
<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" 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" 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" 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>
|
||||||
|
<VBox prefHeight="64.0" prefWidth="25.0" />
|
||||||
|
<VBox prefHeight="200.0" prefWidth="25.0" />
|
||||||
|
</children>
|
||||||
|
</HBox>
|
||||||
|
<HBox prefHeight="100.0" prefWidth="50.0" styleClass="barreDeVie" stylesheets="@style/plateau.css">
|
||||||
|
<children>
|
||||||
|
<VBox prefHeight="64.0" prefWidth="25.0" />
|
||||||
|
<VBox prefHeight="200.0" prefWidth="25.0" />
|
||||||
|
</children>
|
||||||
|
</HBox>
|
||||||
|
<HBox prefHeight="100.0" prefWidth="50.0" styleClass="barreDeVie" stylesheets="@style/plateau.css">
|
||||||
|
<children>
|
||||||
|
<VBox prefHeight="64.0" prefWidth="25.0" />
|
||||||
|
<VBox prefHeight="200.0" prefWidth="25.0" />
|
||||||
|
</children>
|
||||||
|
</HBox>
|
||||||
|
<HBox prefHeight="100.0" prefWidth="50.0" styleClass="barreDeVie" stylesheets="@style/plateau.css">
|
||||||
|
<children>
|
||||||
|
<VBox prefHeight="64.0" prefWidth="25.0" />
|
||||||
|
<VBox prefHeight="200.0" prefWidth="25.0" />
|
||||||
|
</children>
|
||||||
|
</HBox>
|
||||||
|
<HBox prefHeight="100.0" prefWidth="50.0" styleClass="barreDeVie" stylesheets="@style/plateau.css">
|
||||||
|
<children>
|
||||||
|
<VBox prefHeight="64.0" prefWidth="25.0" />
|
||||||
|
<VBox prefHeight="200.0" prefWidth="25.0" />
|
||||||
|
</children>
|
||||||
|
</HBox>
|
||||||
|
<HBox prefHeight="100.0" prefWidth="50.0" styleClass="barreDeVie" stylesheets="@style/plateau.css">
|
||||||
|
<children>
|
||||||
|
<VBox prefHeight="64.0" prefWidth="25.0" />
|
||||||
|
<VBox prefHeight="200.0" prefWidth="25.0" />
|
||||||
|
</children>
|
||||||
|
</HBox>
|
||||||
|
<HBox prefHeight="100.0" prefWidth="50.0" styleClass="barreDeVie" stylesheets="@style/plateau.css">
|
||||||
|
<children>
|
||||||
|
<VBox prefHeight="64.0" prefWidth="25.0" />
|
||||||
|
<VBox prefHeight="200.0" prefWidth="25.0" />
|
||||||
|
</children>
|
||||||
|
</HBox>
|
||||||
|
<HBox prefHeight="100.0" prefWidth="50.0" styleClass="barreDeVie" stylesheets="@style/plateau.css">
|
||||||
|
<children>
|
||||||
|
<VBox prefHeight="64.0" prefWidth="25.0" />
|
||||||
|
<VBox prefHeight="200.0" prefWidth="25.0" />
|
||||||
|
</children>
|
||||||
|
</HBox>
|
||||||
|
<HBox prefHeight="100.0" prefWidth="50.0" styleClass="barreDeVie" stylesheets="@style/plateau.css">
|
||||||
|
<children>
|
||||||
|
<VBox prefHeight="64.0" prefWidth="25.0" />
|
||||||
|
<VBox prefHeight="200.0" prefWidth="25.0" />
|
||||||
|
</children>
|
||||||
|
</HBox>
|
||||||
|
</children>
|
||||||
|
</HBox>
|
||||||
|
<HBox>
|
||||||
|
<children>
|
||||||
|
<VBox>
|
||||||
|
<children>
|
||||||
|
<Label styleClass="text" stylesheets="@style/plateau.css" text="Pas de" />
|
||||||
|
<Label styleClass="text" stylesheets="@style/plateau.css" text="dégats" />
|
||||||
|
</children>
|
||||||
|
</VBox>
|
||||||
|
<Label alignment="CENTER" prefWidth="50.0" styleClass="text" stylesheets="@style/plateau.css" text="1" />
|
||||||
|
<Label alignment="CENTER" prefWidth="50.0" styleClass="text" stylesheets="@style/plateau.css" text="2" textAlignment="CENTER" />
|
||||||
|
<Label alignment="CENTER" prefWidth="50.0" styleClass="text" stylesheets="@style/plateau.css" text="3" textAlignment="CENTER" />
|
||||||
|
<Label alignment="CENTER" prefWidth="50.0" styleClass="text" stylesheets="@style/plateau.css" text="4" textAlignment="CENTER" />
|
||||||
|
<Label alignment="CENTER" prefWidth="50.0" styleClass="text" stylesheets="@style/plateau.css" text="5" textAlignment="CENTER" />
|
||||||
|
<Label alignment="CENTER" prefWidth="50.0" styleClass="text" stylesheets="@style/plateau.css" text="6" textAlignment="CENTER" />
|
||||||
|
<Label alignment="CENTER" prefWidth="50.0" styleClass="text" stylesheets="@style/plateau.css" text="7" textAlignment="CENTER" />
|
||||||
|
<Label alignment="CENTER" prefWidth="50.0" styleClass="text" stylesheets="@style/plateau.css" text="8" textAlignment="CENTER" />
|
||||||
|
<Label alignment="CENTER" prefWidth="50.0" styleClass="text" stylesheets="@style/plateau.css" text="9" textAlignment="CENTER" />
|
||||||
|
<Label alignment="CENTER" prefWidth="50.0" styleClass="text" stylesheets="@style/plateau.css" text="10" textAlignment="CENTER" />
|
||||||
|
<Label alignment="CENTER" prefWidth="50.0" styleClass="text" stylesheets="@style/plateau.css" text="11" textAlignment="CENTER" />
|
||||||
|
<Label alignment="CENTER" prefWidth="50.0" styleClass="text" stylesheets="@style/plateau.css" text="12" textAlignment="CENTER" />
|
||||||
|
<Label alignment="CENTER" prefWidth="50.0" styleClass="text" stylesheets="@style/plateau.css" text="13" textAlignment="CENTER" />
|
||||||
|
<Label alignment="CENTER" prefWidth="50.0" styleClass="text" stylesheets="@style/plateau.css" text="14" textAlignment="CENTER" />
|
||||||
|
</children>
|
||||||
|
</HBox>
|
||||||
|
</children>
|
||||||
|
</VBox>
|
||||||
|
</children>
|
||||||
|
</VBox>
|
||||||
|
</children>
|
||||||
|
<padding>
|
||||||
|
<Insets bottom="20.0" left="20.0" right="20.0" top="20.0" />
|
||||||
|
</padding>
|
||||||
|
</HBox>
|
||||||
|
</children>
|
||||||
|
</AnchorPane>
|
||||||
|
</center>
|
||||||
|
<right>
|
||||||
|
<AnchorPane maxWidth="1.7976931348623157E308" minWidth="-Infinity" BorderPane.alignment="CENTER">
|
||||||
|
<children>
|
||||||
|
<GridPane alignment="CENTER" maxWidth="1.7976931348623157E308" minWidth="-Infinity" style="-fx-background-color: A50000;" vgap="50.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||||
|
<columnConstraints>
|
||||||
|
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" />
|
||||||
|
</columnConstraints>
|
||||||
|
<rowConstraints>
|
||||||
|
<RowConstraints vgrow="ALWAYS" />
|
||||||
|
<RowConstraints vgrow="ALWAYS" />
|
||||||
|
</rowConstraints>
|
||||||
|
<children>
|
||||||
|
<GridPane vgap="10.0">
|
||||||
|
<columnConstraints>
|
||||||
|
<ColumnConstraints hgrow="SOMETIMES" />
|
||||||
|
</columnConstraints>
|
||||||
|
<rowConstraints>
|
||||||
|
<RowConstraints vgrow="ALWAYS" />
|
||||||
|
<RowConstraints />
|
||||||
|
<RowConstraints vgrow="ALWAYS" />
|
||||||
|
</rowConstraints>
|
||||||
|
<children>
|
||||||
|
<AnchorPane fx:id="anchorPane612" />
|
||||||
|
<ImageView fitHeight="150.0" fitWidth="150.0" pickOnBounds="true" preserveRatio="true" GridPane.rowIndex="1">
|
||||||
|
<image>
|
||||||
|
<Image url="@img/dosCartesPersonnageRot.jpg" />
|
||||||
|
</image>
|
||||||
|
</ImageView>
|
||||||
|
<ScrollPane hbarPolicy="NEVER" vbarPolicy="NEVER" GridPane.rowIndex="2">
|
||||||
|
<content>
|
||||||
|
<AnchorPane />
|
||||||
|
</content>
|
||||||
|
</ScrollPane>
|
||||||
|
</children>
|
||||||
|
<GridPane.margin>
|
||||||
|
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
|
||||||
|
</GridPane.margin>
|
||||||
|
</GridPane>
|
||||||
|
<GridPane layoutX="10.0" layoutY="10.0" vgap="10.0" GridPane.rowIndex="1">
|
||||||
|
<columnConstraints>
|
||||||
|
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" />
|
||||||
|
</columnConstraints>
|
||||||
|
<rowConstraints>
|
||||||
|
<RowConstraints vgrow="ALWAYS" />
|
||||||
|
<RowConstraints />
|
||||||
|
<RowConstraints vgrow="ALWAYS" />
|
||||||
|
</rowConstraints>
|
||||||
|
<children>
|
||||||
|
<AnchorPane fx:id="anchorPane6121" GridPane.rowIndex="2" />
|
||||||
|
<ImageView fitHeight="150.0" fitWidth="150.0" pickOnBounds="true" preserveRatio="true" GridPane.rowIndex="1">
|
||||||
|
<image>
|
||||||
|
<Image url="@img/dosCartesPersonnageRot.jpg" />
|
||||||
|
</image>
|
||||||
|
</ImageView>
|
||||||
|
<ScrollPane hbarPolicy="NEVER" vbarPolicy="NEVER">
|
||||||
|
<content>
|
||||||
|
<AnchorPane />
|
||||||
|
</content>
|
||||||
|
</ScrollPane>
|
||||||
|
</children>
|
||||||
|
<GridPane.margin>
|
||||||
|
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
|
||||||
|
</GridPane.margin>
|
||||||
|
</GridPane>
|
||||||
|
</children>
|
||||||
|
<padding>
|
||||||
|
<Insets bottom="20.0" left="20.0" right="20.0" top="20.0" />
|
||||||
|
</padding>
|
||||||
|
</GridPane>
|
||||||
|
</children>
|
||||||
|
</AnchorPane>
|
||||||
|
</right>
|
||||||
|
<left>
|
||||||
|
<AnchorPane BorderPane.alignment="CENTER">
|
||||||
|
<children>
|
||||||
|
<GridPane alignment="CENTER" style="-fx-background-color: A50000;" vgap="50.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||||
|
<rowConstraints>
|
||||||
|
<RowConstraints vgrow="SOMETIMES" />
|
||||||
|
<RowConstraints vgrow="SOMETIMES" />
|
||||||
|
</rowConstraints>
|
||||||
|
<children>
|
||||||
|
<GridPane vgap="10.0">
|
||||||
|
<columnConstraints>
|
||||||
|
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" />
|
||||||
|
</columnConstraints>
|
||||||
|
<rowConstraints>
|
||||||
|
<RowConstraints vgrow="ALWAYS" />
|
||||||
|
<RowConstraints />
|
||||||
|
<RowConstraints vgrow="ALWAYS" />
|
||||||
|
</rowConstraints>
|
||||||
|
<children>
|
||||||
|
<AnchorPane nodeOrientation="RIGHT_TO_LEFT" />
|
||||||
|
<ImageView fitHeight="150.0" fitWidth="150.0" pickOnBounds="true" preserveRatio="true" GridPane.rowIndex="1">
|
||||||
|
<image>
|
||||||
|
<Image url="@img/dosCartesPersonnageRot.jpg" />
|
||||||
|
</image>
|
||||||
|
</ImageView>
|
||||||
|
<ScrollPane hbarPolicy="NEVER" vbarPolicy="NEVER" GridPane.rowIndex="2">
|
||||||
|
<content>
|
||||||
|
<AnchorPane />
|
||||||
|
</content>
|
||||||
|
</ScrollPane>
|
||||||
|
</children>
|
||||||
|
<GridPane.margin>
|
||||||
|
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
|
||||||
|
</GridPane.margin>
|
||||||
|
</GridPane>
|
||||||
|
<GridPane layoutX="10.0" layoutY="10.0" vgap="10.0" GridPane.rowIndex="1">
|
||||||
|
<columnConstraints>
|
||||||
|
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" />
|
||||||
|
</columnConstraints>
|
||||||
|
<rowConstraints>
|
||||||
|
<RowConstraints vgrow="ALWAYS" />
|
||||||
|
<RowConstraints />
|
||||||
|
<RowConstraints vgrow="ALWAYS" />
|
||||||
|
</rowConstraints>
|
||||||
|
<children>
|
||||||
|
<AnchorPane GridPane.rowIndex="2" />
|
||||||
|
<ImageView fitHeight="150.0" fitWidth="150.0" pickOnBounds="true" preserveRatio="true" GridPane.rowIndex="1">
|
||||||
|
<image>
|
||||||
|
<Image url="@img/dosCartesPersonnageRot.jpg" />
|
||||||
|
</image>
|
||||||
|
</ImageView>
|
||||||
|
<ScrollPane hbarPolicy="NEVER" vbarPolicy="NEVER">
|
||||||
|
<content>
|
||||||
|
<AnchorPane />
|
||||||
|
</content>
|
||||||
|
</ScrollPane>
|
||||||
|
</children>
|
||||||
|
<GridPane.margin>
|
||||||
|
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
|
||||||
|
</GridPane.margin>
|
||||||
|
</GridPane>
|
||||||
|
</children>
|
||||||
|
<columnConstraints>
|
||||||
|
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" />
|
||||||
|
</columnConstraints>
|
||||||
|
<padding>
|
||||||
|
<Insets bottom="20.0" left="20.0" right="20.0" top="20.0" />
|
||||||
|
</padding>
|
||||||
|
</GridPane>
|
||||||
|
</children>
|
||||||
|
</AnchorPane>
|
||||||
|
</left>
|
||||||
|
<top>
|
||||||
|
<AnchorPane BorderPane.alignment="CENTER">
|
||||||
|
<children>
|
||||||
|
<GridPane alignment="CENTER" hgap="50.0" style="-fx-background-color: A50000;" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||||
|
<columnConstraints>
|
||||||
|
<ColumnConstraints hgrow="ALWAYS" />
|
||||||
|
<ColumnConstraints hgrow="ALWAYS" />
|
||||||
|
</columnConstraints>
|
||||||
|
<rowConstraints>
|
||||||
|
<RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
|
||||||
|
</rowConstraints>
|
||||||
|
<children>
|
||||||
|
<GridPane alignment="CENTER" hgap="10.0" rotate="180.0">
|
||||||
|
<columnConstraints>
|
||||||
|
<ColumnConstraints hgrow="ALWAYS" />
|
||||||
|
<ColumnConstraints />
|
||||||
|
<ColumnConstraints hgrow="ALWAYS" />
|
||||||
|
</columnConstraints>
|
||||||
|
<rowConstraints>
|
||||||
|
<RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
|
||||||
|
</rowConstraints>
|
||||||
|
<children>
|
||||||
|
<AnchorPane nodeOrientation="RIGHT_TO_LEFT" GridPane.columnIndex="2" />
|
||||||
|
<ImageView fitHeight="150.0" fitWidth="200.0" pickOnBounds="true" preserveRatio="true" GridPane.columnIndex="1" GridPane.halignment="CENTER">
|
||||||
|
<image>
|
||||||
|
<Image url="@img/dosCartesPersonnage.jpg" />
|
||||||
|
</image>
|
||||||
|
</ImageView>
|
||||||
|
<ScrollPane hbarPolicy="NEVER" vbarPolicy="NEVER">
|
||||||
|
<content>
|
||||||
|
<AnchorPane />
|
||||||
|
</content>
|
||||||
|
</ScrollPane>
|
||||||
|
</children>
|
||||||
|
</GridPane>
|
||||||
|
<GridPane alignment="CENTER" hgap="10.0" rotate="180.0" GridPane.columnIndex="1">
|
||||||
|
<columnConstraints>
|
||||||
|
<ColumnConstraints hgrow="ALWAYS" />
|
||||||
|
<ColumnConstraints />
|
||||||
|
<ColumnConstraints hgrow="ALWAYS" />
|
||||||
|
</columnConstraints>
|
||||||
|
<rowConstraints>
|
||||||
|
<RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
|
||||||
|
</rowConstraints>
|
||||||
|
<children>
|
||||||
|
<AnchorPane />
|
||||||
|
<ImageView fitHeight="150.0" fitWidth="200.0" pickOnBounds="true" preserveRatio="true" GridPane.columnIndex="1" GridPane.halignment="CENTER">
|
||||||
|
<image>
|
||||||
|
<Image url="@img/dosCartesPersonnage.jpg" />
|
||||||
|
</image>
|
||||||
|
<GridPane.margin>
|
||||||
|
<Insets />
|
||||||
|
</GridPane.margin>
|
||||||
|
</ImageView>
|
||||||
|
<ScrollPane hbarPolicy="NEVER" vbarPolicy="NEVER" GridPane.columnIndex="2">
|
||||||
|
<content>
|
||||||
|
<AnchorPane />
|
||||||
|
</content>
|
||||||
|
</ScrollPane>
|
||||||
|
</children>
|
||||||
|
</GridPane>
|
||||||
|
</children>
|
||||||
|
<padding>
|
||||||
|
<Insets bottom="20.0" left="20.0" right="20.0" top="20.0" />
|
||||||
|
</padding>
|
||||||
|
</GridPane>
|
||||||
|
</children>
|
||||||
|
</AnchorPane>
|
||||||
|
</top>
|
||||||
|
<bottom>
|
||||||
|
<AnchorPane BorderPane.alignment="CENTER">
|
||||||
|
<children>
|
||||||
|
<GridPane alignment="CENTER" hgap="50.0" style="-fx-background-color: A50000;" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||||
|
<columnConstraints>
|
||||||
|
<ColumnConstraints hgrow="ALWAYS" />
|
||||||
|
<ColumnConstraints hgrow="ALWAYS" />
|
||||||
|
</columnConstraints>
|
||||||
|
<rowConstraints>
|
||||||
|
<RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
|
||||||
|
</rowConstraints>
|
||||||
|
<children>
|
||||||
|
<GridPane alignment="CENTER" hgap="10.0">
|
||||||
|
<columnConstraints>
|
||||||
|
<ColumnConstraints hgrow="ALWAYS" />
|
||||||
|
<ColumnConstraints />
|
||||||
|
<ColumnConstraints hgrow="ALWAYS" />
|
||||||
|
</columnConstraints>
|
||||||
|
<rowConstraints>
|
||||||
|
<RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
|
||||||
|
</rowConstraints>
|
||||||
|
<children>
|
||||||
|
<AnchorPane />
|
||||||
|
<ImageView fitHeight="150.0" fitWidth="200.0" pickOnBounds="true" preserveRatio="true" GridPane.columnIndex="1" GridPane.halignment="CENTER">
|
||||||
|
<image>
|
||||||
|
<Image url="@img/dosCartesPersonnage.jpg" />
|
||||||
|
</image>
|
||||||
|
</ImageView>
|
||||||
|
<ScrollPane fitToHeight="true" fitToWidth="true" hbarPolicy="NEVER" vbarPolicy="NEVER" GridPane.columnIndex="2">
|
||||||
|
<content>
|
||||||
|
<AnchorPane />
|
||||||
|
</content>
|
||||||
|
</ScrollPane>
|
||||||
|
</children>
|
||||||
|
</GridPane>
|
||||||
|
<GridPane alignment="CENTER" hgap="10.0" GridPane.columnIndex="1">
|
||||||
|
<columnConstraints>
|
||||||
|
<ColumnConstraints hgrow="ALWAYS" />
|
||||||
|
<ColumnConstraints />
|
||||||
|
<ColumnConstraints hgrow="ALWAYS" />
|
||||||
|
</columnConstraints>
|
||||||
|
<rowConstraints>
|
||||||
|
<RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
|
||||||
|
</rowConstraints>
|
||||||
|
<children>
|
||||||
|
<AnchorPane nodeOrientation="RIGHT_TO_LEFT" GridPane.columnIndex="2" />
|
||||||
|
<ImageView fitHeight="150.0" fitWidth="200.0" pickOnBounds="true" preserveRatio="true" GridPane.columnIndex="1" GridPane.halignment="CENTER">
|
||||||
|
<image>
|
||||||
|
<Image url="@img/dosCartesPersonnage.jpg" />
|
||||||
|
</image>
|
||||||
|
<GridPane.margin>
|
||||||
|
<Insets />
|
||||||
|
</GridPane.margin>
|
||||||
|
</ImageView>
|
||||||
|
<ScrollPane fitToHeight="true" fitToWidth="true" hbarPolicy="NEVER" vbarPolicy="NEVER">
|
||||||
|
<content>
|
||||||
|
<AnchorPane />
|
||||||
|
</content>
|
||||||
|
</ScrollPane>
|
||||||
|
</children>
|
||||||
|
</GridPane>
|
||||||
|
</children>
|
||||||
|
<padding>
|
||||||
|
<Insets bottom="20.0" left="20.0" right="20.0" top="20.0" />
|
||||||
|
</padding>
|
||||||
|
</GridPane>
|
||||||
|
</children>
|
||||||
|
</AnchorPane>
|
||||||
|
</bottom>
|
||||||
|
</BorderPane>
|
||||||
|
</children>
|
||||||
|
</AnchorPane>
|
63
src/ihm/ressources/ScrollPaneJoueur.fxml
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<?import javafx.scene.control.ScrollPane?>
|
||||||
|
<?import javafx.scene.control.SplitPane?>
|
||||||
|
<?import javafx.scene.image.Image?>
|
||||||
|
<?import javafx.scene.image.ImageView?>
|
||||||
|
<?import javafx.scene.layout.AnchorPane?>
|
||||||
|
<?import javafx.scene.layout.HBox?>
|
||||||
|
|
||||||
|
|
||||||
|
<AnchorPane xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ihm.controller.ScrollPaneJoueurController">
|
||||||
|
<children>
|
||||||
|
<SplitPane dividerPositions="0.298" prefHeight="155.0" prefWidth="368.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||||
|
<items>
|
||||||
|
<AnchorPane>
|
||||||
|
<children>
|
||||||
|
<ScrollPane hbarPolicy="NEVER" vbarPolicy="NEVER" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||||
|
<content>
|
||||||
|
<AnchorPane>
|
||||||
|
<children>
|
||||||
|
<HBox spacing="10.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||||
|
<children>
|
||||||
|
<ImageView fitHeight="150.0" fitWidth="200.0" pickOnBounds="true" preserveRatio="true">
|
||||||
|
<image>
|
||||||
|
<Image url="@img/dosCartesPersonnage.jpg" />
|
||||||
|
</image>
|
||||||
|
</ImageView>
|
||||||
|
<ImageView fitHeight="150.0" fitWidth="200.0" layoutX="10.0" layoutY="10.0" pickOnBounds="true" preserveRatio="true">
|
||||||
|
<image>
|
||||||
|
<Image url="@img/dosCartesPersonnage.jpg" />
|
||||||
|
</image>
|
||||||
|
</ImageView>
|
||||||
|
<ImageView fitHeight="150.0" fitWidth="200.0" layoutX="115.0" layoutY="10.0" pickOnBounds="true" preserveRatio="true">
|
||||||
|
<image>
|
||||||
|
<Image url="@img/dosCartesPersonnage.jpg" />
|
||||||
|
</image>
|
||||||
|
</ImageView>
|
||||||
|
<ImageView fitHeight="150.0" fitWidth="200.0" layoutX="219.0" layoutY="10.0" pickOnBounds="true" preserveRatio="true">
|
||||||
|
<image>
|
||||||
|
<Image url="@img/dosCartesPersonnage.jpg" />
|
||||||
|
</image>
|
||||||
|
</ImageView>
|
||||||
|
</children>
|
||||||
|
</HBox>
|
||||||
|
</children>
|
||||||
|
</AnchorPane>
|
||||||
|
</content>
|
||||||
|
</ScrollPane>
|
||||||
|
</children>
|
||||||
|
</AnchorPane>
|
||||||
|
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity">
|
||||||
|
<children>
|
||||||
|
<ImageView fitHeight="30.0" focusTraversable="true" nodeOrientation="INHERIT" onMousePressed="#changeZoneJoueurToMenuJoueur" pickOnBounds="true" preserveRatio="true" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||||
|
<image>
|
||||||
|
<Image url="@img/backButton.png" />
|
||||||
|
</image>
|
||||||
|
</ImageView>
|
||||||
|
</children>
|
||||||
|
</AnchorPane>
|
||||||
|
</items>
|
||||||
|
</SplitPane>
|
||||||
|
</children>
|
||||||
|
</AnchorPane>
|
15
src/ihm/ressources/ZoneJoueur.fxml
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<?import javafx.scene.image.Image?>
|
||||||
|
<?import javafx.scene.image.ImageView?>
|
||||||
|
<?import javafx.scene.layout.BorderPane?>
|
||||||
|
|
||||||
|
<BorderPane prefHeight="241.0" prefWidth="212.0" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1">
|
||||||
|
<top>
|
||||||
|
<ImageView fitHeight="34.0" fitWidth="32.0" onMousePressed="#scrollPaneJoueurs" pickOnBounds="true" preserveRatio="true" BorderPane.alignment="CENTER">
|
||||||
|
<image>
|
||||||
|
<Image url="@img/menuButton.png" />
|
||||||
|
</image>
|
||||||
|
</ImageView>
|
||||||
|
</top>
|
||||||
|
</BorderPane>
|
@ -2,22 +2,23 @@
|
|||||||
|
|
||||||
<?import javafx.scene.control.Button?>
|
<?import javafx.scene.control.Button?>
|
||||||
<?import javafx.scene.control.Label?>
|
<?import javafx.scene.control.Label?>
|
||||||
<?import javafx.scene.layout.Pane?>
|
<?import javafx.scene.layout.AnchorPane?>
|
||||||
<?import javafx.scene.text.Font?>
|
<?import javafx.scene.text.Font?>
|
||||||
|
|
||||||
<Pane fx:id="rootPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="414.0" prefWidth="535.0" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ihm.controller.ChoisirBoolean">
|
|
||||||
|
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="334.0" prefWidth="449.0" style="-fx-background-color: white;" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ihm.controller.ChoisirBoolean">
|
||||||
<children>
|
<children>
|
||||||
<Label layoutX="21.0" layoutY="39.0" text="Voulez vous faire cette action ?">
|
<Label layoutX="8.0" layoutY="32.0" text="Voulez vous faire cette action ?" AnchorPane.bottomAnchor="215.0" AnchorPane.leftAnchor="8.0" AnchorPane.rightAnchor="7.0" AnchorPane.topAnchor="32.0">
|
||||||
<font>
|
<font>
|
||||||
<Font size="36.0" />
|
<Font size="36.0" />
|
||||||
</font>
|
</font>
|
||||||
</Label>
|
</Label>
|
||||||
<Button fx:id="ouiButton" layoutX="45.0" layoutY="257.0" mnemonicParsing="false" onMouseClicked="#choixOui" prefHeight="82.0" prefWidth="157.0" text="Oui" />
|
<Button fx:id="ouiButton" layoutX="68.0" layoutY="147.0" mnemonicParsing="false" onMouseClicked="#choixOui" text="Oui" AnchorPane.bottomAnchor="71.0" AnchorPane.leftAnchor="68.0" AnchorPane.rightAnchor="268.0" AnchorPane.topAnchor="147.0" />
|
||||||
<Label layoutX="202.0" layoutY="99.0">
|
<Label layoutX="377.0" layoutY="245.0" AnchorPane.bottomAnchor="187.0" AnchorPane.leftAnchor="181.0" AnchorPane.rightAnchor="312.0" AnchorPane.topAnchor="60.0">
|
||||||
<font>
|
<font>
|
||||||
<Font size="36.0" />
|
<Font size="36.0" />
|
||||||
</font>
|
</font>
|
||||||
</Label>
|
</Label>
|
||||||
<Button fx:id="nonButton" layoutX="333.0" layoutY="257.0" mnemonicParsing="false" onMouseClicked="#choixNon" prefHeight="82.0" prefWidth="157.0" text="Non" />
|
<Button fx:id="nonButton" layoutX="286.0" layoutY="147.0" mnemonicParsing="false" onMouseClicked="#choixNon" text="Non" AnchorPane.bottomAnchor="71.0" AnchorPane.leftAnchor="286.0" AnchorPane.rightAnchor="50.0" AnchorPane.topAnchor="147.0" />
|
||||||
</children>
|
</children>
|
||||||
</Pane>
|
</AnchorPane>
|
||||||
|
BIN
src/ihm/ressources/img/backButton.png
Normal file
After Width: | Height: | Size: 35 KiB |
BIN
src/ihm/ressources/img/de.gif
Normal file
After Width: | Height: | Size: 59 KiB |
BIN
src/ihm/ressources/img/diceSprite.png
Normal file
After Width: | Height: | Size: 90 KiB |
BIN
src/ihm/ressources/img/dosCartesLumière.jpg
Normal file
After Width: | Height: | Size: 90 KiB |
BIN
src/ihm/ressources/img/dosCartesNoires.jpg
Normal file
After Width: | Height: | Size: 109 KiB |
BIN
src/ihm/ressources/img/dosCartesPersonnage.jpg
Normal file
After Width: | Height: | Size: 109 KiB |
BIN
src/ihm/ressources/img/dosCartesPersonnageRot.jpg
Normal file
After Width: | Height: | Size: 128 KiB |
BIN
src/ihm/ressources/img/dosCartesVision.jpg
Normal file
After Width: | Height: | Size: 124 KiB |
BIN
src/ihm/ressources/img/dé.png
Normal file
After Width: | Height: | Size: 146 KiB |
BIN
src/ihm/ressources/img/dé1.jpg
Normal file
After Width: | Height: | Size: 25 KiB |
BIN
src/ihm/ressources/img/dé2.jpg
Normal file
After Width: | Height: | Size: 26 KiB |
BIN
src/ihm/ressources/img/dé3.jpg
Normal file
After Width: | Height: | Size: 27 KiB |
BIN
src/ihm/ressources/img/dé4.jpg
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
src/ihm/ressources/img/dé5.jpg
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
src/ihm/ressources/img/dé6.jpg
Normal file
After Width: | Height: | Size: 30 KiB |
BIN
src/ihm/ressources/img/dés.jpg
Normal file
After Width: | Height: | Size: 27 KiB |
BIN
src/ihm/ressources/img/menuButton.png
Normal file
After Width: | Height: | Size: 14 KiB |
@ -67,6 +67,12 @@ public class GestionnaireJeu {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void rollDice(Joueur joueur, int typeDice, int ... rolls){
|
||||||
|
|
||||||
|
pc.rollDice(joueur,typeDice,rolls);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public static void setConfiguration(Configuration c) {
|
public static void setConfiguration(Configuration c) {
|
||||||
|
|
||||||
List<Joueur> joueurs = new ArrayList<Joueur>();
|
List<Joueur> joueurs = new ArrayList<Joueur>();
|
||||||
|
@ -19,6 +19,7 @@ public class JoueurVirtuel extends Joueur {
|
|||||||
return effets.get((int)Math.floor(Math.random() * effets.size()));
|
return effets.get((int)Math.floor(Math.random() * effets.size()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//on privilegie les equipements qui donnent des stats
|
||||||
public Equipement choisirEquipement(List<Equipement> equips) {
|
public Equipement choisirEquipement(List<Equipement> equips) {
|
||||||
List<Equipement> equipstat = trouverEquipStat(equips);
|
List<Equipement> equipstat = trouverEquipStat(equips);
|
||||||
if(equipstat.size()>0)
|
if(equipstat.size()>0)
|
||||||
@ -35,6 +36,7 @@ public class JoueurVirtuel extends Joueur {
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//on choisit les joueurs avec les moins de hp, on ne distingue pas cependant d'amie ou ennemi
|
||||||
public Joueur choisirJoueur(List<Joueur> joueurs) {
|
public Joueur choisirJoueur(List<Joueur> joueurs) {
|
||||||
Joueur res = joueurs.get(0);
|
Joueur res = joueurs.get(0);
|
||||||
for(int i=1; i<joueurs.size();i++) {
|
for(int i=1; i<joueurs.size();i++) {
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
package main;
|
package main;
|
||||||
|
|
||||||
import java.awt.Point;
|
import java.awt.Point;
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@ -17,6 +16,7 @@ import effet.EffetChoisirEffet;
|
|||||||
import effet.EffetSelf;
|
import effet.EffetSelf;
|
||||||
import effet.action.ActionAltererStatistiquesJoueur;
|
import effet.action.ActionAltererStatistiquesJoueur;
|
||||||
import effet.action.ActionVoler;
|
import effet.action.ActionVoler;
|
||||||
|
import ihm.controller.PlateauController;
|
||||||
import personnage.Allie;
|
import personnage.Allie;
|
||||||
import personnage.CartePersonnage;
|
import personnage.CartePersonnage;
|
||||||
import personnage.Franklin;
|
import personnage.Franklin;
|
||||||
@ -197,15 +197,12 @@ public class Plateau {
|
|||||||
|
|
||||||
while(true) {
|
while(true) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Joueur currentJoueur = this.joueurs.get(nbJoueurs % i);
|
Joueur currentJoueur = this.joueurs.get(nbJoueurs % i);
|
||||||
System.out.println("\n\n\n\n\n");
|
System.out.println("\n\n\n\n\n");
|
||||||
System.out.println("Au tour de "+currentJoueur.getNom());
|
System.out.println("Au tour de "+currentJoueur.getNom());
|
||||||
System.out.println("Lancement des dés.");
|
System.out.println("Lancement des dés.");
|
||||||
deplacer(currentJoueur);
|
deplacer(currentJoueur);
|
||||||
System.out.println("Vous êtes désormais sur le lieu "+currentJoueur.getCarteLieu().getNom());
|
System.out.println("Vous êtes désormais sur le lieu "+currentJoueur.getCarteLieu().getNom());
|
||||||
|
|
||||||
System.out.println("Voulez vous activer l'effet du lieu ?");
|
System.out.println("Voulez vous activer l'effet du lieu ?");
|
||||||
if(currentJoueur.choisir()) {
|
if(currentJoueur.choisir()) {
|
||||||
System.out.println("Vous activez l'effet du lieu.");
|
System.out.println("Vous activez l'effet du lieu.");
|
||||||
@ -247,7 +244,7 @@ public class Plateau {
|
|||||||
boolean attributed = false;
|
boolean attributed = false;
|
||||||
|
|
||||||
while(!attributed) {
|
while(!attributed) {
|
||||||
int roll = sumRolls();
|
int roll = sumRolls(currentJoueur);
|
||||||
for(CarteLieu cl : lieux) {
|
for(CarteLieu cl : lieux) {
|
||||||
|
|
||||||
if(cl.coordinatesContains(roll) && currentJoueur.getCarteLieu() != cl){
|
if(cl.coordinatesContains(roll) && currentJoueur.getCarteLieu() != cl){
|
||||||
@ -262,7 +259,7 @@ public class Plateau {
|
|||||||
|
|
||||||
public void attaquer(Joueur joueur1, Joueur joueur2) {
|
public void attaquer(Joueur joueur1, Joueur joueur2) {
|
||||||
|
|
||||||
int attaque = diffRolls();
|
int attaque = diffRolls(joueur1);
|
||||||
|
|
||||||
if(attaque != 0) {
|
if(attaque != 0) {
|
||||||
System.out.println(joueur1.getNom()+" attaque "+joueur2.getNom());
|
System.out.println(joueur1.getNom()+" attaque "+joueur2.getNom());
|
||||||
@ -277,21 +274,39 @@ public class Plateau {
|
|||||||
return new Joueur("0");
|
return new Joueur("0");
|
||||||
}
|
}
|
||||||
|
|
||||||
public int diffRolls() {
|
public int diffRolls(Joueur j) {
|
||||||
return Math.abs(roll6()-roll4());
|
|
||||||
|
int roll4 =rollRandom(4);
|
||||||
|
int roll6 = rollRandom(6);
|
||||||
|
|
||||||
|
|
||||||
|
gj.rollDice(j, PlateauController.DICE_BOTH, roll4,roll6);
|
||||||
|
return Math.abs(roll4-roll6);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int roll4() {
|
public int roll4(Joueur j) {
|
||||||
return (int) Math.floor(Math.random() * 3)+1;
|
|
||||||
|
int roll = this.rollRandom(4);
|
||||||
|
gj.rollDice(j, PlateauController.DICE_QUATRE, roll);
|
||||||
|
return roll;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int roll6() {
|
public int roll6(Joueur j) {
|
||||||
return (int) Math.floor(Math.random() * 5)+1;
|
|
||||||
|
int roll = this.rollRandom(6);
|
||||||
|
gj.rollDice(j, PlateauController.DICE_QUATRE, roll);
|
||||||
|
return roll;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int sumRolls()
|
private int rollRandom(int nb) {
|
||||||
|
|
||||||
|
int roll = (int) Math.floor(Math.random() * (nb-1))+1;
|
||||||
|
return roll;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int sumRolls(Joueur j)
|
||||||
{
|
{
|
||||||
return roll6() + roll4();
|
return roll6(j) + roll4(j);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Joueur> getJoueurs() {
|
public List<Joueur> getJoueurs() {
|
||||||
|
@ -30,7 +30,7 @@ public class Franklin extends Unique{
|
|||||||
if(!this.isCapaciteUsed() && joueur.getRevele()) {
|
if(!this.isCapaciteUsed() && joueur.getRevele()) {
|
||||||
|
|
||||||
Plateau p = joueur.getPlateau();
|
Plateau p = joueur.getPlateau();
|
||||||
int roll = p.roll6();
|
int roll = p.roll6(this.getJoueur());
|
||||||
|
|
||||||
Joueur joueur2 = joueur.choisiParmisTous();
|
Joueur joueur2 = joueur.choisiParmisTous();
|
||||||
super.attaquer(joueur2, roll);
|
super.attaquer(joueur2, roll);
|
||||||
|
@ -17,7 +17,7 @@ public class Georges extends Unique{
|
|||||||
if(!this.isCapaciteUsed() && joueur.getRevele()) {
|
if(!this.isCapaciteUsed() && joueur.getRevele()) {
|
||||||
|
|
||||||
Plateau p = joueur.getPlateau();
|
Plateau p = joueur.getPlateau();
|
||||||
int roll = p.roll4();
|
int roll = p.roll4(this.getJoueur());
|
||||||
|
|
||||||
Joueur joueur2 = joueur.choisiParmisTous();
|
Joueur joueur2 = joueur.choisiParmisTous();
|
||||||
super.attaquer(joueur2, roll);
|
super.attaquer(joueur2, roll);
|
||||||
|