From ff80fac463b9be84d501355f4522c9f90eb5189d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFck=20Debay?= <loick.debay.etu@univ-lille.fr> Date: Wed, 9 Jun 2021 15:39:05 +0200 Subject: [PATCH 1/2] doc finie normalement --- src/moulin/AI.java | 3 +++ src/moulin/Board.java | 3 +++ src/moulin/Main.java | 3 +++ src/moulin/Node.java | 3 +++ src/moulin/NormalAI.java | 3 +++ src/moulin/Player.java | 3 +++ src/moulin/RandomAI.java | 3 +++ src/moulin/Trap.java | 3 +++ src/moulin/TrapTeleport.java | 3 +++ 9 files changed, 27 insertions(+) diff --git a/src/moulin/AI.java b/src/moulin/AI.java index e5391bf..294ebb0 100644 --- a/src/moulin/AI.java +++ b/src/moulin/AI.java @@ -1,5 +1,8 @@ package moulin; +/** + * Creates a default AI + */ public abstract class AI extends Player{ /** * creates an AI class diff --git a/src/moulin/Board.java b/src/moulin/Board.java index 8d82e3e..db03dbc 100644 --- a/src/moulin/Board.java +++ b/src/moulin/Board.java @@ -2,6 +2,9 @@ package moulin; import java.util.ArrayList; +/** + * Creates the game Board + */ public class Board { private ArrayList<Edge> edges; private ArrayList<Node> nodes; diff --git a/src/moulin/Main.java b/src/moulin/Main.java index 0635076..33464bc 100644 --- a/src/moulin/Main.java +++ b/src/moulin/Main.java @@ -7,6 +7,9 @@ import java.io.IOException; import java.lang.reflect.Array; import java.util.*; +/** + * Main class of the game + */ public class Main { /** diff --git a/src/moulin/Node.java b/src/moulin/Node.java index 44e8d0d..72b086a 100644 --- a/src/moulin/Node.java +++ b/src/moulin/Node.java @@ -2,6 +2,9 @@ package moulin; import java.util.ArrayList; +/** + * Creates a node + */ public class Node{ private int x; private int y; diff --git a/src/moulin/NormalAI.java b/src/moulin/NormalAI.java index 2150c8c..07ddc7f 100644 --- a/src/moulin/NormalAI.java +++ b/src/moulin/NormalAI.java @@ -2,6 +2,9 @@ package moulin; import java.util.ArrayList; +/** + * creates a normalAI that tries to play like a real player + */ public class NormalAI extends RandomAI{ /** diff --git a/src/moulin/Player.java b/src/moulin/Player.java index 013d694..27313fe 100644 --- a/src/moulin/Player.java +++ b/src/moulin/Player.java @@ -3,6 +3,9 @@ package moulin; import java.util.ArrayList; import java.util.Scanner; +/** + * Creates a player + */ public class Player { private final String name; diff --git a/src/moulin/RandomAI.java b/src/moulin/RandomAI.java index dc13448..be13e21 100644 --- a/src/moulin/RandomAI.java +++ b/src/moulin/RandomAI.java @@ -2,6 +2,9 @@ package moulin; import java.util.ArrayList; +/** + * creates an AI that plays randomly + */ public class RandomAI extends AI{ /** * Creates a RandomAI class diff --git a/src/moulin/Trap.java b/src/moulin/Trap.java index 6b480f2..f28c0b1 100644 --- a/src/moulin/Trap.java +++ b/src/moulin/Trap.java @@ -1,5 +1,8 @@ package moulin; +/** + * Creates a Trap + */ public class Trap { private int turnsLeft; diff --git a/src/moulin/TrapTeleport.java b/src/moulin/TrapTeleport.java index 77b065c..bca16ca 100644 --- a/src/moulin/TrapTeleport.java +++ b/src/moulin/TrapTeleport.java @@ -1,5 +1,8 @@ package moulin; +/** + * creates a teleport trap + */ public class TrapTeleport extends Trap{ private Node destination; -- GitLab From 8f7eb37269c97740402a32926e44736a062b386e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFck=20Debay?= <loick.debay.etu@univ-lille.fr> Date: Wed, 9 Jun 2021 15:53:28 +0200 Subject: [PATCH 2/2] correction doc --- src/ihm/Main.java | 6 +++--- src/ihm/SceneChoixJoueurs.java | 3 +++ src/ihm/SceneOptions.java | 2 +- src/moulin/Board.java | 4 ++++ src/moulin/ColorEnum.java | 1 + src/moulin/Jeu.java | 5 +++-- src/moulin/NormalAI.java | 3 ++- src/moulin/Player.java | 11 +++++++++-- src/moulin/Save.java | 5 +++++ 9 files changed, 31 insertions(+), 9 deletions(-) diff --git a/src/ihm/Main.java b/src/ihm/Main.java index 8c3f30b..441c1e9 100644 --- a/src/ihm/Main.java +++ b/src/ihm/Main.java @@ -1,13 +1,13 @@ package ihm; -/** - * Main class of the javaFX project - */ import javafx.application.Application; import javafx.scene.Scene; import javafx.stage.Stage; import moulin.Config; +/** + * Main class of the graphic project + */ public class Main extends Application { private static Stage stage; diff --git a/src/ihm/SceneChoixJoueurs.java b/src/ihm/SceneChoixJoueurs.java index 85dee50..708ffc6 100644 --- a/src/ihm/SceneChoixJoueurs.java +++ b/src/ihm/SceneChoixJoueurs.java @@ -19,6 +19,9 @@ public class SceneChoixJoueurs { private static Scene scene; private static Label nextLabel = new Label(); + /** + * players hbox + */ public static ListView<PlayerHBox> players = new ListView<>(); private static Button addButton = new Button("+"); diff --git a/src/ihm/SceneOptions.java b/src/ihm/SceneOptions.java index faaf845..0fc3c8b 100644 --- a/src/ihm/SceneOptions.java +++ b/src/ihm/SceneOptions.java @@ -57,7 +57,7 @@ public class SceneOptions { /** * gets the scene - * @return + * @return the scene */ public static Scene getScene(){ return scene; diff --git a/src/moulin/Board.java b/src/moulin/Board.java index db03dbc..d3a8bef 100644 --- a/src/moulin/Board.java +++ b/src/moulin/Board.java @@ -10,6 +10,10 @@ public class Board { private ArrayList<Node> nodes; private ArrayList<Line> lines; + /** + * main method + * @param args args + */ public static void main(String[] args) { Board board=Board.generateBoard(4); board.trapNode(1,2,3); diff --git a/src/moulin/ColorEnum.java b/src/moulin/ColorEnum.java index 464fc6a..91a1ea3 100644 --- a/src/moulin/ColorEnum.java +++ b/src/moulin/ColorEnum.java @@ -10,6 +10,7 @@ import java.util.Arrays; */ public enum ColorEnum { + NOIR('N',"\u001B[30m",new Color(0,0,0,1)),ROUGE('R',"\u001B[31m",new Color(1,0,0,1)),VERT('V',"\u001B[32m",new Color(0,1,0,1)), JAUNE('J',"\u001B[33m",new Color(1,1,0,1)), MAGENTA('M',"\u001B[35m",new Color(1,0,1,1)),BLEU('B',"\u001B[34m",new Color(0,0,1,1)),CYAN('C',"\u001B[36m",new Color(0,1,1,1)); diff --git a/src/moulin/Jeu.java b/src/moulin/Jeu.java index 36c5c77..58ad037 100644 --- a/src/moulin/Jeu.java +++ b/src/moulin/Jeu.java @@ -189,9 +189,10 @@ public class Jeu { /** * starts the game but everyone places their pieces randomly - * @return the player who won, null if no one won + * @param board current board + * @param players players list + * @return the game */ - public static Jeu randomStart(Board board,ArrayList<Player> players){ Jeu jeu; do { diff --git a/src/moulin/NormalAI.java b/src/moulin/NormalAI.java index 07ddc7f..474f440 100644 --- a/src/moulin/NormalAI.java +++ b/src/moulin/NormalAI.java @@ -49,7 +49,8 @@ public class NormalAI extends RandomAI{ /** * ends the game - * @param jeu board used by the game + * @param jeu current game + * @throws Exception exception */ public void endGame(Jeu jeu) throws Exception { if (willBeLoose(jeu.getBoard(),jeu.getPlayers())!=null){ diff --git a/src/moulin/Player.java b/src/moulin/Player.java index 27313fe..aaab601 100644 --- a/src/moulin/Player.java +++ b/src/moulin/Player.java @@ -36,6 +36,12 @@ public class Player { } } + /** + * creates a player class + * @param name player name + * @param color player color + * @param nbTrap amount of traps the player own + */ public Player(String name, ColorEnum color, int nbTrap){ if(name.equals("")){ throw new Error("Pas de nom de joueurs"); @@ -133,8 +139,9 @@ public class Player { } /** - * Allows the user to choose his color - * @return the chosen color + * Allows the user to choose his color + * @param list color list + * @return the color */ public static ColorEnum chooseColor(ArrayList<ColorEnum> list){ Scanner scan = new Scanner(System.in); diff --git a/src/moulin/Save.java b/src/moulin/Save.java index 27f29cb..f6ce1b8 100644 --- a/src/moulin/Save.java +++ b/src/moulin/Save.java @@ -26,6 +26,11 @@ public class Save { String path; String name; + + /** + * saves from a path + * @param path path + */ public Save(String path){ this.path = path; ArrayList<String> s = new ArrayList<>(Arrays.asList(this.path.split("/"))); -- GitLab