Class Commands

java.lang.Object
nz.ac.vuw.ecs.swen225.gp6.renderer.Commands

public final class Commands extends Object
This class is used to store the commands that the user can input into the log panel.
  • Constructor Details

    • Commands

      public Commands(LogPanel logPanel)
      Constructor for Commands.
      Parameters:
      logPanel - the logPanel to be used
  • Method Details

    • addCommands

      public void addCommands(String command, String description, Runnable action)
      Adds a command to the commands HashMap.
      Parameters:
      command - the command to be added
      description - the description of the command
      action - the action to be performed
    • invoke

      public void invoke(String s)
      invokes the command.
      Parameters:
      s - the command to be invoked
    • setRenderer

      public void setRenderer(MazeRenderer mazeRenderer)
      Displays the available commands.
      Parameters:
      mazeRenderer - the renderer for the maze