se.chalmers.dat255.risk.model
CARD_ADDED, CARD_REMOVED
Constructor and Description |
---|
Player(int turnId,
java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
void |
addCard()
Takes a card from the deck and puts on the players hand.
|
void |
addListener(java.beans.PropertyChangeListener observer)
Adds a listener to this object
|
void |
discard()
Discards the players cards when s/he loses.
|
boolean |
exchangeCard(ICard c1,
ICard c2,
ICard c3)
Method for trading in cards for troops.
|
void |
gainProvince()
Increments the number of provinces that the player currently controls.
|
java.util.ArrayList<ICard> |
getCards()
Returns the cards on the players hand
|
int |
getId()
returns a players id
|
java.lang.String |
getName()
Returns the name of the player.
|
int |
getNrOfProvinces()
Returns the number of provinces that the player currently controls.
|
void |
loseProvince()
Decrements the number of provinces that the player currently controls.
|
public void addListener(java.beans.PropertyChangeListener observer)
IPlayer
addListener
in interface IPlayer
observer
- the listener of this objectpublic void addCard()
IPlayer
public void gainProvince()
IPlayer
gainProvince
in interface IPlayer
public void loseProvince()
IPlayer
loseProvince
in interface IPlayer
public int getNrOfProvinces()
IPlayer
getNrOfProvinces
in interface IPlayer
public boolean exchangeCard(ICard c1, ICard c2, ICard c3)
IPlayer
exchangeCard
in interface IPlayer
public java.lang.String getName()
IPlayer
public java.util.ArrayList<ICard> getCards()
IPlayer
public int getId()
IPlayer