[Commander] Display Commander in client

This commit is contained in:
Plopman 2013-07-17 20:35:52 +02:00
parent 930e70fbbb
commit e6847a472d
3 changed files with 25 additions and 11 deletions

View file

@ -651,7 +651,7 @@ public class PlayerPanelExt extends javax.swing.JPanel {
}
private void btnCommandZoneActionPerformed(java.awt.event.ActionEvent evt) {
DialogManager.getManager(gameId).showEmblemsDialog(CardsViewUtil.convertEmblems(player.getEmblemList()), bigCard, gameId);
DialogManager.getManager(gameId).showEmblemsDialog(CardsViewUtil.convertCommandObject(player.getCommadObjectList()), bigCard, gameId);
}
private void btnCheatActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCheatActionPerformed

View file

@ -28,13 +28,12 @@
package mage.client.util;
import java.util.List;
import mage.cards.Card;
import mage.cards.repository.CardInfo;
import mage.cards.repository.CardRepository;
import mage.view.*;
import java.util.List;
/**
*
* @author BetaSteward_at_googlemail.com
@ -55,12 +54,17 @@ public class CardsViewUtil {
return cards;
}
public static CardsView convertEmblems(List<EmblemView> view) {
public static CardsView convertCommandObject(List<CommandObjectView> view) {
CardsView cards = new CardsView();
for (EmblemView emblem : view) {
CardView cardView = new CardView(emblem);
cards.put(emblem.getId(), cardView);
for (CommandObjectView commandObject : view) {
if(commandObject instanceof EmblemView ){
CardView cardView = new CardView((EmblemView)commandObject);
cards.put(commandObject.getId(), cardView);
}
else if(commandObject instanceof CommanderView ){
cards.put(commandObject.getId(),(CommanderView)commandObject);
}
}
return cards;