Completed javadocs for shipwarfare GUI

This commit is contained in:
KahootChampion
2019-03-10 22:58:31 -06:00
parent 9b9af573a8
commit ba16ea1809
2 changed files with 59 additions and 34 deletions

View File

@@ -294,9 +294,9 @@ public class ShipWarfareGUI {
}
/**
* Sets up the graphical part of ShipWarfare
* Sets up the graphical part of ShipWarfare and includes all logic for the class
* @param stage sets the stage to which we will execute the scene of the ShipWarfare class
* @return
* @return stage so that another class can switch to the stage
*/
public Stage initializeShip(Stage stage){
@@ -384,6 +384,10 @@ public class ShipWarfareGUI {
//Fight
fightButton.setOnAction(new EventHandler<ActionEvent>() {
@Override
/**
* Fight Button, engages in fight logic and graphical interface
* @param event, once button is clicked, executes graphical information
*/
public void handle(ActionEvent event) {
counter++;
chooseFightOrRun.setText("Ohh, Fight ehh?");
@@ -395,6 +399,10 @@ public class ShipWarfareGUI {
runButton.setVisible(false);
continueButton.setOnAction(new EventHandler<ActionEvent>() {
@Override
/**
* Switches to Taipan Shop scene
* @param event, once button is clicked, executes graphical information
*/
public void handle(ActionEvent event) {
TaipanShopGUI shop = new TaipanShopGUI(player);
shop.initializeShop(stage);
@@ -417,6 +425,10 @@ public class ShipWarfareGUI {
//Flee
runButton.setOnAction(new EventHandler<ActionEvent>() {
@Override
/**
* Run Button, engages in run logic and graphical interface
* @param event, once button is clicked, executes graphical information
*/
public void handle(ActionEvent event) {
chooseFightOrRun.setText("Ayy captain we will try to run!");
counter++;
@@ -433,6 +445,10 @@ public class ShipWarfareGUI {
runButton.setVisible(false);
continueButton.setOnAction(new EventHandler<ActionEvent>() {
@Override
/**
* Switches to Taipan Shop scene
* @param event, once button is clicked, executes graphical information
*/
public void handle(ActionEvent event) {
TaipanShopGUI shop = new TaipanShopGUI(player);
shop.initializeShop(stage);
@@ -467,6 +483,10 @@ public class ShipWarfareGUI {
return stage;
}
/**
* sets scene and runs stage
* @param primaryStage the stage in which the scene may be run and switched to
*/
public void start(Stage primaryStage){
primaryStage = initializeShip(primaryStage);
primaryStage.show();