Utilisation des capacités spéciales fonctionnelles
This commit is contained in:
parent
dc3414c023
commit
b51df99297
@ -27,7 +27,6 @@ import javafx.fxml.FXMLLoader;
|
|||||||
import javafx.fxml.Initializable;
|
import javafx.fxml.Initializable;
|
||||||
import javafx.scene.Group;
|
import javafx.scene.Group;
|
||||||
import javafx.scene.Parent;
|
import javafx.scene.Parent;
|
||||||
import javafx.scene.control.Button;
|
|
||||||
import javafx.scene.control.Label;
|
import javafx.scene.control.Label;
|
||||||
import javafx.scene.image.Image;
|
import javafx.scene.image.Image;
|
||||||
import javafx.scene.image.ImageView;
|
import javafx.scene.image.ImageView;
|
||||||
@ -39,7 +38,6 @@ import javafx.scene.layout.Pane;
|
|||||||
import javafx.scene.layout.StackPane;
|
import javafx.scene.layout.StackPane;
|
||||||
import javafx.scene.layout.VBox;
|
import javafx.scene.layout.VBox;
|
||||||
import javafx.scene.paint.Color;
|
import javafx.scene.paint.Color;
|
||||||
import javafx.scene.transform.Rotate;
|
|
||||||
import javafx.util.Duration;
|
import javafx.util.Duration;
|
||||||
import main.Contexte;
|
import main.Contexte;
|
||||||
import main.GestionnaireJeu;
|
import main.GestionnaireJeu;
|
||||||
@ -60,8 +58,6 @@ public class PlateauController implements Initializable {
|
|||||||
private PiocherCarte pc;
|
private PiocherCarte pc;
|
||||||
private LancerDes ld;
|
private LancerDes ld;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private Map<Carte,BufferedImage> mapRessourcesCartes;
|
private Map<Carte,BufferedImage> mapRessourcesCartes;
|
||||||
private Map<String,BufferedImage> mapRessourcesDosCartes;
|
private Map<String,BufferedImage> mapRessourcesDosCartes;
|
||||||
|
|
||||||
@ -369,12 +365,16 @@ public class PlateauController implements Initializable {
|
|||||||
Pane root = (Pane)fxmlLoader.load();
|
Pane root = (Pane)fxmlLoader.load();
|
||||||
AlterationVieZJ avzj = fxmlLoader.getController();
|
AlterationVieZJ avzj = fxmlLoader.getController();
|
||||||
avzj.changeLabel(valeur);
|
avzj.changeLabel(valeur);
|
||||||
|
|
||||||
|
|
||||||
JoueurIHM jihm = getJoueurIHM(j);
|
JoueurIHM jihm = getJoueurIHM(j);
|
||||||
|
Pane pane = (Pane) jihm.getZoneJoueur().getChildren().get(0);
|
||||||
jihm.setZoneJoueur(root);
|
jihm.setZoneJoueur(root);
|
||||||
Timeline timeline = new Timeline(new KeyFrame(
|
Timeline timeline = new Timeline(new KeyFrame(
|
||||||
Duration.millis(1000),
|
Duration.millis(1000),
|
||||||
ae -> {
|
ae -> {
|
||||||
jihm.resetZoneJoueur();
|
jihm.resetZoneJoueur();
|
||||||
|
jihm.setZoneJoueur(pane);
|
||||||
GestionnaireJeu.notifyPlateau();
|
GestionnaireJeu.notifyPlateau();
|
||||||
}));
|
}));
|
||||||
timeline.play();
|
timeline.play();
|
||||||
|
@ -4,6 +4,7 @@ import java.io.IOException;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Stack;
|
||||||
import java.util.concurrent.Callable;
|
import java.util.concurrent.Callable;
|
||||||
import java.util.concurrent.ExecutionException;
|
import java.util.concurrent.ExecutionException;
|
||||||
import java.util.concurrent.FutureTask;
|
import java.util.concurrent.FutureTask;
|
||||||
@ -25,7 +26,7 @@ public class GestionnaireJeu {
|
|||||||
|
|
||||||
private RessourceLoader ressourceLoader;
|
private RessourceLoader ressourceLoader;
|
||||||
|
|
||||||
private static Thread lastThread;
|
private static Stack<Thread> threads = new Stack<Thread>();
|
||||||
|
|
||||||
private static Plateau plateau;
|
private static Plateau plateau;
|
||||||
public static PlateauController pc;
|
public static PlateauController pc;
|
||||||
@ -208,10 +209,11 @@ public class GestionnaireJeu {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
public void waitPlateau() {
|
public void waitPlateau() {
|
||||||
lastThread = Thread.currentThread();
|
Thread t = Thread.currentThread();
|
||||||
synchronized(lastThread) {
|
threads.add(t);
|
||||||
|
synchronized(t) {
|
||||||
try {
|
try {
|
||||||
lastThread.wait();
|
t.wait();
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -219,10 +221,10 @@ public class GestionnaireJeu {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void notifyPlateau() {
|
public static void notifyPlateau() {
|
||||||
synchronized(lastThread) {
|
Thread t = threads.pop();
|
||||||
lastThread.notify();
|
synchronized(t) {
|
||||||
|
t.notify();
|
||||||
}
|
}
|
||||||
lastThread = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Type choisirCarte(Joueur joueur) {
|
public Type choisirCarte(Joueur joueur) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user