This commit is contained in:
Paul Gross 2020-05-06 16:17:26 +02:00
commit 4734e9bb7d
30 changed files with 469 additions and 214 deletions

View File

@ -19,7 +19,13 @@ Pour gagner, les Hunters et Shadow doivent éliminer tous les personnages du cam
## Comment l'utiliser
Vous trouverez la documentation pour utliser notre application [ici].
Dans un premier temps, vous pouvez télécharger la dernière version de notre application en utilisant la commande :
```git clone https://github.com/PTE-SH/ShadowHunterGame.git```
Puis, il faut executez le ``ShadowHunterGame.exe`` pour pouvoir y jouer.
Ce projet repose sur le [Java JDK 11](https://www.oracle.com/java/technologies/javase-jdk11-downloads.html) pour pouvoir fonctionner.
## Auteurs

View File

@ -0,0 +1,39 @@
package database;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;
public class DatabaseManager {
private final static String url = "jdbc:postgresql://localhost:5432/ShadowHunterDatabase";
private final static String user = "shManager";
private final static String password = "shadowhunter1234";
public static Connection connect() throws SQLException {
return DriverManager.getConnection(url, user, password);
}
public static List<Record> remplirTable(String query) {
List<Record> list = new ArrayList<Record>();
try (Connection connection = connect()) {
//System.out.println("Connected to PostgreSQL database!");
Statement statement = connection.createStatement();
//System.out.println("Reading records...");
ResultSet retour = statement.executeQuery(query);
while (retour.next()) {
list.add(new Record(retour.getString("id"), retour.getString("nom"), retour.getBytes("image"), retour.getBytes("objet")));
}
} catch (SQLException e) {
System.err.println("Connection failure.");
e.printStackTrace();
}
return list;
}
}

View File

@ -1,44 +1,14 @@
package database;
import java.awt.image.BufferedImage;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;
/*
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
*/
public class DatabaseTesting {
public static void main(String[] args) throws IOException {
Table a = new Table("a");
a.remplirTableAllFrom("CartesAll");
a.fillList(QueryGenerator.AllFrom("CartesAll"));
System.out.println(a.toString());
//a.getList().get(1).getImg()
BufferedImage image = ImageIO.read( new ByteArrayInputStream( a.getList().get(1).getImg() ) );
ImageIO.write(image, "JPG", new File("filename.jpg"));
/*
* PreparedStatement ps = conn.prepareStatement("SELECT img FROM images WHERE imgname = ?");
ps.setString(1, "myimage.gif");
ResultSet rs = ps.executeQuery();
while (rs.next()) {
byte[] imgBytes = rs.getBytes(1); OR byte []out = (byte[])(rs.getObject(1));
// use the data in some way here
}
rs.close();
ps.close();*/
}

View File

@ -9,6 +9,7 @@ public class Record {
public Record() {
this("0", "", null);
}
public Record(String n, byte[] b) {
@ -22,6 +23,7 @@ public class Record {
this.img = b;
}
public Record(String i, String n, byte[] b, byte[] obj) {
this.id = i;
this.nom = n;
@ -41,8 +43,9 @@ public class Record {
return img;
}
@Override
public String toString() {
return String.format("%-20.30s %-30.30s %-20.30s%n", this.getId(), this.getNom(), this.getImg());
return String.format("%-20.30s %-30.30s %-20.30s %-20.30s%n", this.getId(), this.getNom(), this.getImg(), this.getObjet());
}
public byte[] getObjet() {

View File

@ -21,55 +21,8 @@ public class Table {
this.name = JavaTableName;
}
public void remplirTableAllFrom(String DatabaseTableName) {
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.AllFrom(DatabaseTableName));
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 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) {
System.out.println("Connection failure.");
e.printStackTrace();
}
public void fillList(String query) {
this.list = DatabaseManager.remplirTable(query);
}
public void remplirTableQuery(String query) {
@ -89,23 +42,23 @@ public class Table {
}
}
public String getName() {
protected String getName() {
return name;
}
public void setName(String name) {
protected void setName(String name) {
this.name = name;
}
public List<Record> getList() {
protected List<Record> getList() {
return list;
}
public String toString() {
return " " + this.getList();
return this.getList().toString();
}
public boolean isEmpty() {
protected boolean isEmpty() {
if(list.isEmpty()) {
return true;
} else {

View File

@ -16,7 +16,6 @@ import main.GestionnaireJeu;
public class Main extends Application {
@Override
public void start(Stage primaryStage) throws Exception {
final URL fxmlURL = getClass().getResource("ressources/Menu.fxml");
final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", Locale.FRANCE);
final FXMLLoader fxmlLoader = new FXMLLoader(fxmlURL, bundle);
@ -30,7 +29,7 @@ public class Main extends Application {
public void handle(WindowEvent arg0) {
System.exit(0);
}
});
});
primaryStage.setMaximized(true);
primaryStage.show();
}

View File

@ -1,24 +1,62 @@
package ihm.controller;
import java.io.InputStream;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import java.util.ResourceBundle;
import carte.CarteEquipement;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.layout.GridPane;
import main.Joueur;
import carte.CarteEquipement;
public class ChoisirEquipement implements Initializable{
@FXML private GridPane equipement;
@FXML private GridPane grilleEquipement;
private Joueur joueurVole;
private CarteEquipement equipementVole;
private List<CarteEquipement> equipements = new ArrayList<CarteEquipement>();
private CarteEquipement equipementSelected;
@Override
public void initialize(URL arg0, ResourceBundle arg1) {
// TODO Auto-generated method stub
for (int i=0; i<equipements.size(); i++) {
ImageView carte = (ImageView) grilleEquipement.getChildren().get(i);
/*InputStream input = getClass().getResourceAsStream("/ihm/ressources/img/" + "nomcarte" + ".png");
Image image = new Image(input);
carte.setImage(image);*/
int numEquipement = i;
carte.setOnMouseClicked(e -> {
equipementSelected = equipements.get(numEquipement);
});
}
}
public List<CarteEquipement> getEquipements() {
return equipements;
}
public void setEquipements(List<CarteEquipement> equipements) {
this.equipements = equipements;
}
public CarteEquipement getEquipementSelected() {
return equipementSelected;
}
public void setEquipementSelected(CarteEquipement equipementSelected) {
this.equipementSelected = equipementSelected;
}
public GridPane getGrilleEquipement() {
return grilleEquipement;
}
public void setGrilleEquipement(GridPane grilleEquipement) {
this.grilleEquipement = grilleEquipement;
}
}

View File

@ -20,13 +20,15 @@ public class ChoisirJoueur implements Initializable{
for (int i=0; i<joueurHaut.getChildren().size(); i++) {
int numJoueur = i;
joueurHaut.getChildren().get(i).setOnMouseClicked(e -> {
System.out.println("Vous avez choisi le joueur " + (numJoueur+1));
this.joueurSelected = numJoueur;
});
}
for (int i=0; i<joueurBas.getChildren().size(); i++) {
int numJoueur = i;
joueurHaut.getChildren().get(i).setOnMouseClicked(e -> {
int numJoueur = i+4;
joueurBas.getChildren().get(i).setOnMouseClicked(e -> {
System.out.println("Vous avez choisi le joueur " + (numJoueur+1));
this.joueurSelected = numJoueur;
});
}

View File

@ -1,9 +0,0 @@
package ihm.controller;
public class JouerSonTour2Controller extends ChoisirBoolean{
public void initButtons () {
super.getOuiButton().setText("utiliser.capaciter.lieux");
super.getNonButton().setText("sauter.etape");
super.getTitre().setText("description.capacite.carte.lieux");
}
}

View File

@ -1,9 +0,0 @@
package ihm.controller;
public class JouerSonTour2c1Controller extends ChoisirBoolean{
public void initButtons () {
super.getOuiButton().setText("Attaquer !");
super.getNonButton().setText("se.soigner");
super.getTitre().setText("attaquer.ou.soigner");
}
}

View File

@ -1,9 +0,0 @@
package ihm.controller;
public class JouerSonTour3Controller extends ChoisirBoolean{
public void initButtons () {
super.getOuiButton().setText("Attaquer !");
super.getNonButton().setText("Ne pas attaquer");
super.getTitre().setText("Voulez-vous attaquer un joueur ?");
}
}

View File

@ -15,6 +15,6 @@ public class JouerSonTour4Controller extends LancerDes{
@Override
public void initialize(URL arg0, ResourceBundle arg1) {
super.initialize(arg0, arg1);
defenseur.setText(j.getNom());
//defenseur.setText(j.getNom());
}
}

View File

@ -14,36 +14,44 @@ public class LancerDes implements Initializable{
@FXML private Button btnStop;
@FXML private Button btnLancer;
private int[] valeurD6 = {1, 2, 3, 4, 5, 6};
private int[] valeurD4 = {1, 2, 3, 4};
private int resultatD6;
private int resultatD4;
private boolean lancement = true;
@Override
public void initialize(URL arg0, ResourceBundle arg1) {
// TODO Auto-generated method stub
btnStop.setVisible(false);
btnLancer.setOnAction(e -> {
lancement();
btnLancer.setVisible(false);
btnStop.setVisible(true);
try {
btnLancer.setVisible(false);
btnStop.setVisible(true);
lancement();
} catch (InterruptedException e1) {
e1.printStackTrace();
}
});
btnStop.setOnAction(e -> {
//à remplir avec les valeurs donné par le gestionnaire de jeux
lancement = false;
d6.setText(Integer.toString(resultatD6));
d4.setText(Integer.toString(resultatD4));
});
}
public void lancement() {
/*for (int i=1; i<7; i++) {
Thread.sleep(500);
d6.setText(Integer.toString(i));
}
for (int i=1; i<5; i++) {
Thread.sleep(500);
d4.setText(Integer.toString(i));
public void lancement() throws InterruptedException {
/*int i=0;
while (lancement) {
d6.setText(Integer.toString(valeurD6[i%6]));
d4.setText(Integer.toString(valeurD4[i%4]));
i++;
//Thread.sleep(500);
}*/
}
}

View File

@ -0,0 +1,40 @@
package ihm.controller;
import java.net.URL;
import java.util.ResourceBundle;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Button;
import main.Type;
import main.TypeLumiere;
import main.TypeTenebre;
import main.TypeVision;
public class PiocherCarte implements Initializable{
@FXML private Button lumiere;
@FXML private Button vision;
@FXML private Button tenebre;
private Type carte;
@Override
public void initialize(URL arg0, ResourceBundle arg1) {
lumiere.setOnAction(e ->{
carte = new TypeLumiere();
});
vision.setOnAction(e -> {
carte = new TypeVision();
});
tenebre.setOnAction(e -> {
carte = new TypeTenebre();
});
}
public Type getCarte() {
return carte;
}
}

View File

@ -0,0 +1,69 @@
package ihm.controller;
import java.net.URL;
import java.util.ResourceBundle;
import carte.Carte;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Label;
import javafx.scene.image.ImageView;
import javafx.scene.input.MouseEvent;
public class VisualiserCarte implements Initializable{
@FXML private Label typeCarte;
@FXML private Label effetCarte;
@FXML private ImageView imageCarte;
private Carte carte;
@Override
public void initialize(URL arg0, ResourceBundle arg1) {
/*typeCarte.setText(carte.getNom());
effetCarte.setText(carte.getDescription());*/
}
/**
* signe la fin du tour
* @param mouseEvent click n'importe ou sur la fenetre
*/
@FXML
private void fin (MouseEvent mouseEvent) {
}
public Label getTypeCarte() {
return typeCarte;
}
public void setTypeCarte(Label typeCarte) {
this.typeCarte = typeCarte;
}
public Label getEffetCarte() {
return effetCarte;
}
public void setEffetCarte(Label effetCarte) {
this.effetCarte = effetCarte;
}
public ImageView getImageCarte() {
return imageCarte;
}
public void setImageCarte(ImageView imageCarte) {
this.imageCarte = imageCarte;
}
public Carte getCarte() {
return carte;
}
public void setCarte(Carte carte) {
this.carte = carte;
}
}

View File

@ -0,0 +1,12 @@
package ihm.controller;
import javafx.fxml.FXML;
import javafx.scene.input.MouseEvent;
public class VisualiserCarteVision extends VisualiserCarte{
@FXML
public void voirCarte(MouseEvent mouseEvent) {
//super.getImageCarte().setImage(arg0);
System.out.println("\tCarte vision");
}
}

View File

@ -1,11 +0,0 @@
<?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>

View File

@ -8,7 +8,7 @@
<?import javafx.scene.layout.Pane?>
<?import javafx.scene.text.Font?>
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="180.0" prefWidth="255.0" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ihm.controller.JouerSonTour2Controller">
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="180.0" prefWidth="255.0" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ihm.controller.ChoisirBoolean">
<children>
<Pane fx:id="rootPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="180.0" prefWidth="255.0" stylesheets="@style/popUp.css">
<children>

View File

@ -14,9 +14,9 @@
<Pane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="180.0" prefWidth="255.0" stylesheets="@style/popUp.css">
<children>
<Label layoutX="58.0" layoutY="14.0" text="%voler.equipement.joueur" />
<ScrollPane layoutX="28.0" layoutY="40.0" prefHeight="128.0" prefWidth="200.0">
<ScrollPane layoutX="28.0" layoutY="38.0" prefHeight="128.0" prefWidth="200.0">
<content>
<GridPane fx:id="equipement">
<GridPane fx:id="grilleEquipement">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" />
<ColumnConstraints hgrow="SOMETIMES" />
@ -25,6 +25,8 @@
</columnConstraints>
<rowConstraints>
<RowConstraints vgrow="SOMETIMES" />
<RowConstraints vgrow="SOMETIMES" />
<RowConstraints vgrow="SOMETIMES" />
<RowConstraints vgrow="SOMETIMES" />
<RowConstraints vgrow="SOMETIMES" />
<RowConstraints vgrow="SOMETIMES" />
@ -34,6 +36,14 @@
<ImageView fitHeight="60.0" fitWidth="43.0" pickOnBounds="true" preserveRatio="true" GridPane.columnIndex="1" />
<ImageView fitHeight="60.0" fitWidth="43.0" pickOnBounds="true" preserveRatio="true" GridPane.columnIndex="2" />
<ImageView fitHeight="60.0" fitWidth="43.0" pickOnBounds="true" preserveRatio="true" GridPane.columnIndex="3" />
<ImageView fitHeight="60.0" fitWidth="43.0" pickOnBounds="true" preserveRatio="true" GridPane.rowIndex="1" />
<ImageView fitHeight="60.0" fitWidth="43.0" pickOnBounds="true" preserveRatio="true" GridPane.columnIndex="1" GridPane.rowIndex="1" />
<ImageView fitHeight="60.0" fitWidth="43.0" pickOnBounds="true" preserveRatio="true" GridPane.columnIndex="2" GridPane.rowIndex="1" />
<ImageView fitHeight="60.0" fitWidth="43.0" pickOnBounds="true" preserveRatio="true" GridPane.columnIndex="3" GridPane.rowIndex="1" />
<ImageView fitHeight="60.0" fitWidth="43.0" pickOnBounds="true" preserveRatio="true" GridPane.rowIndex="2" />
<ImageView fitHeight="60.0" fitWidth="43.0" pickOnBounds="true" preserveRatio="true" GridPane.columnIndex="1" GridPane.rowIndex="2" />
<ImageView fitHeight="60.0" fitWidth="43.0" pickOnBounds="true" preserveRatio="true" GridPane.columnIndex="2" GridPane.rowIndex="2" />
<ImageView fitHeight="60.0" fitWidth="43.0" pickOnBounds="true" preserveRatio="true" GridPane.columnIndex="3" GridPane.rowIndex="2" />
</children>
</GridPane>
</content>

View File

@ -1,15 +1,44 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.image.Image?>
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.Pane?>
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="180.0" prefWidth="255.0" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1">
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="180.0" prefWidth="255.0" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ihm.controller.PiocherCarte">
<children>
<Pane fx:id="rootPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="180.0" prefWidth="255.0" stylesheets="@style/popUp.css">
<children>
<Label layoutX="88.0" layoutY="82.0" text="%piocher.carte" />
<Label layoutX="88.0" layoutY="40.0" text="%piocher.carte" />
<Button fx:id="lumiere" layoutX="20.0" layoutY="77.0" mnemonicParsing="false" style="-fx-border-width: 0;">
<graphic>
<ImageView fitHeight="77.0" fitWidth="55.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@img/dosCartesLumière.jpg" />
</image>
</ImageView>
</graphic>
</Button>
<Button fx:id="vision" layoutX="93.0" layoutY="77.0" mnemonicParsing="false" style="-fx-border-width: 0;">
<graphic>
<ImageView fitHeight="77.0" fitWidth="55.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@img/dosCartesVision.jpg" />
</image>
</ImageView>
</graphic>
</Button>
<Button fx:id="tenebre" layoutX="166.0" layoutY="77.0" mnemonicParsing="false" style="-fx-border-width: 0;">
<graphic>
<ImageView fitHeight="77.0" fitWidth="55.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@img/dosCartesNoires.jpg" />
</image>
</ImageView>
</graphic>
</Button>
</children>
</Pane>
</children>

View File

@ -7,24 +7,23 @@
<?import javafx.scene.layout.Pane?>
<?import javafx.scene.layout.VBox?>
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="180.0" prefWidth="255.0" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1">
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="180.0" prefWidth="255.0" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ihm.controller.VisualiserCarte">
<children>
<Pane fx:id="rootPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="180.0" prefWidth="255.0" stylesheets="@style/popUp.css">
<Pane fx:id="rootPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" onMouseClicked="#fin" prefHeight="180.0" prefWidth="255.0" stylesheets="@style/popUp.css">
<children>
<VBox alignment="CENTER" prefHeight="180.0" prefWidth="255.0">
<children>
<HBox alignment="CENTER" prefHeight="72.0" prefWidth="357.0">
<children>
<Label prefHeight="27.0" prefWidth="54.0" text="%carte" />
<Label prefHeight="17.0" prefWidth="121.0" text="*Lumiere ou Tenebre" />
<Label fx:id="typeCarte" prefHeight="17.0" prefWidth="121.0" text="*Lumiere ou Tenebre" />
</children>
</HBox>
<ImageView fitHeight="131.0" fitWidth="94.0" pickOnBounds="true" preserveRatio="true" />
<ImageView fx:id="imageCarte" fitHeight="131.0" fitWidth="94.0" pickOnBounds="true" preserveRatio="true" />
<HBox alignment="CENTER" prefHeight="111.0" prefWidth="600.0">
<children>
<Label prefHeight="27.0" prefWidth="54.0" text="%effet" />
<Label prefHeight="27.0" prefWidth="91.0" text="*effet de la carte" />
<Label fx:id="effetCarte" prefHeight="27.0" prefWidth="91.0" text="*effet de la carte" />
</children>
</HBox>
</children>

View File

@ -8,15 +8,14 @@
<?import javafx.scene.layout.Pane?>
<?import javafx.scene.layout.VBox?>
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="180.0" prefWidth="255.0" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1">
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="180.0" prefWidth="255.0" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ihm.controller.VisualiserCarteVision">
<children>
<Pane fx:id="rootPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="180.0" prefWidth="255.0" stylesheets="@style/popUp.css">
<children>
<VBox alignment="CENTER" prefHeight="180.0" prefWidth="255.0">
<children>
<Label prefHeight="17.0" prefWidth="76.0" text="%carte.vision" />
<ImageView fitHeight="104.0" fitWidth="75.0" pickOnBounds="true" preserveRatio="true" />
<Label fx:id="typeCarte" prefHeight="17.0" prefWidth="76.0" text="%carte.vision" />
<ImageView fx:id="imageCarte" fitHeight="104.0" fitWidth="75.0" pickOnBounds="true" preserveRatio="true" />
<Label prefHeight="17.0" prefWidth="155.0" text="%carte.vue.par.joueur.pioche" />
<Button mnemonicParsing="false" onMouseClicked="#voirCarte" text="%voir.carte">
<VBox.margin>

View File

@ -1,41 +1,84 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.Pane?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Font?>
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="180.0" prefWidth="255.0" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1">
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="180.0" prefWidth="255.0" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ihm.controller.ChoisirJoueur">
<children>
<Pane fx:id="rootPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="180.0" prefWidth="255.0" stylesheets="@style/popUp.css">
<Pane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="180.0" prefWidth="255.0" stylesheets="@style/popUp.css">
<children>
<VBox alignment="CENTER" prefHeight="165.0" prefWidth="255.0">
<HBox fx:id="joueurHaut" layoutX="4.0" layoutY="14.0">
<children>
<HBox alignment="CENTER" prefHeight="184.0" prefWidth="600.0">
<children>
<VBox alignment="CENTER" prefHeight="178.0" prefWidth="599.0">
<children>
<Label prefHeight="17.0" prefWidth="69.0" text="%voir.carte" />
<HBox alignment="CENTER" prefHeight="100.0" prefWidth="200.0">
<children>
<ImageView fitHeight="114.0" fitWidth="82.0" pickOnBounds="true" preserveRatio="true" />
<HBox alignment="CENTER" prefHeight="100.0" prefWidth="200.0">
<children>
<Label prefHeight="27.0" prefWidth="97.0" text="*Effet de la carte" textAlignment="CENTER" />
</children>
</HBox>
</children>
</HBox>
<Label prefHeight="17.0" prefWidth="136.0" text="%jouer.a.qui.donner.carte" />
</children>
</VBox>
</children>
</HBox>
<Button mnemonicParsing="false" text="%joueur1">
<font>
<Font size="10.0" />
</font>
</Button>
<Button mnemonicParsing="false" text="%joueur2">
<font>
<Font size="10.0" />
</font>
<HBox.margin>
<Insets left="2.0" />
</HBox.margin>
</Button>
<Button mnemonicParsing="false" text="%joueur3">
<font>
<Font size="10.0" />
</font>
<HBox.margin>
<Insets left="2.0" />
</HBox.margin>
</Button>
<Button mnemonicParsing="false" text="%joueur4">
<font>
<Font size="10.0" />
</font>
<HBox.margin>
<Insets left="2.0" />
</HBox.margin>
</Button>
</children>
</VBox>
</HBox>
<HBox fx:id="joueurBas" layoutX="4.0" layoutY="139.0">
<children>
<Button mnemonicParsing="false" text="%joueur5">
<font>
<Font size="10.0" />
</font>
<HBox.margin>
<Insets right="2.0" />
</HBox.margin>
</Button>
<Button mnemonicParsing="false" text="%joueur6">
<font>
<Font size="10.0" />
</font>
<HBox.margin>
<Insets right="2.0" />
</HBox.margin>
</Button>
<Button mnemonicParsing="false" text="%joueur7">
<font>
<Font size="10.0" />
</font>
<HBox.margin>
<Insets right="2.0" />
</HBox.margin>
</Button>
<Button mnemonicParsing="false" text="%joueur8">
<font>
<Font size="10.0" />
</font>
</Button>
</children>
</HBox>
<Label fx:id="titre" layoutX="9.0" layoutY="82.0" text="Choisir un joueur à qui donner la carte vision" />
</children>
</Pane>
</children>

View File

@ -5,7 +5,7 @@
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.Pane?>
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="180.0" prefWidth="255.0" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ihm.controller.JouerSonTour2c1Controller">
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="180.0" prefWidth="255.0" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ihm.controller.ChoisirBoolean">
<children>
<Pane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="180.0" prefWidth="255.0" stylesheets="@style/popUp.css">
<children>

View File

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

View File

@ -4,7 +4,7 @@
<?import javafx.scene.control.Label?>
<?import javafx.scene.layout.Pane?>
<Pane fx:id="rootPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="180.0" prefWidth="255.0" stylesheets="@style/popUp.css" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ihm.controller.JouerSonTour3Controller">
<Pane fx:id="rootPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="180.0" prefWidth="255.0" stylesheets="@style/popUp.css" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ihm.controller.ChoisirBoolean">
<children>
<Button fx:id="nonButton" layoutX="136.0" layoutY="128.0" mnemonicParsing="false" text="Ne pas attaquer" />
<Label fx:id="titre" layoutX="40.0" layoutY="31.0" text="Voulez-vous attaquer un joueur ?" />

View File

@ -1,11 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.image.Image?>
<?import javafx.scene.image.ImageView?>
<ImageView fitHeight="33.0" fitWidth="200.0" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1">
<image>
<Image url="@dice.sprite.png" />
</image>
</ImageView>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

View File

@ -39,42 +39,42 @@ public class TestDatabse {
@Test
void getEntireTableCartesLumiere() {
System.out.println("Test getEntireTableCartesLumiere");
t.remplirTableAllFrom("CartesLumiere");
t.fillList(QueryGenerator.AllFrom("CartesLumiere"));
Assert.assertFalse(t.isEmpty());
}
@Test
void getEntireTableCartesTenebre() {
System.out.println("Test getEntireTableCartesTenebre");
t.remplirTableAllFrom("CartesTenebre");
t.fillList(QueryGenerator.AllFrom("CartesTenebre"));
Assert.assertFalse(t.isEmpty());
}
@Test
void getEntireTableCartesVision() {
System.out.println("Test getEntireTableCartesVision");
t.remplirTableAllFrom("CartesVision");
t.fillList(QueryGenerator.AllFrom("CartesVision"));
Assert.assertFalse(t.isEmpty());
}
@Test
void getEntireTableCartesPersonnage() {
System.out.println("Test getEntireTableCartesPersonnage");
t.remplirTableAllFrom("CartesPersonnage");
t.fillList(QueryGenerator.AllFrom("CartesPersonnage"));
Assert.assertFalse(t.isEmpty());
}
@Test
void getEntireTableCartesDos() {
System.out.println("Test getEntireTableCartesDos");
t.remplirTableAllFrom("CartesDos");
t.fillList(QueryGenerator.AllFrom("CartesDos"));
Assert.assertFalse(t.isEmpty());
}
@Test
void getEntireTableCartesAll() {
System.out.println("Test getEntireTableCartesAll");
t.remplirTableAllFrom("CartesAll");
t.fillList(QueryGenerator.AllFrom("CartesAll"));
Assert.assertFalse(t.isEmpty());
}