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