Constructor and Description |
---|
Player() |
Modifier and Type | Method and Description |
---|---|
void |
getMap()
getMap() method for create object to the map
and same time it will add default player names and scores
|
int |
roleDice()
roleDice() method gives random number between to 1 to 6 when role the dice
|
void |
showScore()
showScore() method shows score of each player and it will announce the winner
|
void |
startGame()
startGame() method it starts the game and this method executes untill one player got 100 score
It will scan r character to role dice
roleDice() get called to get random number
updateScore() get called to update score
showScore() get called to show the update score to the players
|
int |
updateScore(java.lang.String playerName,
int addScore)
updateScore() this method goes to update the score after rolling the dice
|
public int roleDice()
public void getMap()
public int updateScore(java.lang.String playerName, int addScore)
updateScore
in interface Dice
playerName
- addScore
- public void showScore()
public void startGame()