Skip to content

Commit

Permalink
Fix: Removed unused method
Browse files Browse the repository at this point in the history
  • Loading branch information
tommyah committed May 26, 2026
1 parent 12bb7bc commit 477cbba
Showing 1 changed file with 6 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@
import edu.ntnu.idi.idatt2003.g40.mappe.service.event.EventType;
import edu.ntnu.idi.idatt2003.g40.mappe.view.ViewController;
import edu.ntnu.idi.idatt2003.g40.mappe.view.ViewEnum;

import java.io.File;
import java.util.List;

import javafx.scene.Scene;
import javafx.scene.control.Alert;
import javafx.scene.control.Alert.AlertType;
Expand All @@ -22,12 +20,10 @@
*
* <p>Extends {@link ViewController}</p>
*
* <p>
* Handles four user actions: navigating to the create-game screen,
* <p>Handles four user actions: navigating to the create-game screen,
* going back to the main menu, uploading a custom save file from
* disk, and opening a save when one of the displayed rows is
* clicked.
* </p>
* clicked.</p>
*/
public class PlayGameController extends ViewController<PlayGameView> {

Expand All @@ -38,19 +34,6 @@ public class PlayGameController extends ViewController<PlayGameView> {
* */
private final SaveGameService saveGameService;

/**
* Constructor with a default {@link SaveGameService} pointing at
* the bundled saves directory.
*
* @param view the {@link PlayGameView} this controller is
* attached to.
* @param eventManager the active {@link EventManager}.
*/
public PlayGameController(final PlayGameView view,
final EventManager eventManager) {
this(view, eventManager, new SaveGameService());
}

/**
* Constructor accepting an explicit {@link SaveGameService} for
* tests or custom save locations.
Expand Down Expand Up @@ -122,12 +105,10 @@ protected void initInteractions() {
* Re-reads every save from disk and returns the one whose name
* matches, or {@code null} if no matching save is found.
*
* <p>
* Used to defeat the staleness of the {@link SaveGame} instance
* <p>Used to defeat the staleness of the {@link SaveGame} instance
* bound to the clicked row in {@link PlayGameView}: between when
* {@link #refresh()} last ran and the click, the auto-save flow may
* have written newer content to disk.
* </p>
* have written newer content to disk.</p>
*
* @param name the save display name to look up.
* @return the freshly parsed {@link SaveGame}, or {@code null}.
Expand All @@ -149,10 +130,8 @@ private SaveGame findFreshSaveByName(final String name) {
* disk. Parses it using {@link SaveGameService#loadSaveFromFile} and
* appends the resulting save to the view's current list.
*
* <p>
* Shows an alert if the user picks a file that contains no valid
* save entry.
* </p>
* <p>Shows an alert if the user picks a file that contains no valid
* save entry.</p>
*/
private void handleUploadSave() {
FileChooser fileChooser = new FileChooser();
Expand Down

0 comments on commit 477cbba

Please sign in to comment.