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