public class Console
extends MonopolyUI
STUDENTS SHOULD NOT CHANGE THE CONTENTS OF THIS FILE IN ANY WAY.
| Modifier and Type | Field and Description |
|---|---|
private boolean |
autoPlay |
private java.util.Scanner |
stdin |
| Constructor and Description |
|---|
Console() |
| Modifier and Type | Method and Description |
|---|---|
Property |
askForProperty(Player player,
java.util.ArrayList<Property> list)
Displays a drop-down menu of properties for which the player may purchase
houses.
|
boolean |
askQuestion(Player player,
java.lang.String str)
Displays a question prompt for a particular user with "yes" and "no"
options.
|
boolean |
askQuestion(java.lang.String str)
Display a question prompt with "yes" and "no" options.
|
void |
displayDice(int dieOne,
int dieTwo)
Display the current values of the dice
|
void |
displayMessage(Player player,
java.lang.String str)
Displays a message that does not require a response for a particular user
|
void |
displayMessage(java.lang.String str)
Displays a message that does not require a response.
|
void |
end()
Close the UI.
|
void |
movePawn(int start,
int end)
Move a pawn around the board.
|
void |
redrawProperty(Property property)
Refresh property information in the GUI.
|
void |
refreshPlayers()
Refresh player information in the GUI.
|
void |
setAutoPlay(boolean enable)
Enables automatic game play.
|
void |
switchPlayers(int currPlayer,
int nextPlayer)
Update GUI to transfer game play from one player to another.
|
public void switchPlayers(int currPlayer,
int nextPlayer)
switchPlayers in class MonopolyUIcurrPlayer - The current playernextPlayer - The next playerpublic void refreshPlayers()
refreshPlayers in class MonopolyUIpublic void redrawProperty(Property property)
redrawProperty in class MonopolyUIproperty - The property to updatepublic void movePawn(int start,
int end)
movePawn in class MonopolyUIstart - Starting locationend - Ending locationpublic void displayDice(int dieOne,
int dieTwo)
displayDice in class MonopolyUIdieOne - The first diedieTwo - The second diepublic boolean askQuestion(java.lang.String str)
askQuestion in class MonopolyUIstr - The question to displaypublic boolean askQuestion(Player player,
java.lang.String str)
askQuestion in class MonopolyUIplayer - The player to display the prompt tostr - The question to displaypublic void displayMessage(java.lang.String str)
displayMessage in class MonopolyUIstr - The message to displaypublic void displayMessage(Player player,
java.lang.String str)
displayMessage in class MonopolyUIplayer - The player to display the message tostr - The message to displaypublic Property askForProperty(Player player,
java.util.ArrayList<Property> list)
askForProperty in class MonopolyUIplayer - The player to display the prompt tolist - The list of properties for which the player may purchase housespublic void end()
end in class MonopolyUIpublic void setAutoPlay(boolean enable)
setAutoPlay in class MonopolyUIenable - If true, then enable automatic game play. Otherwise, disable.