Package com.csse3200.game.ui.terminal
Class Terminal
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.ui.terminal.Terminal
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
UI can call this to accept the top suggestion into the input.void
addCommand
(String name, Command command) void
appendToMessage
(char character) Returns up to 5 suggestions based on the current prefix (first token).void
boolean
isOpen()
boolean
void
void
void
setEnteredMessage
(String text) void
setOpen()
void
Methods inherited from class com.csse3200.game.components.Component
create, dispose, earlyUpdate, getEntity, getPrio, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, update
-
Constructor Details
-
Terminal
public Terminal() -
Terminal
-
Terminal
-
Terminal
-
Terminal
-
-
Method Details
-
getEnteredMessage
-
isOpen
public boolean isOpen() -
toggleIsOpen
public void toggleIsOpen() -
setOpen
public void setOpen() -
setClosed
public void setClosed() -
addCommand
-
rebuildAutocompleteIndex
public void rebuildAutocompleteIndex() -
processMessage
public boolean processMessage() -
appendToMessage
public void appendToMessage(char character) -
handleBackspace
public void handleBackspace() -
setEnteredMessage
-
getAutocompleteSuggestions
Returns up to 5 suggestions based on the current prefix (first token). Debounced (~20ms). If there are no trie hits and prefix non-empty, falls back to BK-tree with edit distance ≤ 1. For empty prefix, returns empty. -
acceptTopSuggestion
public void acceptTopSuggestion()UI can call this to accept the top suggestion into the input.
-