Esempio n. 1
0
 @Override
 public void setUpTwo() {
   try {
     initiateSettlement();
     initiateRoad();
   } catch (Exception e) {
     e.printStackTrace();
   }
 }
Esempio n. 2
0
 @Override
 public void roll() {
   try {
     Dice roller = new Dice(2);
     int roll = roller.roll();
     game.rollNumber(roll);
   } catch (Exception e) {
     e.printStackTrace();
   }
 }
Esempio n. 3
0
 @Test
 public void testCanRollNumber() {
   game.setPhase(TurnTracker.Phase.ROLLING);
   final int turn = game.getCurrentTurn();
   assertTrue(game.canRollNumber(turn));
   try {
     game.getTurnTracker().nextPhase();
   } catch (Exception e) {
     e.printStackTrace();
   }
   assertFalse(game.canRollNumber(turn));
 }
Esempio n. 4
0
 @Test
 public void testRollNumber() throws InvalidDiceRollException {
   final int turn = game.getCurrentTurn();
   try {
     game.getTurnTracker().nextPhase();
     game.getTurnTracker().nextPhase();
   } catch (Exception e) {
     e.printStackTrace();
   }
   final int roll = game.rollDice(turn);
   assertTrue(roll > 1);
   assertTrue(roll <= 12);
 }