Exemplo n.º 1
0
 /** Asks the player to determine their next move using their behaviour. */
 @Override
 public void determineMove() {
   tilesToTrade = 6;
   Move move = behaviour.determineMove(game.getBoard(), getHand());
   if (move.getTiles().size() > 0) {
     playedTiles = move.getTiles();
     try {
       game.doMove(this, move);
     } catch (InvalidMoveException e) {
       e.printStackTrace();
     } catch (MoveOrderException e) {
       e.printStackTrace();
     }
   } else {
     playedTiles = new ArrayList<Tile>(hand);
     hand.clear();
     try {
       game.tradeTiles(this, playedTiles);
     } catch (MoveOrderException e) {
       e.printStackTrace();
     }
   }
 }