diff --git a/2024-25/javaAPI/fr/iut_fbleau/GameAPI/AbstractBoard.java b/2024-25/javaAPI/fr/iut_fbleau/GameAPI/AbstractBoard.java index 8448b7a..95542ae 100644 --- a/2024-25/javaAPI/fr/iut_fbleau/GameAPI/AbstractBoard.java +++ b/2024-25/javaAPI/fr/iut_fbleau/GameAPI/AbstractBoard.java @@ -22,6 +22,14 @@ public abstract class AbstractBoard implements IBoard{ // used as a stack. private Deque history; + + + // constructeur à appeler dans le constructeur d'un fils concret avec super. + public AbstractBoard(Player p, Deque h){ + this.currentPlayer = p; + this.history = h; + } + /** * set current player to the other player. diff --git a/2024-25/javaAPI/fr/iut_fbleau/GameAPI/AbstractGame.java b/2024-25/javaAPI/fr/iut_fbleau/GameAPI/AbstractGame.java index 56e5e34..55a6acc 100644 --- a/2024-25/javaAPI/fr/iut_fbleau/GameAPI/AbstractGame.java +++ b/2024-25/javaAPI/fr/iut_fbleau/GameAPI/AbstractGame.java @@ -32,8 +32,11 @@ public abstract class AbstractGame { // a map from the enum Player to the genuine Player AbstractGamePlayer private EnumMap mapPlayers; - //NB. pas de constructeur possible on est abstrait, il faut faire une usine abstraite. - + // constructeur à appeler dans le constructeur d'un fils concret avec super. + public AbstractGame(IBoard b, EnumMap m){ + this.currentBoard=b; + this.mapPlayers=m; + } /** * boucle de contrôle du jeu. diff --git a/2024-25/javaAPI/fr/iut_fbleau/GameAPI/AbstractGamePlayer.java b/2024-25/javaAPI/fr/iut_fbleau/GameAPI/AbstractGamePlayer.java index be251ee..c459eab 100644 --- a/2024-25/javaAPI/fr/iut_fbleau/GameAPI/AbstractGamePlayer.java +++ b/2024-25/javaAPI/fr/iut_fbleau/GameAPI/AbstractGamePlayer.java @@ -13,6 +13,10 @@ public abstract class AbstractGamePlayer { // Le joueur réel pourrait avoir besoin de connaître un constructeur de coup? // pas pour l'instant. + // constructeur à appeler dans le constructeur d'un fils concret avec super. + public AbstractGamePlayer(Player p){ + this.iAm=p; + } /** * diff --git a/2024-25/javaAPI/fr/iut_fbleau/GameAPI/AbstractPly.java b/2024-25/javaAPI/fr/iut_fbleau/GameAPI/AbstractPly.java index 27c5984..211fc6f 100644 --- a/2024-25/javaAPI/fr/iut_fbleau/GameAPI/AbstractPly.java +++ b/2024-25/javaAPI/fr/iut_fbleau/GameAPI/AbstractPly.java @@ -3,6 +3,11 @@ package fr.iut_fbleau.GameAPI; public abstract class AbstractPly { private Player joueur; + // constructeur à appeler dans le constructeur d'un fils concret avec super. + public AbstractPly(Player j){ + this.joueur=j; + } + public Player getPlayer(){ return this.joueur; }