|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectMonopoly.Monopoly
public class Monopoly
Invariant: Once created and until destroyed, this instance represents a Monopoly game with its grafical representation.
| Field Summary | |
|---|---|
GUI |
board
|
| Constructor Summary | |
|---|---|
Monopoly()
Creates a new Monopoly object. |
|
| Method Summary | |
|---|---|
Player |
activePlayer()
Returns the player who is playing (Accessor). |
void |
bankrupt()
Removes the active player from the game after having notified him, and made all of his properties available for collection. |
void |
buyHouse(Street st)
Notifies the active player that a house purchase request occured. |
void |
dept(int dept)
Notifies the user (GUI) that the active player owes. |
Cell[] |
getCells()
Returns the Cell Array which contains the cells of the game (Accessor). |
Card |
getCommandCard()
Searches and returns the first Command Card (Accessor). |
java.util.Collection<Card> |
getCommandCards()
Returns the Collection of the Property Cards (Accessor). |
Card |
getDecisionCard()
Searches and returns the first Decision Card (Accessor). |
java.util.Collection<Card> |
getDecisionCards()
Returns the Collection of the Decisions Cards (Accessor). |
java.lang.Object[] |
getHouseNames()
Get the names of the streets which belong to the active player and can have a house removed from. |
Cell |
getJail()
Returns the Jail Cell (Accessor). |
java.lang.Object[] |
getMortaged()
Get the names of the properties which belong to the active player and are mortaged. |
Player |
getPlayer(java.lang.String name)
Returns a Player with the given name (Accessor). |
java.util.Collection<Player> |
getPlayers()
Returns the Players Collection (Accessor). |
java.lang.Object[] |
getPlayersNames()
Get the names of all the players apart from the active one. |
Property |
getProperty(java.lang.String name)
Returns a Property cell with the given name (Accessor). |
int[] |
getRoll()
Returns the result of the roll of the dice (Accessor). |
Street |
getStreet(java.lang.String name)
Returns a Street cell with the given name (Accessor). |
java.lang.Object[] |
getStreetsNames()
Get the names of the streets which belong to the active player and can be built on. |
java.lang.Object[] |
getTradable(Player owner)
Get the names of the properties which belong to the given Player and can be traded. |
java.lang.Object[] |
getUnmortaged()
Get the names of the properties which belong to the active player and can be mortaged. |
void |
mortageProperty(Property pr)
Notifies the active player that a mortage request occured. |
void |
movePlayer(int num,
int cur,
int des)
Notifies the GUI that the active player has moved. |
void |
newPlayers(java.util.ArrayList names)
Initializes the players collection, giving each new Player instance a String name and integer number. |
Player |
nextPlayer()
Returns the player who will play after the active player (Accessor). |
void |
notEnoughMoney()
Notifies the user (GUI) that he does not have enough money for the action he requested. |
void |
playTurn()
Moves the game to the next round. |
boolean |
purchaseProperty()
Notifies the user (GUI) that the active player can purchase a property. |
void |
refresh(int location,
java.lang.String name,
java.lang.String owner,
int price,
int rent,
int housePrice)
Notifies the GUI that a change has occured on the popup menus. |
void |
sellHouse(Street st)
Notifies the active player that a house sail request occured. |
void |
showAct()
Show an action on the GUI Central Window. |
void |
showAct(Card c)
Show an action on the GUI Central Window. |
void |
showAct(Taxes t)
Show an action on the GUI Central Window. |
void |
showRent(java.lang.String s)
Inform the user (GUI) for a rent pay with a window. |
void |
unmortageProperty(Property pr)
Notifies the active player that an unmortage request occured. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public GUI board
| Constructor Detail |
|---|
public Monopoly()
| Method Detail |
|---|
public void newPlayers(java.util.ArrayList names)
names - the list of namespublic Cell[] getCells()
public int[] getRoll()
public Cell getJail()
public java.util.Collection<Player> getPlayers()
public java.util.Collection<Card> getDecisionCards()
public Card getDecisionCard()
public java.util.Collection<Card> getCommandCards()
public Card getCommandCard()
public Player activePlayer()
public Player nextPlayer()
public Street getStreet(java.lang.String name)
public Property getProperty(java.lang.String name)
public Player getPlayer(java.lang.String name)
public java.lang.Object[] getTradable(Player owner)
owner - the player whose tradable properties will be returned
public java.lang.Object[] getUnmortaged()
public java.lang.Object[] getStreetsNames()
public java.lang.Object[] getHouseNames()
public java.lang.Object[] getMortaged()
public java.lang.Object[] getPlayersNames()
public void buyHouse(Street st)
st - the Street to add the house topublic void sellHouse(Street st)
st - the Street to remove the house frompublic void mortageProperty(Property pr)
pr - the Property to mortagepublic void unmortageProperty(Property pr)
pr - the Property to unmortagepublic boolean purchaseProperty()
public void bankrupt()
public void dept(int dept)
dept - the amount he owespublic void notEnoughMoney()
public void movePlayer(int num,
int cur,
int des)
num - the cardinal number of the player who movedcur - the initial position on the boarddes - the destination
public void refresh(int location,
java.lang.String name,
java.lang.String owner,
int price,
int rent,
int housePrice)
location - the number of the Cell that changedname - the name of the Cellowner - price - rent - housePrice - public void showAct()
public void showAct(Card c)
public void showAct(Taxes t)
public void showRent(java.lang.String s)
public void playTurn()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||