Package view

Class MainMenu

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class MainMenu extends JPanel
Implementation of MainMenu panel.
See Also:
  • Constructor Details

    • MainMenu

      public MainMenu(MainWindow mainWindow)
      Constructs a new MainMenu instance.
      Parameters:
      mainWindow - the parent window
  • Method Details

    • getMap

      public Pair<Map,File> getMap()
      Returns the map.
      Returns:
      the map
    • getP1Name

      public String getP1Name()
      Returns player 1's name.
      Returns:
      player 1's name
    • getP2Name

      public String getP2Name()
      Returns player 2's name.
      Returns:
      player 2's name
    • updateName

      public void updateName()
      Updates the players' name
    • updateMapName

      public void updateMapName()
      Changes the Map to be loaded.
    • paintComponent

      protected void paintComponent(Graphics g)
      Draws the background.
      Overrides:
      paintComponent in class JComponent
      Parameters:
      g - graphics