Skip to content

Commit

Permalink
Minor changes to MVC impementation
Browse files Browse the repository at this point in the history
  • Loading branch information
tommyah committed May 13, 2026
1 parent ac26ea0 commit f3de9d6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,20 +113,6 @@ protected void setRootPane(final T pane) {
rootPane = pane;
}

/**
* Getter method for buttons in this view.
*
* <p>Gotten by the associated {@link ViewController} object that hooks
* the buttons to functionality.</p>
*
* @return {@link Map<Enum, Button>} object containing all buttons
* in this view element.
*
*/
public Map<A, Button> getButtons() {
return buttonMap;
}

/**
* Method that initializes the layout for the view element.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import edu.ntnu.idi.idatt2003.g40.mappe.service.event.EventManager;
import edu.ntnu.idi.idatt2003.g40.mappe.service.event.EventSubscriber;
import edu.ntnu.idi.idatt2003.g40.mappe.service.event.EventType;

import java.util.EnumMap;
import java.util.HashMap;
import java.util.Map;
import javafx.scene.Scene;
Expand Down Expand Up @@ -54,7 +56,7 @@ public ViewManager(final Stage stage, final EventManager eventManager)
if (stage == null || eventManager == null) {
throw new IllegalArgumentException("Invalid ViewManager constructor arguments!");
} else {
viewMap = new HashMap<>();
viewMap = new EnumMap<>(ViewEnum.class);
eventManager.addSubscriber(this, EventType.SCENE_CHANGE);
this.stage = stage;
}
Expand Down

0 comments on commit f3de9d6

Please sign in to comment.