se.chalmers.dat255.risk.model
public class BonusHandler extends java.lang.Object
Constructor and Description |
---|
BonusHandler(WorldMap worldMap,
int numberOfPlayers) |
Modifier and Type | Method and Description |
---|---|
void |
calcBonusesFromCards(java.util.ArrayList<java.lang.String> names,
IPlayer activePlayer)
Calculates how large the bonus from trading in cards is.
|
void |
calcBonusForF0(int numberOfProvinces)
Calculates special bonus at the start of the game
|
void |
calcBonusUnits(IPlayer active)
Calculates how many units a player will receive at the start of the turn
|
int |
getBonus()
Returns the number of bonus units the current player has.
|
void |
placeBonusUnits(int units,
IProvince province)
Place units from a players bonus on a province
|
public BonusHandler(WorldMap worldMap, int numberOfPlayers)
public void calcBonusesFromCards(java.util.ArrayList<java.lang.String> names, IPlayer activePlayer)
names
- the provinces connected to the exchanged cardsactivePlayer
- the player to receive the bonuspublic void calcBonusUnits(IPlayer active)
active
- the active playerpublic int getBonus()
public void placeBonusUnits(int units, IProvince province)
units
- number of units to placeprovince
- the province to receive the unitspublic void calcBonusForF0(int numberOfProvinces)
numberOfProvinces
- number of provinces for the current player