public class Game
extends java.lang.Object
implements se.chalmers.dat255.risk.model.GameInterface
Constructor and Description |
---|
Game(java.lang.String[] playersId)
Creates a new Game.
|
Modifier and Type | Method and Description |
---|---|
void |
attack(se.chalmers.dat255.risk.model.Province offensiv,
se.chalmers.dat255.risk.model.Province defensive)
Method for handeling going in to battle and register the result of the battle.
|
int |
calcBonusUnits()
Method for calculating the amount of units
the player will receive at the start of his turn.
|
void |
changePhase()
Method for changing the state of the game to
the next state if it should be changed.
|
void |
changeTurn()
Method for changing the turn to the next player in turn.
|
void |
dealCard()
Method for handing a card from the deck to the active player.
|
se.chalmers.dat255.risk.model.Player |
getActivePlayer() |
int |
getBonusUnitsLeft()
Method for retrieving the number of units the player has left to place.
|
void |
placeBonusUnits(int units,
se.chalmers.dat255.risk.model.Province province)
Method for placing the amount of units the player chooses
the place on the province the player chooses to place them.
|
public Game(java.lang.String[] playersId)
playersId
- The ids of the playerspublic void changePhase()
se.chalmers.dat255.risk.model.GameInterface
changePhase
in interface se.chalmers.dat255.risk.model.GameInterface
public void changeTurn()
se.chalmers.dat255.risk.model.GameInterface
changeTurn
in interface se.chalmers.dat255.risk.model.GameInterface
public void attack(se.chalmers.dat255.risk.model.Province offensiv, se.chalmers.dat255.risk.model.Province defensive)
se.chalmers.dat255.risk.model.GameInterface
attack
in interface se.chalmers.dat255.risk.model.GameInterface
public se.chalmers.dat255.risk.model.Player getActivePlayer()
getActivePlayer
in interface se.chalmers.dat255.risk.model.GameInterface
public void dealCard()
se.chalmers.dat255.risk.model.GameInterface
dealCard
in interface se.chalmers.dat255.risk.model.GameInterface
public int calcBonusUnits()
se.chalmers.dat255.risk.model.GameInterface
calcBonusUnits
in interface se.chalmers.dat255.risk.model.GameInterface
public void placeBonusUnits(int units, se.chalmers.dat255.risk.model.Province province)
se.chalmers.dat255.risk.model.GameInterface
placeBonusUnits
in interface se.chalmers.dat255.risk.model.GameInterface
public int getBonusUnitsLeft()
se.chalmers.dat255.risk.model.GameInterface
getBonusUnitsLeft
in interface se.chalmers.dat255.risk.model.GameInterface