Fix bunch of issues with Travel and Taipanshop, also merged Main, Shop, Travel and Start. Now attempting to merge in ship.
This commit is contained in:
58
src/MainGUI.java
Normal file
58
src/MainGUI.java
Normal file
@@ -0,0 +1,58 @@
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
public class MainGUI extends Application {
|
||||
private Player player = new Player();
|
||||
|
||||
/**
|
||||
* getter method for the Player object player.
|
||||
*
|
||||
* @return returns a copy of the object player
|
||||
*/
|
||||
|
||||
public Player getPlayer(){
|
||||
Player copy = new Player(player);
|
||||
return copy;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the Taipan shop with the players stats after the player finishes shopping, it updates the player object and returns it.
|
||||
*
|
||||
* @param shop player object from the main class used to update the shop class
|
||||
*/
|
||||
|
||||
public void shop(TaipanShopGUI shop){
|
||||
shop.setPlayer(player);
|
||||
shop.shop();
|
||||
player = shop.getPlayer();
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the player object with 5 guns or $400 and $5000 debt.
|
||||
*
|
||||
* @param start player object from the main class used to update the start class
|
||||
*/
|
||||
|
||||
public void start(Start start){
|
||||
start.setPlayer(player);
|
||||
start.initialize();
|
||||
player = start.getPlayer();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Updates main class with player data and starts the game.
|
||||
* The game will only run as long as the player has not retired or has been destroyed.
|
||||
* @param args Just the console for the player to look at.
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
launch(args);
|
||||
}
|
||||
|
||||
public void start(Stage primaryStage) throws Exception {
|
||||
StartGUI start = new StartGUI(player);
|
||||
start.initializeStart(primaryStage);
|
||||
primaryStage.show();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user