From 152f9cc9578577c82e45d848a06bd668d7466147 Mon Sep 17 00:00:00 2001
From: Trym Hamer Gudvangen <trym.gudvangen@gmail.com>
Date: Tue, 23 May 2023 02:08:55 +0200
Subject: [PATCH] docs: add javadoc to classes without doc

---
 .../group_30/paths/PathsSingleton.java        |  4 +-
 .../group_30/paths/controller/Controller.java | 11 ++++++
 .../controller/CreatePlayerController.java    |  8 ++++
 .../paths/controller/HelpController.java      |  3 ++
 .../paths/controller/NewGameController.java   | 12 ++++++
 .../paths/controller/NewStoryController.java  | 19 ++++++++++
 .../idatt2001/group_30/paths/model/Game.java  |  2 +-
 .../paths/model/actions/GoldAction.java       |  1 -
 .../paths/model/actions/HealthAction.java     |  1 -
 .../paths/model/actions/InventoryAction.java  |  1 -
 .../paths/model/actions/ScoreAction.java      |  1 -
 .../paths/model/goals/GoalFactory.java        | 20 +++++++++-
 .../group_30/paths/model/goals/GoalType.java  | 18 +++++++++
 .../group_30/paths/model/goals/GoldGoal.java  |  1 -
 .../group_30/paths/model/goals/ScoreGoal.java |  1 -
 .../paths/model/utils/TextValidation.java     | 14 +++++++
 .../paths/view/components/CreatePlayer.java   | 19 ++++++++++
 .../paths/view/components/ImageCarousel.java  | 27 ++++++++++++++
 .../view/components/pop_up/AbstractPopUp.java | 17 +++++++++
 .../view/components/pop_up/GoalsPopUp.java    | 17 +++++++++
 .../view/components/pop_up/LinkPopUp.java     | 26 +++++++++++++
 .../view/components/pop_up/PassagePopUp.java  | 17 +++++++++
 .../paths/view/components/pop_up/PopUp.java   | 37 +++++++++++++++++++
 .../view/components/pop_up/StatsPopUp.java    | 25 +++++++++++++
 .../view/components/table/StatsTable.java     |  4 ++
 .../paths/view/views/CreatePlayerView.java    | 15 ++++++++
 .../group_30/paths/view/views/HelpView.java   |  3 ++
 .../paths/view/views/LoadGameView.java        | 24 ++++++++++++
 .../paths/view/views/NewStoryView.java        |  9 +++++
 .../group_30/paths/view/views/View.java       |  2 -
 .../paths/view/views/ViewFactory.java         |  9 +++++
 .../group_30/paths/model/GameTest.java        |  2 +-
 .../group_30/paths/model/PlaythroughTest.java |  2 +-
 33 files changed, 358 insertions(+), 14 deletions(-)

diff --git a/src/main/java/edu/ntnu/idatt2001/group_30/paths/PathsSingleton.java b/src/main/java/edu/ntnu/idatt2001/group_30/paths/PathsSingleton.java
index 55b7fb4..9946f5e 100644
--- a/src/main/java/edu/ntnu/idatt2001/group_30/paths/PathsSingleton.java
+++ b/src/main/java/edu/ntnu/idatt2001/group_30/paths/PathsSingleton.java
@@ -169,8 +169,8 @@ public enum PathsSingleton {
      * Returns a list of all the non-null goals.
      * @return A list of all the non-null goals, given as a List of Goal objects.
      */
-    public List<Goal> getGoals() {
-        List<Goal> goals = Stream
+    public List<Goal<?>> getGoals() {
+        List<Goal<?>> goals = Stream
             .of(healthGoal, scoreGoal, goldGoal)
             .filter(Objects::nonNull)
             .collect(Collectors.toList());
diff --git a/src/main/java/edu/ntnu/idatt2001/group_30/paths/controller/Controller.java b/src/main/java/edu/ntnu/idatt2001/group_30/paths/controller/Controller.java
index 4a62d0a..7ea189b 100644
--- a/src/main/java/edu/ntnu/idatt2001/group_30/paths/controller/Controller.java
+++ b/src/main/java/edu/ntnu/idatt2001/group_30/paths/controller/Controller.java
@@ -21,6 +21,10 @@ public class Controller {
     protected final StageManager STAGE_MANAGER = StageManager.getInstance();
     protected final Map<Class<? extends View<?>>, Runnable> availableViews = new HashMap<>();
 
+    /**
+     * Creates a new Controller with the given view classes.
+     * @param viewClasses The view classes that this controller is responsible for.
+     */
     @SafeVarargs
     public Controller(Class<? extends View<?>>... viewClasses) {
         for (Class<? extends View<?>> viewClass : viewClasses) {
@@ -53,10 +57,17 @@ public class Controller {
         return actionEvent -> STAGE_MANAGER.goBackTo(viewClass);
     }
 
+    /**
+     * This method is used to get the root stage of the application.
+     * @return The root stage of the application, which is the stage that is used to display the views.
+     */
     public Stage getRootStage() {
         return STAGE_MANAGER.getStage();
     }
 
+    /**
+     * This method is used to go to the home view.
+     */
     public void goToHome() {
         STAGE_MANAGER.setCurrentView(ViewFactory.createView(HomeView.class));
     }
diff --git a/src/main/java/edu/ntnu/idatt2001/group_30/paths/controller/CreatePlayerController.java b/src/main/java/edu/ntnu/idatt2001/group_30/paths/controller/CreatePlayerController.java
index 8515eca..e197403 100644
--- a/src/main/java/edu/ntnu/idatt2001/group_30/paths/controller/CreatePlayerController.java
+++ b/src/main/java/edu/ntnu/idatt2001/group_30/paths/controller/CreatePlayerController.java
@@ -2,8 +2,16 @@ package edu.ntnu.idatt2001.group_30.paths.controller;
 
 import edu.ntnu.idatt2001.group_30.paths.view.views.LoadGameView;
 
+/**
+ * The class CreatePlayerController is responsible for managing the CreatePlayerView.
+ *
+ * @author Trym Hamer Gudvangen
+ */
 public class CreatePlayerController extends Controller {
 
+    /**
+     * Creates a new CreatePlayerController.
+     */
     public CreatePlayerController() {
         super(LoadGameView.class);
     }
diff --git a/src/main/java/edu/ntnu/idatt2001/group_30/paths/controller/HelpController.java b/src/main/java/edu/ntnu/idatt2001/group_30/paths/controller/HelpController.java
index 71d54a3..e2019fd 100644
--- a/src/main/java/edu/ntnu/idatt2001/group_30/paths/controller/HelpController.java
+++ b/src/main/java/edu/ntnu/idatt2001/group_30/paths/controller/HelpController.java
@@ -9,6 +9,9 @@ import edu.ntnu.idatt2001.group_30.paths.view.views.HomeView;
  */
 public class HelpController extends Controller {
 
+    /**
+     * Creates a new HelpController.
+     */
     public HelpController() {
         super(HomeView.class);
     }
diff --git a/src/main/java/edu/ntnu/idatt2001/group_30/paths/controller/NewGameController.java b/src/main/java/edu/ntnu/idatt2001/group_30/paths/controller/NewGameController.java
index f9e49bc..7df5072 100644
--- a/src/main/java/edu/ntnu/idatt2001/group_30/paths/controller/NewGameController.java
+++ b/src/main/java/edu/ntnu/idatt2001/group_30/paths/controller/NewGameController.java
@@ -8,12 +8,24 @@ import edu.ntnu.idatt2001.group_30.paths.view.views.PlaythroughView;
 import java.io.File;
 import java.io.IOException;
 
+/**
+ * This class is used to control the NewGameView.
+ *
+ * @author Trym Hamer Gudvangen
+ */
 public class NewGameController extends Controller {
 
+    /**
+     * Creates a new NewGameController.
+     */
     public NewGameController() {
         super(PlaythroughView.class, NewStoryView.class);
     }
 
+    /**
+     * Sets the story to the storyFile.
+     * @param storyFile The story to set, as a File.
+     */
     public void setStory(File storyFile) {
         StoryFileReader storyFileReader = new StoryFileReader();
         try {
diff --git a/src/main/java/edu/ntnu/idatt2001/group_30/paths/controller/NewStoryController.java b/src/main/java/edu/ntnu/idatt2001/group_30/paths/controller/NewStoryController.java
index 762f9b5..6a64614 100644
--- a/src/main/java/edu/ntnu/idatt2001/group_30/paths/controller/NewStoryController.java
+++ b/src/main/java/edu/ntnu/idatt2001/group_30/paths/controller/NewStoryController.java
@@ -12,12 +12,26 @@ import java.io.IOException;
 import java.util.List;
 import javafx.stage.FileChooser;
 
+/**
+ * This class is used to control the NewStoryView.
+ *
+ * @author Trym Hamer Gudvangen
+ */
 public class NewStoryController extends Controller {
 
+    /**
+     * Creates a new NewStoryController.
+     */
     public NewStoryController() {
         super(NewStoryView.class);
     }
 
+    /**
+     * Adds a story to the PathsSingleton.
+     * @param title        The title of the story, as a String.
+     * @param passages     The passages of the story, as a List of Passages.
+     * @throws IOException If the story could not be saved to file system.
+     */
     public void addStory(String title, List<Passage> passages) throws IOException {
         Story story = new Story(title, passages.isEmpty() ? null : passages.get(0));
         passages.forEach(story::addPassage);
@@ -26,6 +40,11 @@ public class NewStoryController extends Controller {
         saveStory(story);
     }
 
+    /**
+     * This method saves the story to the file system.
+     * @param story         The story to save, as a Story.
+     * @throws IOException  If the story could not be saved to file system.
+     */
     public void saveStory(Story story) throws IOException {
         FileChooser fileChooser = new FileChooser();
         fileChooser.setInitialDirectory(new File("./src/main/resources/story-files"));
diff --git a/src/main/java/edu/ntnu/idatt2001/group_30/paths/model/Game.java b/src/main/java/edu/ntnu/idatt2001/group_30/paths/model/Game.java
index 287a013..f1399d8 100644
--- a/src/main/java/edu/ntnu/idatt2001/group_30/paths/model/Game.java
+++ b/src/main/java/edu/ntnu/idatt2001/group_30/paths/model/Game.java
@@ -9,7 +9,7 @@ import java.util.List;
  *
  * @author Nicolai H. Brand, Trym Hamer Gudvangen
  */
-public record Game(Player player, Story story, List<Goal> goals) {
+public record Game(Player player, Story story, List<Goal<?>> goals) {
     /**
      * This method constructs a Game object with the given parameters.
      *
diff --git a/src/main/java/edu/ntnu/idatt2001/group_30/paths/model/actions/GoldAction.java b/src/main/java/edu/ntnu/idatt2001/group_30/paths/model/actions/GoldAction.java
index 1101d8c..f479b48 100644
--- a/src/main/java/edu/ntnu/idatt2001/group_30/paths/model/actions/GoldAction.java
+++ b/src/main/java/edu/ntnu/idatt2001/group_30/paths/model/actions/GoldAction.java
@@ -18,7 +18,6 @@ public class GoldAction implements Action<Integer> {
      */
     public GoldAction(int gold) {
         this.gold = gold;
-        //TODO: Add exception?
     }
 
     /**
diff --git a/src/main/java/edu/ntnu/idatt2001/group_30/paths/model/actions/HealthAction.java b/src/main/java/edu/ntnu/idatt2001/group_30/paths/model/actions/HealthAction.java
index bf588fe..55a4afd 100644
--- a/src/main/java/edu/ntnu/idatt2001/group_30/paths/model/actions/HealthAction.java
+++ b/src/main/java/edu/ntnu/idatt2001/group_30/paths/model/actions/HealthAction.java
@@ -18,7 +18,6 @@ public class HealthAction implements Action<Integer> {
      */
     public HealthAction(int health) {
         this.health = health;
-        //TODO: Add exception?
     }
 
     /**
diff --git a/src/main/java/edu/ntnu/idatt2001/group_30/paths/model/actions/InventoryAction.java b/src/main/java/edu/ntnu/idatt2001/group_30/paths/model/actions/InventoryAction.java
index a8b5939..040768f 100644
--- a/src/main/java/edu/ntnu/idatt2001/group_30/paths/model/actions/InventoryAction.java
+++ b/src/main/java/edu/ntnu/idatt2001/group_30/paths/model/actions/InventoryAction.java
@@ -18,7 +18,6 @@ public class InventoryAction implements Action<String> {
      */
     public InventoryAction(String item) {
         this.item = item;
-        //TODO: Add exception?
     }
 
     /**
diff --git a/src/main/java/edu/ntnu/idatt2001/group_30/paths/model/actions/ScoreAction.java b/src/main/java/edu/ntnu/idatt2001/group_30/paths/model/actions/ScoreAction.java
index bf20494..9c09207 100644
--- a/src/main/java/edu/ntnu/idatt2001/group_30/paths/model/actions/ScoreAction.java
+++ b/src/main/java/edu/ntnu/idatt2001/group_30/paths/model/actions/ScoreAction.java
@@ -18,7 +18,6 @@ public class ScoreAction implements Action<Integer> {
      */
     public ScoreAction(int points) {
         this.points = points;
-        //TODO: Add exception?
     }
 
     /**
diff --git a/src/main/java/edu/ntnu/idatt2001/group_30/paths/model/goals/GoalFactory.java b/src/main/java/edu/ntnu/idatt2001/group_30/paths/model/goals/GoalFactory.java
index d18f5ac..92cd32b 100644
--- a/src/main/java/edu/ntnu/idatt2001/group_30/paths/model/goals/GoalFactory.java
+++ b/src/main/java/edu/ntnu/idatt2001/group_30/paths/model/goals/GoalFactory.java
@@ -1,12 +1,23 @@
 package edu.ntnu.idatt2001.group_30.paths.model.goals;
 
-import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 import java.util.stream.Collectors;
 
+/**
+ * This class is a factory for creating Goal objects.
+ *
+ * @author Trym Hamer Gudvangen
+ */
 public class GoalFactory {
 
+    /**
+     * This method creates a Goal object based on the given goal type and goal value.
+     * @param goalType                      The type of goal, given as a GoalType object.
+     * @param goalValue                     The value of the goal, given as an Object.
+     * @return                              A Goal object.
+     * @throws IllegalArgumentException     If the goal type or value is invalid.
+     */
     public static Goal<?> getGoal(GoalType goalType, Object goalValue) throws IllegalArgumentException {
         switch (goalType) {
             case GOLD_GOAL, HEALTH_GOAL, SCORE_GOAL -> {
@@ -37,6 +48,13 @@ public class GoalFactory {
         throw new IllegalArgumentException("Invalid goal type or value");
     }
 
+    /**
+     * This method creates a Goal object based on the given goal type and goal value.
+     * @param goalType                      The type of goal, given as a String.
+     * @param goalValue                     The value of the goal, given as an Object.
+     * @return                              A Goal object.
+     * @throws IllegalArgumentException     If the goal type or value is invalid.
+     */
     public static Goal<?> getGoal(String goalType, Object goalValue) throws IllegalArgumentException {
         return getGoal(GoalType.getGoalType(goalType), goalValue);
     }
diff --git a/src/main/java/edu/ntnu/idatt2001/group_30/paths/model/goals/GoalType.java b/src/main/java/edu/ntnu/idatt2001/group_30/paths/model/goals/GoalType.java
index b164bc0..0d36928 100644
--- a/src/main/java/edu/ntnu/idatt2001/group_30/paths/model/goals/GoalType.java
+++ b/src/main/java/edu/ntnu/idatt2001/group_30/paths/model/goals/GoalType.java
@@ -3,6 +3,11 @@ package edu.ntnu.idatt2001.group_30.paths.model.goals;
 import java.util.HashMap;
 import java.util.Map;
 
+/**
+ * This enum represents the different types of goals.
+ *
+ * @author Trym Hamer Gudvangen
+ */
 public enum GoalType {
     GOLD_GOAL("GoldGoal"),
     HEALTH_GOAL("HealthGoal"),
@@ -18,14 +23,27 @@ public enum GoalType {
         }
     }
 
+    /**
+     * This constructor creates a GoalType object based on the given string value.
+     * @param stringVal   The string value of the GoalType object.
+     */
     GoalType(String stringVal) {
         this.stringVal = stringVal;
     }
 
+    /**
+     * This method retrieves the GoalType object based on the given string value.
+     * @param goalType The string value of the GoalType object.
+     * @return         The GoalType object.
+     */
     public static GoalType getGoalType(String goalType) {
         return stringToEnum.get(goalType);
     }
 
+    /**
+     * This method retrieves the string value of the GoalType object.
+     * @return  The string value of the GoalType object.
+     */
     public String getStringVal() {
         return stringVal;
     }
diff --git a/src/main/java/edu/ntnu/idatt2001/group_30/paths/model/goals/GoldGoal.java b/src/main/java/edu/ntnu/idatt2001/group_30/paths/model/goals/GoldGoal.java
index 2f51d21..79ebf11 100644
--- a/src/main/java/edu/ntnu/idatt2001/group_30/paths/model/goals/GoldGoal.java
+++ b/src/main/java/edu/ntnu/idatt2001/group_30/paths/model/goals/GoldGoal.java
@@ -18,7 +18,6 @@ public class GoldGoal implements Goal<Integer> {
      */
     public GoldGoal(int minimumGold) {
         this.minimumGold = minimumGold;
-        //TODO: Add exception?
     }
 
     /**
diff --git a/src/main/java/edu/ntnu/idatt2001/group_30/paths/model/goals/ScoreGoal.java b/src/main/java/edu/ntnu/idatt2001/group_30/paths/model/goals/ScoreGoal.java
index def6210..a0d688e 100644
--- a/src/main/java/edu/ntnu/idatt2001/group_30/paths/model/goals/ScoreGoal.java
+++ b/src/main/java/edu/ntnu/idatt2001/group_30/paths/model/goals/ScoreGoal.java
@@ -18,7 +18,6 @@ public class ScoreGoal implements Goal<Integer> {
      */
     public ScoreGoal(int minimumPoints) {
         this.minimumPoints = minimumPoints;
-        //TODO: Add exception?
     }
 
     /**
diff --git a/src/main/java/edu/ntnu/idatt2001/group_30/paths/model/utils/TextValidation.java b/src/main/java/edu/ntnu/idatt2001/group_30/paths/model/utils/TextValidation.java
index 57610f0..edfd723 100644
--- a/src/main/java/edu/ntnu/idatt2001/group_30/paths/model/utils/TextValidation.java
+++ b/src/main/java/edu/ntnu/idatt2001/group_30/paths/model/utils/TextValidation.java
@@ -3,12 +3,26 @@ package edu.ntnu.idatt2001.group_30.paths.model.utils;
 import javafx.scene.control.TextFormatter;
 import javafx.util.converter.IntegerStringConverter;
 
+/**
+ * This class represents a text validation.
+ *
+ * @author Trym Hamer Gudvangen
+ */
 public class TextValidation {
 
+    /**
+     * This method creates a text formatter for integers.
+     * @return A text formatter for integers.
+     */
     public static TextFormatter<Integer> createIntegerTextFormatter() {
         return createIntegerTextFormatter(100);
     }
 
+    /**
+     * This method creates a text formatter for integers.
+     * @param startValue   The start value of the text formatter, given as an integer.
+     * @return             A text formatter for integers.
+     */
     public static TextFormatter<Integer> createIntegerTextFormatter(int startValue) {
         return new TextFormatter<>(
             new IntegerStringConverter(),
diff --git a/src/main/java/edu/ntnu/idatt2001/group_30/paths/view/components/CreatePlayer.java b/src/main/java/edu/ntnu/idatt2001/group_30/paths/view/components/CreatePlayer.java
index bc00aca..004702c 100644
--- a/src/main/java/edu/ntnu/idatt2001/group_30/paths/view/components/CreatePlayer.java
+++ b/src/main/java/edu/ntnu/idatt2001/group_30/paths/view/components/CreatePlayer.java
@@ -18,6 +18,9 @@ public class CreatePlayer extends GridPane {
     private final TextField goldField;
     private final ComboBox<String> goalBox;
 
+    /**
+     * Constructor for the CreatePlayer component.
+     */
     public CreatePlayer() {
         setHgap(10);
         setVgap(5);
@@ -38,18 +41,34 @@ public class CreatePlayer extends GridPane {
         add(goalBox, 1, 3);
     }
 
+    /**
+     * Method for getting the name of the player.
+     * @return  The name of the player, as a String.
+     */
     public String getName() {
         return nameField.getText();
     }
 
+    /**
+     * Method for getting the health of the player.
+     * @return  The health of the player, as an int.
+     */
     public int getHealth() {
         return Integer.parseInt(healthField.getText());
     }
 
+    /**
+     * Method for getting the gold of the player.
+     * @return  The gold of the player, as an int.
+     */
     public int getGold() {
         return Integer.parseInt(goldField.getText());
     }
 
+    /**
+     * Method for getting the goal of the player.
+     * @return  The goal of the player, as a String.
+     */
     public String getGoal() {
         return goalBox.getValue();
     }
diff --git a/src/main/java/edu/ntnu/idatt2001/group_30/paths/view/components/ImageCarousel.java b/src/main/java/edu/ntnu/idatt2001/group_30/paths/view/components/ImageCarousel.java
index 7858c36..a95573f 100644
--- a/src/main/java/edu/ntnu/idatt2001/group_30/paths/view/components/ImageCarousel.java
+++ b/src/main/java/edu/ntnu/idatt2001/group_30/paths/view/components/ImageCarousel.java
@@ -9,6 +9,11 @@ import javafx.scene.image.Image;
 import javafx.scene.image.ImageView;
 import javafx.scene.layout.HBox;
 
+/**
+ * This class represents a component for displaying a carousel of images.
+ *
+ * @author Trym Hamer Gudvangen
+ */
 public class ImageCarousel {
 
     private final LinkedList<Image> images = new LinkedList<>();
@@ -18,6 +23,10 @@ public class ImageCarousel {
     private final int WIDTH = 150;
     private final int HEIGHT = 150;
 
+    /**
+     * Constructor for the ImageCarousel component.
+     * @param imageNames    A list of image names, as Strings.
+     */
     public ImageCarousel(List<String> imageNames) {
         if (imageNames == null || imageNames.isEmpty()) {
             throw new IllegalArgumentException("Image URI list must not be empty.");
@@ -39,6 +48,10 @@ public class ImageCarousel {
         this.currentImage.setImage(images.getFirst());
     }
 
+    /**
+     * Method for getting the carousel component.
+     * @return  The carousel component, as an HBox.
+     */
     public HBox getCarousel() {
         Button leftButton = new Button("<");
         leftButton.setOnAction(e -> previous());
@@ -51,20 +64,34 @@ public class ImageCarousel {
         return carousel;
     }
 
+    /**
+     * Method for getting the next image.
+     */
     public void next() {
         currentIndex = (currentIndex + 1) % size;
         currentImage.setImage(images.get(currentIndex));
     }
 
+    /**
+     * Method for getting the previous image.
+     */
     public void previous() {
         currentIndex = (currentIndex - 1 + size) % size;
         currentImage.setImage(images.get(currentIndex));
     }
 
+    /**
+     * Method for getting the size of the list of images.
+     * @return  The size of the list of images, as an int.
+     */
     public int size() {
         return size;
     }
 
+    /**
+     * Method for getting the current image.
+     * @return  The current image, as an ImageView.
+     */
     public ImageView getCurrentImage() {
         return currentImage;
     }
diff --git a/src/main/java/edu/ntnu/idatt2001/group_30/paths/view/components/pop_up/AbstractPopUp.java b/src/main/java/edu/ntnu/idatt2001/group_30/paths/view/components/pop_up/AbstractPopUp.java
index c4a13e4..35fa07f 100644
--- a/src/main/java/edu/ntnu/idatt2001/group_30/paths/view/components/pop_up/AbstractPopUp.java
+++ b/src/main/java/edu/ntnu/idatt2001/group_30/paths/view/components/pop_up/AbstractPopUp.java
@@ -1,15 +1,32 @@
 package edu.ntnu.idatt2001.group_30.paths.view.components.pop_up;
 
+/**
+ * This class provides a template for creating pop-ups.
+ *
+ * @author Trym Hamer Gudvangen
+ */
 public abstract class AbstractPopUp {
 
+    /**
+     * This method initializes the pop-up by setting up the UI components and the behavior.
+     */
     protected void initialize() {
         setupUiComponents();
         setupBehavior();
     }
 
+    /**
+     * This method sets up the UI components of the pop-up.
+     */
     protected abstract void setupUiComponents();
 
+    /**
+     * This method sets up the behavior of the pop-up.
+     */
     protected abstract void setupBehavior();
 
+    /**
+     * This method creates the pop-up.
+     */
     protected abstract void createPopUp();
 }
diff --git a/src/main/java/edu/ntnu/idatt2001/group_30/paths/view/components/pop_up/GoalsPopUp.java b/src/main/java/edu/ntnu/idatt2001/group_30/paths/view/components/pop_up/GoalsPopUp.java
index 2a27394..71e19b8 100644
--- a/src/main/java/edu/ntnu/idatt2001/group_30/paths/view/components/pop_up/GoalsPopUp.java
+++ b/src/main/java/edu/ntnu/idatt2001/group_30/paths/view/components/pop_up/GoalsPopUp.java
@@ -16,6 +16,11 @@ import javafx.scene.image.ImageView;
 import javafx.scene.layout.HBox;
 import javafx.scene.layout.VBox;
 
+/**
+ * This class contains a pop-up for creating and editing goals.
+ *
+ * @author Trym Hamer Gudvangen
+ */
 public class GoalsPopUp extends AbstractPopUp {
 
     private TextField healthField;
@@ -31,11 +36,17 @@ public class GoalsPopUp extends AbstractPopUp {
     private ScrollPane scrollPane;
     private PopUp<ScrollPane, ?> popUp;
 
+    /**
+     * This constructor creates a new GoalsPopUp.
+     */
     public GoalsPopUp() {
         initialize();
         createPopUp();
     }
 
+    /**
+     * {@inheritDoc}
+     */
     @Override
     protected void setupUiComponents() {
         healthField = new TextField();
@@ -122,6 +133,9 @@ public class GoalsPopUp extends AbstractPopUp {
         scrollPane.setFitToWidth(true);
     }
 
+    /**
+     * {@inheritDoc}
+     */
     @Override
     protected void setupBehavior() {
         addButton.setOnAction(e -> {
@@ -152,6 +166,9 @@ public class GoalsPopUp extends AbstractPopUp {
         });
     }
 
+    /**
+     * {@inheritDoc}
+     */
     @Override
     protected void createPopUp() {
         popUp =
diff --git a/src/main/java/edu/ntnu/idatt2001/group_30/paths/view/components/pop_up/LinkPopUp.java b/src/main/java/edu/ntnu/idatt2001/group_30/paths/view/components/pop_up/LinkPopUp.java
index 43fdb67..54bd0ee 100644
--- a/src/main/java/edu/ntnu/idatt2001/group_30/paths/view/components/pop_up/LinkPopUp.java
+++ b/src/main/java/edu/ntnu/idatt2001/group_30/paths/view/components/pop_up/LinkPopUp.java
@@ -16,6 +16,11 @@ import javafx.scene.control.*;
 import javafx.scene.layout.HBox;
 import javafx.scene.layout.VBox;
 
+/**
+ * This class is a pop-up for creating a new link or editing an existing one.
+ *
+ * @author Trym Hamer Gudvangen
+ */
 public class LinkPopUp extends AbstractPopUp {
 
     private TextField textField;
@@ -33,6 +38,10 @@ public class LinkPopUp extends AbstractPopUp {
     private Link link;
     private PopUp<VBox, ?> popUp;
 
+    /**
+     * This constructor allows a new link to be created.
+     * @param passages Other passages in the story, given as an ObservableList of passages.
+     */
     public LinkPopUp(ObservableList<Passage> passages) {
         this.actions = FXCollections.observableArrayList();
         this.passages = passages;
@@ -43,6 +52,11 @@ public class LinkPopUp extends AbstractPopUp {
         createPopUp();
     }
 
+    /**
+     * This constructor allows a pre-existing link to be edited.
+     * @param passages Other passages in the story, given as an ObservableList of passages.
+     * @param link     The link to be edited, given as a Link object.
+     */
     public LinkPopUp(ObservableList<Passage> passages, Link link) {
         this.link = link;
         this.actions = FXCollections.observableArrayList(link.getActions());
@@ -55,6 +69,9 @@ public class LinkPopUp extends AbstractPopUp {
         createPopUp();
     }
 
+    /**
+     * This method loads the link to be edited into the pop-up.
+     */
     @Override
     protected void setupUiComponents() {
         textField = new TextField();
@@ -108,6 +125,9 @@ public class LinkPopUp extends AbstractPopUp {
         content.setSpacing(20);
     }
 
+    /**
+     * This method sets up the behavior of the Ui components.
+     */
     @Override
     protected void setupBehavior() {
         removeActionButton.setOnAction(event -> actions.remove(actionTable.getSelectionModel().getSelectedItem()));
@@ -159,6 +179,9 @@ public class LinkPopUp extends AbstractPopUp {
         actionComboBox.setButtonCell(actionComboBox.getCellFactory().call(null));
     }
 
+    /**
+     * This method creates the pop-up.
+     */
     @Override
     protected void createPopUp() {
         popUp =
@@ -172,6 +195,9 @@ public class LinkPopUp extends AbstractPopUp {
         popUp.showAndWait();
     }
 
+    /**
+     * This method loads the link to be edited into the pop-up.
+     */
     private void loadLink() {
         textField.setText(this.link.getText());
         reference.setValue(this.link.getReference());
diff --git a/src/main/java/edu/ntnu/idatt2001/group_30/paths/view/components/pop_up/PassagePopUp.java b/src/main/java/edu/ntnu/idatt2001/group_30/paths/view/components/pop_up/PassagePopUp.java
index 3ada0e5..3b25186 100644
--- a/src/main/java/edu/ntnu/idatt2001/group_30/paths/view/components/pop_up/PassagePopUp.java
+++ b/src/main/java/edu/ntnu/idatt2001/group_30/paths/view/components/pop_up/PassagePopUp.java
@@ -31,6 +31,10 @@ public class PassagePopUp extends AbstractPopUp {
     private Passage passage;
     private PopUp<VBox, ?> popUp;
 
+    /**
+     * This constructor allows a new passage to be created.
+     * @param passages Other passages in the story, given as an ObservableList of passages.
+     */
     public PassagePopUp(ObservableList<Passage> passages) {
         this.passages = passages;
         this.links = FXCollections.observableArrayList();
@@ -52,6 +56,9 @@ public class PassagePopUp extends AbstractPopUp {
         createPopUp();
     }
 
+    /**
+     * This method sets up the UI components for the pop-up.
+     */
     @Override
     protected void setupUiComponents() {
         titleField = new TextField();
@@ -99,6 +106,9 @@ public class PassagePopUp extends AbstractPopUp {
         content.setSpacing(20);
     }
 
+    /**
+     * This method sets up the behavior for the pop-up.
+     */
     @Override
     protected void setupBehavior() {
         editLinkButton.setOnAction(e -> {
@@ -142,6 +152,9 @@ public class PassagePopUp extends AbstractPopUp {
         });
     }
 
+    /**
+     * {@inheritDoc}
+     */
     @Override
     protected void createPopUp() {
         popUp =
@@ -155,6 +168,10 @@ public class PassagePopUp extends AbstractPopUp {
         popUp.showAndWait();
     }
 
+    /**
+     * This method loads a passage into the pop-up.
+     * @param passage   Passage to load, given as a Passage object.
+     */
     private void loadPassage(Passage passage) {
         titleField.setText(passage.getTitle());
         contentArea.setText(passage.getContent());
diff --git a/src/main/java/edu/ntnu/idatt2001/group_30/paths/view/components/pop_up/PopUp.java b/src/main/java/edu/ntnu/idatt2001/group_30/paths/view/components/pop_up/PopUp.java
index 7b38f06..9fff0bf 100644
--- a/src/main/java/edu/ntnu/idatt2001/group_30/paths/view/components/pop_up/PopUp.java
+++ b/src/main/java/edu/ntnu/idatt2001/group_30/paths/view/components/pop_up/PopUp.java
@@ -3,15 +3,28 @@ package edu.ntnu.idatt2001.group_30.paths.view.components.pop_up;
 import javafx.scene.control.*;
 import javafx.scene.layout.Region;
 
+/**
+ * This class provides a template for creating pop-ups.
+ * @param <T>       The type of the content of the pop-up.
+ * @param <SELF>    The type of the pop-up.
+ */
 public class PopUp<T extends Region, SELF extends PopUp<T, SELF>> extends Dialog<Void> {
 
     private final DialogPane dialogPane;
 
+    /**
+     * This constructor sets up the dialog pane.
+     */
     protected PopUp() {
         dialogPane = new DialogPane();
         setDialogPane(dialogPane);
     }
 
+    /**
+     * This method creates a pop-up.
+     * @return      The pop-up.
+     * @param <T>   The type of the content of the pop-up.
+     */
     public static <T extends Region> PopUp<T, ?> create() {
         return new PopUp<>();
     }
@@ -21,16 +34,30 @@ public class PopUp<T extends Region, SELF extends PopUp<T, SELF>> extends Dialog
         return self();
     }
 
+    /**
+     * This method returns the dialog pane.
+     * @param content   The content of the dialog pane.
+     * @return          The dialog pane.
+     */
     public SELF withContent(T content) {
         dialogPane.setContent(content);
         return self();
     }
 
+    /**
+     * This method returns the dialog pane.
+     * @param buttonType    The button type of the dialog pane.
+     * @return              The dialog pane.
+     */
     public SELF withButton(ButtonType buttonType) {
         dialogPane.getButtonTypes().add(buttonType);
         return self();
     }
 
+    /**
+     * This method returns the dialog pane.
+     * @return    The dialog pane.
+     */
     public SELF withoutCloseButton() {
         // Add a close button type to the dialog
         ButtonType closeButtonType = new ButtonType("Close", ButtonBar.ButtonData.CANCEL_CLOSE);
@@ -44,12 +71,22 @@ public class PopUp<T extends Region, SELF extends PopUp<T, SELF>> extends Dialog
         return self();
     }
 
+    /**
+     * This method returns the dialog pane.
+     * @param width     The width of the dialog pane.
+     * @param height    The height of the dialog pane.
+     * @return          The dialog pane.
+     */
     public SELF withDialogSize(double width, double height) {
         getDialogPane().setMinSize(width, height);
         getDialogPane().setMaxSize(width, height);
         return self();
     }
 
+    /**
+     * This method returns the dialog pane.
+     * @return  The dialog pane.
+     */
     @SuppressWarnings("unchecked")
     protected SELF self() {
         return (SELF) this;
diff --git a/src/main/java/edu/ntnu/idatt2001/group_30/paths/view/components/pop_up/StatsPopUp.java b/src/main/java/edu/ntnu/idatt2001/group_30/paths/view/components/pop_up/StatsPopUp.java
index 4818eeb..5e6ba26 100644
--- a/src/main/java/edu/ntnu/idatt2001/group_30/paths/view/components/pop_up/StatsPopUp.java
+++ b/src/main/java/edu/ntnu/idatt2001/group_30/paths/view/components/pop_up/StatsPopUp.java
@@ -9,6 +9,11 @@ import javafx.scene.control.Label;
 import javafx.scene.control.TextField;
 import javafx.scene.layout.VBox;
 
+/**
+ * This class contains a pop-up for adding stats to the player.
+ *
+ * @author Trym Hamer Gudvangen
+ */
 public class StatsPopUp extends AbstractPopUp {
 
     private TextField healthField;
@@ -17,19 +22,33 @@ public class StatsPopUp extends AbstractPopUp {
     private VBox content;
     private PopUp<VBox, ?> popUp;
 
+    /**
+     * This constructor creates a new StatsPopUp.
+     */
     public StatsPopUp() {
         initialize();
         createPopUp();
     }
 
+    /**
+     * This method retrieves the health value from the pop-up.
+     * @return  The health value, as an int.
+     */
     public int getHealth() {
         return Integer.parseInt(healthField.getText());
     }
 
+    /**
+     * This method retrieves the gold value from the pop-up.
+     * @return  The gold value, as an int.
+     */
     public int getGold() {
         return Integer.parseInt(goldField.getText());
     }
 
+    /**
+     * {@inheritDoc}
+     */
     @Override
     protected void setupUiComponents() {
         healthField = new TextField();
@@ -48,6 +67,9 @@ public class StatsPopUp extends AbstractPopUp {
         content.setSpacing(20);
     }
 
+    /**
+     * {@inheritDoc}
+     */
     @Override
     protected void setupBehavior() {
         saveButton.setOnAction(e -> {
@@ -61,6 +83,9 @@ public class StatsPopUp extends AbstractPopUp {
         });
     }
 
+    /**
+     * {@inheritDoc}
+     */
     @Override
     protected void createPopUp() {
         popUp =
diff --git a/src/main/java/edu/ntnu/idatt2001/group_30/paths/view/components/table/StatsTable.java b/src/main/java/edu/ntnu/idatt2001/group_30/paths/view/components/table/StatsTable.java
index a0fec22..e639b45 100644
--- a/src/main/java/edu/ntnu/idatt2001/group_30/paths/view/components/table/StatsTable.java
+++ b/src/main/java/edu/ntnu/idatt2001/group_30/paths/view/components/table/StatsTable.java
@@ -1,5 +1,9 @@
 package edu.ntnu.idatt2001.group_30.paths.view.components.table;
 
+/**
+ * This class concerns itself with the aspects intrinsic to a stats table.
+ * @param <Player>  The type of the table, represented using a Player object.
+ */
 public class StatsTable<Player> extends TableDisplay<Player> {
 
     /**
diff --git a/src/main/java/edu/ntnu/idatt2001/group_30/paths/view/views/CreatePlayerView.java b/src/main/java/edu/ntnu/idatt2001/group_30/paths/view/views/CreatePlayerView.java
index 96c9d41..3094775 100644
--- a/src/main/java/edu/ntnu/idatt2001/group_30/paths/view/views/CreatePlayerView.java
+++ b/src/main/java/edu/ntnu/idatt2001/group_30/paths/view/views/CreatePlayerView.java
@@ -24,12 +24,21 @@ import javafx.scene.text.Font;
 import javafx.scene.text.FontWeight;
 import javafx.scene.text.Text;
 
+/**
+ * The view for creating a player. This view therefore contains the character layout implementation and pop-ups
+ * for goals and stats.
+ *
+ * @author Trym Hamer Gudvangen
+ */
 public class CreatePlayerView extends View<BorderPane> {
 
     private final CreatePlayerController createPlayerController;
     private TextField nameField;
     private Button continueButton, returnButton;
 
+    /**
+     * Creates the view for creating a player.
+     */
     public CreatePlayerView() {
         super(BorderPane.class);
         createPlayerController = new CreatePlayerController();
@@ -166,6 +175,12 @@ public class CreatePlayerView extends View<BorderPane> {
         returnButton.setOnAction(e -> StageManager.getInstance().goBack());
     }
 
+    /**
+     * Copies the image onto the writable image.
+     * @param image     the image to copy
+     * @param writer    the pixel writer
+     * @param yOffset   the y offset
+     */
     private void copyImageOnto(Image image, PixelWriter writer, int yOffset) {
         PixelReader reader = image.getPixelReader();
         for (int y = 0; y < image.getHeight(); y++) {
diff --git a/src/main/java/edu/ntnu/idatt2001/group_30/paths/view/views/HelpView.java b/src/main/java/edu/ntnu/idatt2001/group_30/paths/view/views/HelpView.java
index 715e930..d4df12b 100644
--- a/src/main/java/edu/ntnu/idatt2001/group_30/paths/view/views/HelpView.java
+++ b/src/main/java/edu/ntnu/idatt2001/group_30/paths/view/views/HelpView.java
@@ -22,6 +22,9 @@ public class HelpView extends View<VBox> {
 
     private final HelpController controller = new HelpController();
 
+    /**
+     * Creates the help page.
+     */
     public HelpView() {
         super(VBox.class);
         VBox parent = getParentPane();
diff --git a/src/main/java/edu/ntnu/idatt2001/group_30/paths/view/views/LoadGameView.java b/src/main/java/edu/ntnu/idatt2001/group_30/paths/view/views/LoadGameView.java
index 14ed35e..a4c2f3b 100644
--- a/src/main/java/edu/ntnu/idatt2001/group_30/paths/view/views/LoadGameView.java
+++ b/src/main/java/edu/ntnu/idatt2001/group_30/paths/view/views/LoadGameView.java
@@ -59,6 +59,11 @@ public class LoadGameView extends View<BorderPane> {
         setupParentPane(mainContainer);
     }
 
+    /**
+     * Adds the story pane to the view.
+     * @param titlePane The title pane of the view.
+     * @return          The main container of the view.
+     */
     private VBox createMainContainerVBox(BorderPane titlePane) {
         VBox mainContainer = new VBox();
         mainContainer.getChildren().addAll(titlePane);
@@ -79,6 +84,10 @@ public class LoadGameView extends View<BorderPane> {
         return containerWithButtons;
     }
 
+    /**
+     * Sets up the parent pane of the view.
+     * @param mainContainer The main container of the view.
+     */
     private void setupParentPane(VBox mainContainer) {
         getParentPane().setCenter(mainContainer);
         getParentPane().setStyle("-fx-background-color: #f5f5f5");
@@ -89,6 +98,10 @@ public class LoadGameView extends View<BorderPane> {
         getParentPane().setPadding(new Insets(20));
     }
 
+    /**
+     * Adds the story pane to the view.
+     * @return  The story pane.
+     */
     private BorderPane createTitlePane() {
         BorderPane titlePane = new BorderPane();
         titlePane.setPadding(new Insets(20));
@@ -135,6 +148,13 @@ public class LoadGameView extends View<BorderPane> {
         return titlePane;
     }
 
+    /**
+     * Creates an icon button.
+     * @param imagePath The path to the image.
+     * @param width     The width of the image.
+     * @param height    The height of the image.
+     * @return          The button.
+     */
     private Button createIconButton(String imagePath, int width, int height) {
         Button button = new Button();
         URL imageUrl = getClass().getResource(imagePath);
@@ -149,6 +169,10 @@ public class LoadGameView extends View<BorderPane> {
         return button;
     }
 
+    /**
+     * Adds the story pane to the view.
+     * @throws IOException  If the story pane cannot be added.
+     */
     private void addStoryPane() throws IOException {
         VBox storyVBox = new StoryDisplay.Builder(INSTANCE.getStory())
             .addStoryName()
diff --git a/src/main/java/edu/ntnu/idatt2001/group_30/paths/view/views/NewStoryView.java b/src/main/java/edu/ntnu/idatt2001/group_30/paths/view/views/NewStoryView.java
index d4a2e43..eedaa1d 100644
--- a/src/main/java/edu/ntnu/idatt2001/group_30/paths/view/views/NewStoryView.java
+++ b/src/main/java/edu/ntnu/idatt2001/group_30/paths/view/views/NewStoryView.java
@@ -28,6 +28,12 @@ import javafx.scene.layout.HBox;
 import javafx.scene.layout.VBox;
 import javafx.scene.text.Text;
 
+/**
+ * This class contains the view for creating/writing a new story. It, therefore, contains the title and passages.
+ * The passages can be changed and the corresponding object variables such as links and actions can also be changed.
+ *
+ * @author Trym Hamer Gudvangen
+ */
 public class NewStoryView extends View<BorderPane> {
 
     private final NewStoryController newStoryController;
@@ -37,6 +43,9 @@ public class NewStoryView extends View<BorderPane> {
     private final Button removePassageButton;
     private final Button editPassageButton;
 
+    /**
+     * The constructor to create the NewStoryView.
+     */
     public NewStoryView() {
         super(BorderPane.class);
         newStoryController = new NewStoryController();
diff --git a/src/main/java/edu/ntnu/idatt2001/group_30/paths/view/views/View.java b/src/main/java/edu/ntnu/idatt2001/group_30/paths/view/views/View.java
index 0ba45db..e549e73 100644
--- a/src/main/java/edu/ntnu/idatt2001/group_30/paths/view/views/View.java
+++ b/src/main/java/edu/ntnu/idatt2001/group_30/paths/view/views/View.java
@@ -7,7 +7,6 @@ import java.util.Objects;
 import javafx.scene.Node;
 import javafx.scene.Scene;
 import javafx.scene.layout.*;
-import javafx.scene.shape.SVGPath;
 
 /**
  * A View is a wrapper for a JavaFX Pane.
@@ -40,7 +39,6 @@ public class View<T extends Pane> {
         } catch (
             InstantiationException | IllegalAccessException | NoSuchMethodException | InvocationTargetException e
         ) {
-            //TODO: better error handling
             e.printStackTrace();
         }
     }
diff --git a/src/main/java/edu/ntnu/idatt2001/group_30/paths/view/views/ViewFactory.java b/src/main/java/edu/ntnu/idatt2001/group_30/paths/view/views/ViewFactory.java
index ce9caba..9674ac5 100644
--- a/src/main/java/edu/ntnu/idatt2001/group_30/paths/view/views/ViewFactory.java
+++ b/src/main/java/edu/ntnu/idatt2001/group_30/paths/view/views/ViewFactory.java
@@ -2,8 +2,17 @@ package edu.ntnu.idatt2001.group_30.paths.view.views;
 
 import java.lang.reflect.InvocationTargetException;
 
+/**
+ * A factory for creating views.
+ */
 public class ViewFactory {
 
+    /**
+     * Given a class of a view, this method creates an instance of that view.
+     * @param viewClass The class of the view to be created.
+     * @return          An instance of the view.
+     * @param <T>       The type of the view.
+     */
     public static <T extends View<?>> T createView(Class<T> viewClass) {
         try {
             return viewClass.getDeclaredConstructor().newInstance();
diff --git a/src/test/java/edu/ntnu/idatt2001/group_30/paths/model/GameTest.java b/src/test/java/edu/ntnu/idatt2001/group_30/paths/model/GameTest.java
index 7c6cdd0..0935178 100644
--- a/src/test/java/edu/ntnu/idatt2001/group_30/paths/model/GameTest.java
+++ b/src/test/java/edu/ntnu/idatt2001/group_30/paths/model/GameTest.java
@@ -22,7 +22,7 @@ public class GameTest {
         Passage attackPassage;
 
         Story story;
-        List<Goal> goals;
+        List<Goal<?>> goals;
 
         @BeforeEach
         void setup() {
diff --git a/src/test/java/edu/ntnu/idatt2001/group_30/paths/model/PlaythroughTest.java b/src/test/java/edu/ntnu/idatt2001/group_30/paths/model/PlaythroughTest.java
index fd49df0..d90ddb6 100644
--- a/src/test/java/edu/ntnu/idatt2001/group_30/paths/model/PlaythroughTest.java
+++ b/src/test/java/edu/ntnu/idatt2001/group_30/paths/model/PlaythroughTest.java
@@ -18,7 +18,7 @@ class PlaythroughTest {
         openingPassage = new Passage("Opening passage", "This is the opening passage");
         Player player = new Player("Player", 10, 20, 30);
         Story story = new Story("My story", openingPassage);
-        List<Goal> goals = List.of(new GoldGoal(50));
+        List<Goal<?>> goals = List.of(new GoldGoal(50));
         Game game = new Game(player, story, goals);
 
         playthrough = new Playthrough(game);
-- 
GitLab