Added Javadocs comments
This commit is contained in:
@@ -3,21 +3,41 @@ public class Start
|
|||||||
{
|
{
|
||||||
private Player player;
|
private Player player;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* getter method for obtaining a player object.
|
||||||
|
*
|
||||||
|
* @return returns player object
|
||||||
|
*/
|
||||||
public Player getPlayer() {
|
public Player getPlayer() {
|
||||||
Player playerTemp = new Player(player);
|
Player playerTemp = new Player(player);
|
||||||
return playerTemp;
|
return playerTemp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* setter method that takes in a Player object as an argument.
|
||||||
|
*
|
||||||
|
* @param player object of the class Player
|
||||||
|
*/
|
||||||
public void setPlayer(Player player) {
|
public void setPlayer(Player player) {
|
||||||
Player playerTemp = new Player(player);
|
Player playerTemp = new Player(player);
|
||||||
this.player = playerTemp;
|
this.player = playerTemp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Asks the user to input the name that they would like to be called in the game
|
||||||
|
*
|
||||||
|
* @param name the name that you would like to be called in the game
|
||||||
|
*/
|
||||||
public void setFirm (String name) {
|
public void setFirm (String name) {
|
||||||
if (name.length() <= 22) {
|
if (name.length() <= 22) {
|
||||||
player.setName(name);
|
player.setName(name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initializes the game by asking for your name and if you would like to start with either: 1) money and a debt or
|
||||||
|
* 2) guns and no cash/debt.
|
||||||
|
*/
|
||||||
public void initialize()
|
public void initialize()
|
||||||
{
|
{
|
||||||
Scanner userInput = new Scanner(System.in);
|
Scanner userInput = new Scanner(System.in);
|
||||||
@@ -46,6 +66,10 @@ public class Start
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Copy constructor.
|
||||||
|
* @param player object of the class Player
|
||||||
|
*/
|
||||||
public Start(Player player)
|
public Start(Player player)
|
||||||
{
|
{
|
||||||
Player playerTemp = new Player(player);
|
Player playerTemp = new Player(player);
|
||||||
|
|||||||
Reference in New Issue
Block a user