IHM view
This commit is contained in:
parent
a830ddac88
commit
df68d70f3d
@ -13,6 +13,7 @@ import javafx.scene.image.Image;
|
||||
import javafx.scene.image.ImageView;
|
||||
import javafx.scene.input.MouseEvent;
|
||||
import javafx.scene.layout.AnchorPane;
|
||||
import main.View;
|
||||
|
||||
public class MenuController implements Initializable{
|
||||
@FXML private AnchorPane rootPane;
|
||||
@ -36,9 +37,11 @@ public class MenuController implements Initializable{
|
||||
System.out.println("Passage à l'écran de choix des joueurs");
|
||||
AnchorPane pane = FXMLLoader.load(getClass().getResource("../ressources/Choix_joueur.fxml"));
|
||||
rootPane.getChildren().setAll(pane);
|
||||
View.lancerPartie();
|
||||
}
|
||||
|
||||
public void afficherRegle(MouseEvent mouseEvent) {
|
||||
System.out.println("blaaaa");
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -20,6 +20,7 @@ import javafx.scene.layout.BorderPane;
|
||||
import javafx.scene.layout.HBox;
|
||||
import main.Joueur;
|
||||
import main.JoueurVirtuel;
|
||||
import main.View;
|
||||
|
||||
public class PlayersController implements Initializable{
|
||||
|
||||
@ -104,6 +105,7 @@ public class PlayersController implements Initializable{
|
||||
alert.showAndWait();
|
||||
}else {
|
||||
System.out.println("Lancement du jeu...");
|
||||
View.initPartie(joueurs);
|
||||
FXMLLoader loader = new FXMLLoader(getClass().getResource("../ressources/Plateau.fxml"));
|
||||
Parent root = loader.load();
|
||||
|
||||
|
@ -1,12 +1,16 @@
|
||||
package main;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class Configuration {
|
||||
private int nombreJoueurs;
|
||||
private int nombreJoueursHumains;
|
||||
private List<String> nomsJoueurs;
|
||||
|
||||
//TODO : attribut pour prendre en compte si jeu est normal ou demarrage rapide?
|
||||
|
||||
public Configuration (int nj, int njh) {
|
||||
public Configuration (List<String> nomsJoueurs,int nj, int njh) {
|
||||
this.nomsJoueurs = nomsJoueurs;
|
||||
nombreJoueurs = nj;
|
||||
nombreJoueursHumains = njh;
|
||||
}
|
||||
|
@ -3,14 +3,14 @@ package main;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.sun.tools.javac.Main;
|
||||
|
||||
import effet.Effet;
|
||||
|
||||
public class GestionnaireJeu {
|
||||
|
||||
|
||||
private Plateau plateau;
|
||||
private View view;
|
||||
|
||||
|
||||
|
||||
public GestionnaireJeu() {
|
||||
@ -20,15 +20,13 @@ public class GestionnaireJeu {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
switch(1){
|
||||
|
||||
case 1:
|
||||
lancerPartie();
|
||||
case 2:
|
||||
lancerConfiguration();
|
||||
default:
|
||||
break;
|
||||
try {
|
||||
Main.main(null);
|
||||
} catch (Exception e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public Plateau getPlateau() {
|
||||
@ -48,6 +46,8 @@ public class GestionnaireJeu {
|
||||
}
|
||||
|
||||
public static Configuration lancerConfiguration() {
|
||||
|
||||
|
||||
//TODO
|
||||
return null;
|
||||
}
|
||||
|
@ -1,25 +1,44 @@
|
||||
package main;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import javafx.scene.Parent;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.stage.Stage;
|
||||
import java.util.List;
|
||||
|
||||
public class View extends Application{
|
||||
public class View{
|
||||
|
||||
private static View view;
|
||||
|
||||
private View() {}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void start(Stage primaryStage) throws Exception{
|
||||
Parent root = FXMLLoader.load(getClass().getResource("ressources/Plateau.fxml"));
|
||||
primaryStage.setTitle("Shadow Hunters");
|
||||
primaryStage.setScene(new Scene(root));
|
||||
primaryStage.show();
|
||||
static {
|
||||
try {
|
||||
view = new View();
|
||||
}catch(Exception e) {
|
||||
throw new RuntimeException("View Singleton");
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
launch(args);
|
||||
public static View getView() {
|
||||
return view;
|
||||
}
|
||||
|
||||
|
||||
public static void initPartie(List<Joueur> joueurs) {
|
||||
|
||||
}
|
||||
|
||||
public static void lancerPartie() {
|
||||
|
||||
}
|
||||
|
||||
public static void menu() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
public void applyConfiguration(GestionnaireJeu gj,Configuration c) {
|
||||
|
||||
}
|
||||
|
||||
public List<Joueur> getJoueurs() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user