From 04615814a9bec260c12cb113856723d5e38b243b Mon Sep 17 00:00:00 2001 From: MatthisFauvet Date: Wed, 9 Oct 2024 10:04:00 +0200 Subject: [PATCH] Added documentation and rewording --- api_but5.5.iml => API_BUT5.5.iml | 0 README.md | 9 ++- but3GameBody.iml | 11 ---- .../iut_fbleau/api_but5.5/entity/Plateau.java | 14 ----- src/fr/iut_fbleau/api_but5.5/entity/Ply.java | 6 -- .../iut_fbleau/api_but5.5/entity/Result.java | 9 --- .../raw_api_body/entity/Plateau.java | 57 +++++++++++++++++++ .../entity/Player.java | 4 +- .../iut_fbleau/raw_api_body/entity/Ply.java | 6 ++ .../raw_api_body/entity/Result.java | 21 +++++++ 10 files changed, 93 insertions(+), 44 deletions(-) rename api_but5.5.iml => API_BUT5.5.iml (100%) delete mode 100644 but3GameBody.iml delete mode 100644 src/fr/iut_fbleau/api_but5.5/entity/Plateau.java delete mode 100644 src/fr/iut_fbleau/api_but5.5/entity/Ply.java delete mode 100644 src/fr/iut_fbleau/api_but5.5/entity/Result.java create mode 100644 src/fr/iut_fbleau/raw_api_body/entity/Plateau.java rename src/fr/iut_fbleau/{api_but5.5 => raw_api_body}/entity/Player.java (52%) create mode 100644 src/fr/iut_fbleau/raw_api_body/entity/Ply.java create mode 100644 src/fr/iut_fbleau/raw_api_body/entity/Result.java diff --git a/api_but5.5.iml b/API_BUT5.5.iml similarity index 100% rename from api_but5.5.iml rename to API_BUT5.5.iml diff --git a/README.md b/README.md index 24b1e09..54c6488 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,14 @@ # API PUBLIQUE - Conception de jeu +## Documentation -# Journal des modifications - +### Plateau : + +## Journal des modifications ### 09/10/2024 - 9h10 : Création de l'API publique + +### 09/10/2024 - 9h50 : +- Rewording des packages +- Ajout de la documentation diff --git a/but3GameBody.iml b/but3GameBody.iml deleted file mode 100644 index c90834f..0000000 --- a/but3GameBody.iml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/src/fr/iut_fbleau/api_but5.5/entity/Plateau.java b/src/fr/iut_fbleau/api_but5.5/entity/Plateau.java deleted file mode 100644 index 911ada4..0000000 --- a/src/fr/iut_fbleau/api_but5.5/entity/Plateau.java +++ /dev/null @@ -1,14 +0,0 @@ -package fr.iut_fbleau.but3GameBody.entity; - -import java.util.Iterator; - -public interface Plateau { - - Player getPlayer(); - boolean isFinished(); - Result getResult(); - Iterator givePlies(); - void doo(Ply ply); - void undo(Ply ply); - -} diff --git a/src/fr/iut_fbleau/api_but5.5/entity/Ply.java b/src/fr/iut_fbleau/api_but5.5/entity/Ply.java deleted file mode 100644 index 8268d25..0000000 --- a/src/fr/iut_fbleau/api_but5.5/entity/Ply.java +++ /dev/null @@ -1,6 +0,0 @@ -package fr.iut_fbleau.but3GameBody.entity; - -public abstract class Ply { - - -} diff --git a/src/fr/iut_fbleau/api_but5.5/entity/Result.java b/src/fr/iut_fbleau/api_but5.5/entity/Result.java deleted file mode 100644 index aa71e52..0000000 --- a/src/fr/iut_fbleau/api_but5.5/entity/Result.java +++ /dev/null @@ -1,9 +0,0 @@ -package fr.iut_fbleau.but3GameBody.entity; - -public class Result { - - public final static int GAGNE = 1; - public final static int EGALITE = 0; - public final static int PERDU = -1; - -} diff --git a/src/fr/iut_fbleau/raw_api_body/entity/Plateau.java b/src/fr/iut_fbleau/raw_api_body/entity/Plateau.java new file mode 100644 index 0000000..c5beff8 --- /dev/null +++ b/src/fr/iut_fbleau/raw_api_body/entity/Plateau.java @@ -0,0 +1,57 @@ +package fr.iut_fbleau.raw_api_body.entity; + +import java.util.Iterator; + +/** + * The interface Plateau. + */ +public interface Plateau { + + /** + * Return the current player + * + * @return the player + */ + Player getPlayer(); + + /** + * Return the game status + * - true if party is finished + * - false else + * + * @return the boolean + */ + boolean isFinished(); + + /** + * Return the result of a try + * - if the move is winnable : 1 + * - if the move is a draw : 0 + * - if its a defeat move : -1 + * + * @return the result + */ + Result getResult(); + + /** + * Gives previous played plies + * + * @return the iterator + */ + Iterator givePlies(); + + /** + * Play a ply + * + * @param ply the ply + */ + void doo(Ply ply); + + /** + * Removed a ply. + * + * @param ply the ply + */ + void undo(Ply ply); + +} diff --git a/src/fr/iut_fbleau/api_but5.5/entity/Player.java b/src/fr/iut_fbleau/raw_api_body/entity/Player.java similarity index 52% rename from src/fr/iut_fbleau/api_but5.5/entity/Player.java rename to src/fr/iut_fbleau/raw_api_body/entity/Player.java index fc336ef..25f5a2e 100644 --- a/src/fr/iut_fbleau/api_but5.5/entity/Player.java +++ b/src/fr/iut_fbleau/raw_api_body/entity/Player.java @@ -1,8 +1,6 @@ -package fr.iut_fbleau.but3GameBody.entity; +package fr.iut_fbleau.raw_api_body.entity; public enum Player { - JOUEUR1, JOUEUR2 - } diff --git a/src/fr/iut_fbleau/raw_api_body/entity/Ply.java b/src/fr/iut_fbleau/raw_api_body/entity/Ply.java new file mode 100644 index 0000000..9225c73 --- /dev/null +++ b/src/fr/iut_fbleau/raw_api_body/entity/Ply.java @@ -0,0 +1,6 @@ +package fr.iut_fbleau.raw_api_body.entity; + +public abstract class Ply { + + +} diff --git a/src/fr/iut_fbleau/raw_api_body/entity/Result.java b/src/fr/iut_fbleau/raw_api_body/entity/Result.java new file mode 100644 index 0000000..10bc2ef --- /dev/null +++ b/src/fr/iut_fbleau/raw_api_body/entity/Result.java @@ -0,0 +1,21 @@ +package fr.iut_fbleau.raw_api_body.entity; + +/** + * The type Result. + */ +public class Result { + + /** + * The constant GAGNE. + */ + public final static int GAGNE = 1; + /** + * The constant EGALITE. + */ + public final static int EGALITE = 0; + /** + * The constant PERDU. + */ + public final static int PERDU = -1; + +}