From de3c686db787a9cfe62f3363fdeac478913cd9d6 Mon Sep 17 00:00:00 2001 From: Nathan Lum <33772546+Templarre@users.noreply.github.com> Date: Mon, 25 Feb 2019 22:50:58 -0700 Subject: [PATCH] Added Javadoc comments --- src/main.java | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/main.java b/src/main.java index a0e0942..f45a119 100644 --- a/src/main.java +++ b/src/main.java @@ -2,23 +2,47 @@ public class main { 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(TaipanShop 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. + * + */ + public static void main(String[] args) { main main = new main(); TaipanShop littyShop = new TaipanShop(main.getPlayer());