Added Javadoc comments

This commit is contained in:
Nathan Lum
2019-02-25 22:50:58 -07:00
committed by GitHub
parent 2abef09de8
commit de3c686db7

View File

@@ -2,23 +2,47 @@ public class main {
private Player player = new Player(); private Player player = new Player();
/**
* getter method for the Player object player.
*
* @return returns a copy of the object player
*/
public Player getPlayer(){ public Player getPlayer(){
Player copy = new Player(player); Player copy = new Player(player);
return copy; 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(TaipanShop shop){ public void shop(TaipanShop shop){
shop.setPlayer(player); shop.setPlayer(player);
shop.shop(); shop.shop();
player = shop.getPlayer(); 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){ public void start(Start start){
start.setPlayer(player); start.setPlayer(player);
start.initialize(); start.initialize();
player = start.getPlayer(); 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.
*
*/
public static void main(String[] args) { public static void main(String[] args) {
main main = new main(); main main = new main();
TaipanShop littyShop = new TaipanShop(main.getPlayer()); TaipanShop littyShop = new TaipanShop(main.getPlayer());