Chatbot UI - UQcsse3200/2024-studio-2 GitHub Wiki

ChatbotUI Class Documentation

The ChatbotUI class is responsible for handling the User Interface (UI) and functionality of a chatbot in a game developed with the LibGDX framework. This class provides methods to create, display, and interact with a chatbot, including predefined questions and user input handling. The chatbot can respond to specific queries and handle custom input with keyword-based commands.

Overview

The ChatbotUI class manages the chatbot interface within the main menu of the game. It handles the creation of the chatbot window, including predefined question buttons and a text input field for users to type their queries. The class also handles input processing, interacting with a ChatbotService to get responses based on the user's input.

Constructor

public ChatbotUI(Stage stage, Skin skin, MainMenuDisplay mainMenuDisplay)

Parameters:

stage:

The stage where the chatbot window will be added.

skin:

The skin used for styling UI elements.

mainMenuDisplay:

The main menu display class responsible for handling menu interaction and visibility. The constructor initializes the ChatbotUI, sets up predefined questions, and creates an instance of ChatbotService.

image