From d681f20b90d22e764b0a498ca4c0139c28bd3804 Mon Sep 17 00:00:00 2001 From: Tyler Date: Mon, 29 Jul 2024 17:05:28 +0100 Subject: [PATCH] Update JavaDoc --- src/main/java/com/shr4pnel/minesweeper/Controller.java | 9 +++++++-- src/main/java/com/shr4pnel/minesweeper/Grid.java | 7 +++++++ src/main/java/com/shr4pnel/minesweeper/GridWrapper.java | 4 ++++ src/main/java/com/shr4pnel/minesweeper/Main.java | 4 ++++ src/main/java/module-info.java | 5 +++++ 5 files changed, 27 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/shr4pnel/minesweeper/Controller.java b/src/main/java/com/shr4pnel/minesweeper/Controller.java index 1fe23f8..613f9a9 100644 --- a/src/main/java/com/shr4pnel/minesweeper/Controller.java +++ b/src/main/java/com/shr4pnel/minesweeper/Controller.java @@ -22,6 +22,11 @@ import javafx.scene.input.MouseEvent; import javafx.scene.layout.GridPane; import javafx.stage.Stage; +/** + * The JavaFX controller for minesweeper.fxml. + * Handles all operations performed within the GUI. + * @author shrapnelnet admin@shr4pnel.com + */ public class Controller { /** * The grid within the FXML holding all the tiles. @@ -351,7 +356,7 @@ public class Controller { } /** - * If a tile is surrounded by tiles with no adjacent bombs, open all of the tiles recursively + * If a tile is surrounded by tiles with no adjacent bombs, open all the tiles recursively * * @param column The column that was clicked * @param row The row that was clicked @@ -501,7 +506,7 @@ public class Controller { * Create a flag on a tile, representing a tile that the user suspects has a bomb behind it. * This prevents the tile being clicked on. * - * @param tileClicked + * @param tileClicked The tile that the user clicks. */ private void flag(Node tileClicked) { Button tileAsButton = (Button) tileClicked; diff --git a/src/main/java/com/shr4pnel/minesweeper/Grid.java b/src/main/java/com/shr4pnel/minesweeper/Grid.java index f89960b..f1c2ff2 100644 --- a/src/main/java/com/shr4pnel/minesweeper/Grid.java +++ b/src/main/java/com/shr4pnel/minesweeper/Grid.java @@ -2,7 +2,14 @@ package com.shr4pnel.minesweeper; import java.util.concurrent.ThreadLocalRandom; +/** + * Used to fill the GridWrapper with bombs. Planned to merge into GridWrapper. + * @since 1.0.0 + */ public class Grid { + /** + * An instance of GridWrapper used to check generation of bombs. + */ final GridWrapper grid = new GridWrapper(); /** diff --git a/src/main/java/com/shr4pnel/minesweeper/GridWrapper.java b/src/main/java/com/shr4pnel/minesweeper/GridWrapper.java index b0075cb..6de4143 100644 --- a/src/main/java/com/shr4pnel/minesweeper/GridWrapper.java +++ b/src/main/java/com/shr4pnel/minesweeper/GridWrapper.java @@ -1,5 +1,9 @@ package com.shr4pnel.minesweeper; +/** + * Simplifies operations on the bomb array. Preventing direct access leads to cleaner code. + * @since 1.0.0 + */ public class GridWrapper { /** * Number of columns. diff --git a/src/main/java/com/shr4pnel/minesweeper/Main.java b/src/main/java/com/shr4pnel/minesweeper/Main.java index cb00e71..9957265 100644 --- a/src/main/java/com/shr4pnel/minesweeper/Main.java +++ b/src/main/java/com/shr4pnel/minesweeper/Main.java @@ -9,6 +9,10 @@ import javafx.scene.Scene; import javafx.scene.image.Image; import javafx.stage.Stage; +/** + * The application opening point, used to bootstrap JavaFX and open to the GUI. + * @since 1.0.0 + */ public class Main extends Application { /** * JavaFX opening method. Creates the stage and bootstraps the application. diff --git a/src/main/java/module-info.java b/src/main/java/module-info.java index 482eab1..b8beea2 100644 --- a/src/main/java/module-info.java +++ b/src/main/java/module-info.java @@ -1,3 +1,8 @@ +/** + * The main module for the program. Required to launch to JavaFX as well as bundle into a native binary. + * @author shrapnelnet admin@shr4pnel.com + * @since 1.0.0 + */ module libremines { requires javafx.controls; requires javafx.fxml;