package controller;

import boundary.PlayerApplication;
import boundary.PlayerMainMenuView;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import model.PlayerModel;

public class PlayerMainMenuCtrl implements ActionListener {
  PlayerApplication app;
  PlayerModel model;

  /**
   * Create the controller with the context: the application and the model.
   */
  public PlayerMainMenuCtrl(PlayerApplication app, PlayerModel model) {
    this.app = app;
    this.model = model;
  }

  /**
   * Switch to the main menu.
   */
  public void loadMainMenu() {
    model.level.discardBoard();
    app.setView(new PlayerMainMenuView(app, model));
  }

  @Override
  public void actionPerformed(ActionEvent event) {
    loadMainMenu();
  }
}

@@ -570,24 +570,119 @@
 ainMenu() %7B%0A
+    // discard the board if we're leaving the playerboardview%0A    if (model.level != null) %7B%0A  
     model.le
@@ -701,16 +701,22 @@
 oard();%0A
+    %7D%0A
     app.

Fix PlayerMainMenuCtrl in context of starting game