From e9e931b0e098bc4c97ea0be400683408150a4028 Mon Sep 17 00:00:00 2001 From: Adam NAILI Date: Sun, 4 Feb 2018 22:16:59 +0100 Subject: Updating javadoc and changing unused methods in private visibility --- .../java/fr/umlv/java/wallj/board/BoardConverter.java | 2 ++ src/main/java/fr/umlv/java/wallj/context/Game.java | 17 ++++++++--------- .../fr/umlv/java/wallj/context/GraphicsContext.java | 6 ++---- .../java/fr/umlv/java/wallj/event/ConfirmOrder.java | 2 +- .../java/fr/umlv/java/wallj/viewer/ScreenManager.java | 2 +- 5 files changed, 14 insertions(+), 15 deletions(-) diff --git a/src/main/java/fr/umlv/java/wallj/board/BoardConverter.java b/src/main/java/fr/umlv/java/wallj/board/BoardConverter.java index 84feb41..53f11c0 100644 --- a/src/main/java/fr/umlv/java/wallj/board/BoardConverter.java +++ b/src/main/java/fr/umlv/java/wallj/board/BoardConverter.java @@ -14,6 +14,7 @@ public final class BoardConverter { } /** + * Converts a list of Blocks to a Board * @param blocks the list of blocks to convert in a board * @return the converted board */ @@ -29,6 +30,7 @@ public final class BoardConverter { } /** + * Converts a Board to a list of Blocks * @param board the board to convert into a list of blocks * @return the list of blocks converted */ diff --git a/src/main/java/fr/umlv/java/wallj/context/Game.java b/src/main/java/fr/umlv/java/wallj/context/Game.java index b78bae4..7d09b26 100644 --- a/src/main/java/fr/umlv/java/wallj/context/Game.java +++ b/src/main/java/fr/umlv/java/wallj/context/Game.java @@ -39,7 +39,7 @@ public final class Game implements Updateable { /** * @return a boolean on the condition of having a next Board in our game. */ - public boolean hasNextBoard() { + private boolean hasNextBoard() { return indexBoard + 1 < boards.size(); } @@ -61,21 +61,20 @@ public final class Game implements Updateable { return currentStage; } + /** + * @return the status of the game + */ public boolean isOver() { return over; } - public void setOver() { - over = true; - } - - public void nextStage() { + private void nextStage() { if (hasNextBoard()) { currentStage = new Stage(nextBoard()); } } - public void retryStage() { + private void retryStage() { currentStage = new Stage(currentStage.getBoard()); } @@ -84,12 +83,12 @@ public final class Game implements Updateable { nextStage(); return; } - setOver(); + over = true; } private void handleEvents(Context context) { if (Events.findFirst(context.getEvents(), QuitGameOrder.class).isPresent()) { - context.getGame().setOver(); + over = true; return; } if (Events.findFirst(context.getEvents(), ConfirmOrder.class).isPresent()) { diff --git a/src/main/java/fr/umlv/java/wallj/context/GraphicsContext.java b/src/main/java/fr/umlv/java/wallj/context/GraphicsContext.java index 2c1c72a..2eaa3b4 100644 --- a/src/main/java/fr/umlv/java/wallj/context/GraphicsContext.java +++ b/src/main/java/fr/umlv/java/wallj/context/GraphicsContext.java @@ -5,12 +5,10 @@ import fr.umlv.zen5.ScreenInfo; import org.jbox2d.common.Vec2; import java.awt.*; -import java.awt.geom.Ellipse2D; -import java.awt.geom.Rectangle2D; import java.util.Objects; /** - * A context of the current graphic status of the application. + * The context of the application containing graphics information and services at one tick * * @author Adam NAILI */ @@ -20,7 +18,7 @@ public final class GraphicsContext { /** * @param graphics2D the current drawable canvas - * @param screenInfo the informations about the screen + * @param screenInfo the information about the screen */ public GraphicsContext(Graphics2D graphics2D, ScreenInfo screenInfo) { this.graphics2D = Objects.requireNonNull(graphics2D); diff --git a/src/main/java/fr/umlv/java/wallj/event/ConfirmOrder.java b/src/main/java/fr/umlv/java/wallj/event/ConfirmOrder.java index 0f5fbd6..7a546dd 100644 --- a/src/main/java/fr/umlv/java/wallj/event/ConfirmOrder.java +++ b/src/main/java/fr/umlv/java/wallj/event/ConfirmOrder.java @@ -1,7 +1,7 @@ package fr.umlv.java.wallj.event; /** - * Event coming from a confirmation action from the user + * Signals that the user is confirming thanks to inputs * * @author Adam NAILI */ diff --git a/src/main/java/fr/umlv/java/wallj/viewer/ScreenManager.java b/src/main/java/fr/umlv/java/wallj/viewer/ScreenManager.java index 70377ba..be16067 100644 --- a/src/main/java/fr/umlv/java/wallj/viewer/ScreenManager.java +++ b/src/main/java/fr/umlv/java/wallj/viewer/ScreenManager.java @@ -9,7 +9,7 @@ import java.awt.Graphics2D; import java.util.Objects; /** - * Cleans the GraphicsContext + * Generates a clean GraphicsContext * * @author Adam NAILI */ -- cgit v1.2.3