示例#1
0
 private void addTokens() {
   ArrayList<Player> players = game.getPlayers();
   for (Player player : players) {
     Image tokenImage = player.getToken().getImage();
     JLabel token = new JLabel(new ImageIcon(tokenImage));
     token.setBounds(tileCoordinates[0][0], tileCoordinates[0][1], 30, 22);
     tokens.add(token);
     add(token);
   }
 }
示例#2
0
 private void makeTransaction(Game game, int payment) {
   Player source = game.getCurrentPlayer();
   Player target = game.getOwner((PropertyLand) getCurrentLand(game));
   if (!source.equals(target)) {
     source.decreaseBalance(payment);
     target.increaseBalance(payment);
     JOptionPane.showMessageDialog(
         null, source.getName() + " paid " + payment + "K to " + target.getName());
   }
 }