java.lang.Object
view.ViewController
-
Field Summary
FieldsModifier and TypeFieldDescriptionjavafx.beans.property.StringPropertyjavafx.beans.property.StringProperty -
Constructor Summary
ConstructorsConstructorDescriptionThe ViewController function is the main function of the ViewController class. -
Method Summary
Modifier and TypeMethodDescriptionvoidBack(javafx.event.ActionEvent event) The Back function is used to return the user to the ChooseGameMode screen.voidThe ChooseGameMode function is a function that allows the user to choose between playing in single player mode or multiplayer mode.voidExit(javafx.event.ActionEvent event) The Exit function is a function that exits the program.voidThe loadHomePage function is used to load the HomePage.fxml file into the main window of our application.voidThe loadScene function is used to load a new scene into the stage.voidsetViewSharedData(ViewSharedData viewSharedData) The setViewSharedData function is used to set the viewSharedData variable.voidThe StartTutorial function is called when the user clicks on the "Tutorial" button.
-
Field Details
-
wordFromPlayer
public javafx.beans.property.StringProperty wordFromPlayer -
playerAction
public javafx.beans.property.StringProperty playerAction
-
-
Constructor Details
-
ViewController
public ViewController()The ViewController function is the main function of the ViewController class. It creates a new instance of the GameModel class, and then calls its startGame() method. The ViewController also sets up all the GUI elements for this game, including: - A TextField for entering words to guess (wordFromPlayer) - A Label that displays whether a word was guessed correctly (playerAction)
-
-
Method Details
-
loadScene
The loadScene function is used to load a new scene into the stage.- Parameters:
sceneName- sceneName Load the scene that is passed in- Throws:
IOException
-
StartTutorial
The StartTutorial function is called when the user clicks on the "Tutorial" button. It loads a new scene, which displays instructions for how to play the game.- Throws:
IOException
-
ChooseGameMode
The ChooseGameMode function is a function that allows the user to choose between playing in single player mode or multiplayer mode. It does this by loading the GameModePage scene.- Throws:
IOException
-
loadHomePage
The loadHomePage function is used to load the HomePage.fxml file into the main window of our application. This function is called when a user clicks on the "Home" button in our application's menu bar, and it will display all the information that we have stored about each student in our database. It also allows us to add new students, edit existing students' information, or delete any student from our database entirely.- Throws:
IOException
-
Exit
The Exit function is a function that exits the program.- Parameters:
event- event Get the source of the action- Throws:
IOException
-
Back
The Back function is used to return the user to the ChooseGameMode screen.- Parameters:
event- event Get the source of the action- Throws:
IOException