Package com.csse3200.game.ui.terminal
Class TerminalService
java.lang.Object
com.csse3200.game.ui.terminal.TerminalService
A Static class that manages the game's global debug terminal.
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
Execute the given command in the terminalstatic void
Focus the terminal input (the bottom pane where text is entered)static TerminalDisplay
Returns the current terminal display objectstatic void
Print string representation of the give object to the terminal.static void
setStage
(com.badlogic.gdx.scenes.scene2d.Stage stageValue) Called by the RenderService when a new Stage is set.static void
toggle()
Toggle the terminal display on or off
-
Method Details
-
setStage
public static void setStage(com.badlogic.gdx.scenes.scene2d.Stage stageValue) Called by the RenderService when a new Stage is set. This allows the terminal to attach its UI to the current screen's stage.- Parameters:
stageValue
- The newly active Stage.
-
getTerminalDisplay
Returns the current terminal display object- Returns:
- TerminalDisplay
-
toggle
public static void toggle()Toggle the terminal display on or off -
focusTerminalInput
public static void focusTerminalInput()Focus the terminal input (the bottom pane where text is entered) -
executeCurrentCommand
public static void executeCurrentCommand()Execute the given command in the terminal -
print
Print string representation of the give object to the terminal. Nothing is printed if the object is null.- Parameters:
obj
- the object to be printed
-