From 848fccbefd335daa1b4cb123c24ca3966e3b6c30 Mon Sep 17 00:00:00 2001 From: Quentin Legot Date: Wed, 8 Dec 2021 19:09:58 +0100 Subject: [PATCH] updated javadoc syntax in some places, add javadoc to game.player and game.weapon --- .../main/java/fr/lnl/game/server/games/action/Action.java | 2 +- .../fr/lnl/game/server/games/grid/build/package-info.java | 4 ++++ .../lnl/game/server/games/grid/elements/package-info.java | 4 ++++ .../java/fr/lnl/game/server/games/grid/package-info.java | 4 ++++ .../fr/lnl/game/server/games/player/AbstractPlayer.java | 2 +- .../java/fr/lnl/game/server/games/player/ClassPlayer.java | 3 +++ .../fr/lnl/game/server/games/player/ComputerPlayer.java | 7 +++++++ .../java/fr/lnl/game/server/games/player/HumanPlayer.java | 5 +++++ .../lnl/game/server/games/player/RandomComputerPlayer.java | 4 ++++ .../java/fr/lnl/game/server/games/player/package-info.java | 4 ++++ .../main/java/fr/lnl/game/server/games/weapon/Weapon.java | 6 ++++++ .../java/fr/lnl/game/server/games/weapon/package-info.java | 4 ++++ 12 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 server/src/main/java/fr/lnl/game/server/games/grid/build/package-info.java create mode 100644 server/src/main/java/fr/lnl/game/server/games/grid/elements/package-info.java create mode 100644 server/src/main/java/fr/lnl/game/server/games/grid/package-info.java create mode 100644 server/src/main/java/fr/lnl/game/server/games/player/package-info.java create mode 100644 server/src/main/java/fr/lnl/game/server/games/weapon/package-info.java diff --git a/server/src/main/java/fr/lnl/game/server/games/action/Action.java b/server/src/main/java/fr/lnl/game/server/games/action/Action.java index 325caa4..ccf03c8 100644 --- a/server/src/main/java/fr/lnl/game/server/games/action/Action.java +++ b/server/src/main/java/fr/lnl/game/server/games/action/Action.java @@ -19,7 +19,7 @@ public interface Action { boolean isPossible(); /** - * Used by {@link Move}, {@link Shot} and {@link DropObject} to list all direction when the action is possible + * Used by {@link Move}, {@link Shot} and {@link DropObject} to list all direction where the action is possible * @return a list a point where the action is possible (not block by a wall per example) */ List getValidPoint(); diff --git a/server/src/main/java/fr/lnl/game/server/games/grid/build/package-info.java b/server/src/main/java/fr/lnl/game/server/games/grid/build/package-info.java new file mode 100644 index 0000000..ec24a12 --- /dev/null +++ b/server/src/main/java/fr/lnl/game/server/games/grid/build/package-info.java @@ -0,0 +1,4 @@ +/** + * Package containing all about Grid construction + */ +package fr.lnl.game.server.games.grid.build; \ No newline at end of file diff --git a/server/src/main/java/fr/lnl/game/server/games/grid/elements/package-info.java b/server/src/main/java/fr/lnl/game/server/games/grid/elements/package-info.java new file mode 100644 index 0000000..12e41c9 --- /dev/null +++ b/server/src/main/java/fr/lnl/game/server/games/grid/elements/package-info.java @@ -0,0 +1,4 @@ +/** + * Package containing all the elements that can be arranged in a grid + */ +package fr.lnl.game.server.games.grid.elements; \ No newline at end of file diff --git a/server/src/main/java/fr/lnl/game/server/games/grid/package-info.java b/server/src/main/java/fr/lnl/game/server/games/grid/package-info.java new file mode 100644 index 0000000..bcadaf0 --- /dev/null +++ b/server/src/main/java/fr/lnl/game/server/games/grid/package-info.java @@ -0,0 +1,4 @@ +/** + * Package containing all about Grid components + */ +package fr.lnl.game.server.games.grid; \ No newline at end of file diff --git a/server/src/main/java/fr/lnl/game/server/games/player/AbstractPlayer.java b/server/src/main/java/fr/lnl/game/server/games/player/AbstractPlayer.java index 41dcfdd..9ac44d8 100644 --- a/server/src/main/java/fr/lnl/game/server/games/player/AbstractPlayer.java +++ b/server/src/main/java/fr/lnl/game/server/games/player/AbstractPlayer.java @@ -86,7 +86,7 @@ public abstract class AbstractPlayer implements Player { } @Override - public void setPosition(Point position){ + public void setPosition(/* NotNull */ Point position){ if(position == null){ throw new IllegalArgumentException("Position is null"); } diff --git a/server/src/main/java/fr/lnl/game/server/games/player/ClassPlayer.java b/server/src/main/java/fr/lnl/game/server/games/player/ClassPlayer.java index 08aa12f..669aae9 100644 --- a/server/src/main/java/fr/lnl/game/server/games/player/ClassPlayer.java +++ b/server/src/main/java/fr/lnl/game/server/games/player/ClassPlayer.java @@ -3,6 +3,9 @@ package fr.lnl.game.server.games.player; import fr.lnl.game.server.games.weapon.Firearm; import fr.lnl.game.server.games.weapon.Weapon; +/** + * ClassPlayer contains all data about the cost of an action or the cost of a damage + */ public enum ClassPlayer { DEFAULT(800, 25, 20, 30, 40, 10, 80, 40, 20, 15, new Firearm()), diff --git a/server/src/main/java/fr/lnl/game/server/games/player/ComputerPlayer.java b/server/src/main/java/fr/lnl/game/server/games/player/ComputerPlayer.java index a6fd6c5..c670048 100644 --- a/server/src/main/java/fr/lnl/game/server/games/player/ComputerPlayer.java +++ b/server/src/main/java/fr/lnl/game/server/games/player/ComputerPlayer.java @@ -3,11 +3,18 @@ package fr.lnl.game.server.games.player; import fr.lnl.game.server.games.action.Action; import fr.lnl.game.server.utils.Point; +/** + * Super class of all Computer players + */ public abstract class ComputerPlayer extends AbstractPlayer { public ComputerPlayer(Integer id, Point point, ClassPlayer classPlayer) { super(id, point, false, classPlayer); } + /** + * Call when an AI need to choose an action to execute + * @return the chosen action + */ public abstract Action choseAction(); } diff --git a/server/src/main/java/fr/lnl/game/server/games/player/HumanPlayer.java b/server/src/main/java/fr/lnl/game/server/games/player/HumanPlayer.java index a5ff86d..52ada24 100644 --- a/server/src/main/java/fr/lnl/game/server/games/player/HumanPlayer.java +++ b/server/src/main/java/fr/lnl/game/server/games/player/HumanPlayer.java @@ -2,6 +2,11 @@ package fr.lnl.game.server.games.player; import fr.lnl.game.server.utils.Point; +/** + * Instance of Human Player.
+ * A human player choose an action to execute by using mouse or keyboard.
+ * Human Player don't implement choseAction cause this method is executed on client part + */ public class HumanPlayer extends AbstractPlayer { public HumanPlayer(Integer id, Point point, ClassPlayer classPlayer) { diff --git a/server/src/main/java/fr/lnl/game/server/games/player/RandomComputerPlayer.java b/server/src/main/java/fr/lnl/game/server/games/player/RandomComputerPlayer.java index f735b49..8c322f8 100644 --- a/server/src/main/java/fr/lnl/game/server/games/player/RandomComputerPlayer.java +++ b/server/src/main/java/fr/lnl/game/server/games/player/RandomComputerPlayer.java @@ -12,6 +12,10 @@ public class RandomComputerPlayer extends ComputerPlayer { super(id,point, classPlayer); } + /** + * Choose an action fully randomly + * @return an action between all available + */ @Override public Action choseAction() { Action action = null; diff --git a/server/src/main/java/fr/lnl/game/server/games/player/package-info.java b/server/src/main/java/fr/lnl/game/server/games/player/package-info.java new file mode 100644 index 0000000..c8ab6a4 --- /dev/null +++ b/server/src/main/java/fr/lnl/game/server/games/player/package-info.java @@ -0,0 +1,4 @@ +/** + * Package storing all players classes and as well AI behavior + */ +package fr.lnl.game.server.games.player; \ No newline at end of file diff --git a/server/src/main/java/fr/lnl/game/server/games/weapon/Weapon.java b/server/src/main/java/fr/lnl/game/server/games/weapon/Weapon.java index 9d0b97e..fe9098b 100644 --- a/server/src/main/java/fr/lnl/game/server/games/weapon/Weapon.java +++ b/server/src/main/java/fr/lnl/game/server/games/weapon/Weapon.java @@ -4,8 +4,14 @@ public interface Weapon { int getBullet(); + /** + * @return distance a bullet can go horizontally + */ int getHorizontalDistance(); + /** + * @return distance a bullet can go vertically + */ int getVerticalDistance(); } diff --git a/server/src/main/java/fr/lnl/game/server/games/weapon/package-info.java b/server/src/main/java/fr/lnl/game/server/games/weapon/package-info.java new file mode 100644 index 0000000..3e78ae3 --- /dev/null +++ b/server/src/main/java/fr/lnl/game/server/games/weapon/package-info.java @@ -0,0 +1,4 @@ +/** + * Package containing all bout player's weapons + */ +package fr.lnl.game.server.games.weapon; \ No newline at end of file