Beispiel #1
0
 public void movePieceBackward() {
   System.out.println("Piece: Moved backwards");
   EventBus.getInstance().publish(Event.OldPosition, getPosition(), this.getIndex());
   if (getPosition() < 2) {
     setPosition(0);
   } else {
     position = position - FAILED_MISSION_PENALTY;
   }
   EventBus.getInstance().publish(Event.NewPosition, getPosition(), this.getIndex());
   setBet(0);
 }
Beispiel #2
0
 public void movePieceForward(int bet) {
   System.out.println("Piece: Moved forward");
   EventBus.getInstance().publish(Event.OldPosition, getPosition(), this.getIndex());
   if (position + bet > GOAL_TILE) {
     setPosition(GOAL_TILE);
     EventBus.getInstance().publish(Event.GameOver, getTeam(), null);
   } else {
     position = position + bet;
   }
   EventBus.getInstance().publish(Event.NewPosition, getPosition(), this.getIndex());
   setBet(0);
 }