public void refreshHandsVisible() {
   for (PlayerPanel pPanel : players) {
     if (Engine.getCurrentGame().getCurrentPlayer().equals(pPanel.getReference())) {
       pPanel.setHandVisible(true);
     } else pPanel.setHandVisible(false);
   }
 }
 public void refreshPlayerPhases() {
   for (PlayerPanel pPanel : players) {
     if (pPanel.getReference().equals(Engine.getCurrentGame().getCurrentPlayer()))
       pPanel.setPhase(Engine.getCurrentGameState().getCurrentPhase());
     else pPanel.setPhase(null);
   }
 }
 public List<PlayerSelectionPanel> getPlayerSelectionPanels(List<Player> players) {
   List<PlayerSelectionPanel> playerSelectionPanels = new LinkedList<PlayerSelectionPanel>();
   for (PlayerPanel pPanel : this.players) {
     if (players.contains(pPanel.getReference()))
       playerSelectionPanels.add(pPanel.getPlayerSelectPanel());
   }
   return playerSelectionPanels;
 }
 public List<CardPanel> getCardPanelsInHands(List<Card> cards) {
   List<CardPanel> cardPanels = new LinkedList<CardPanel>();
   for (PlayerPanel pPanel : players) {
     // System.out.println(pPanel.getHandPanel().getCardPanels(cards));
     cardPanels.addAll(pPanel.getHandPanel().getCardPanels(cards));
   }
   return cardPanels;
 }
 public void refreshCardPanels() {
   for (PlayerPanel pPanel : players) {
     pPanel.getHandPanel().refreshCardPanels();
     pPanel.getFieldPanel().refreshCardPanels();
     pPanel.getDeckPanel().refreshSize();
     pPanel.getGraveyardPanel().refreshSize();
   }
 }
 public List<CardPanel> getCreaturePanelsOnFields(List<CreatureCard> creatures) {
   List<CardPanel> creaturePanels = new LinkedList<CardPanel>();
   List<Card> cardSearch = new LinkedList<Card>();
   cardSearch.addAll(creatures);
   for (PlayerPanel pPanel : players) {
     creaturePanels.addAll(pPanel.getFieldPanel().getCardPanels(cardSearch));
   }
   return creaturePanels;
 }
 public void refreshPlayers() {
   List<PlayerPanel> deadPlayerPanels = new LinkedList<PlayerPanel>();
   for (PlayerPanel pPanel : players) {
     if (!pPanel.getReference().isAlive()) deadPlayerPanels.add(pPanel);
   }
   players.remove(deadPlayerPanels);
   for (PlayerPanel pPanel : deadPlayerPanels) {
     playersView.remove(pPanel);
   }
 }
 public CardPanel getCardPanelForCard(Card card) {
   CardPanel found = null;
   Iterator<PlayerPanel> playerPanelIt = players.iterator();
   while (playerPanelIt.hasNext() && found == null) {
     PlayerPanel pPanel = playerPanelIt.next();
     CardZonePanel panel = pPanel.getHandPanel();
     found = panel.getCardPanelForCard(card);
     if (found == null) {
       panel = pPanel.getFieldPanel();
       found = panel.getCardPanelForCard(card);
     }
   }
   return found;
 }
 public CardZonePanel getCardZonePanelForCardZone(CardZone zone) {
   CardZonePanel found = null;
   Iterator<PlayerPanel> playerPanelIt = players.iterator();
   while (playerPanelIt.hasNext() && found == null) {
     PlayerPanel pPanel = playerPanelIt.next();
     CardZonePanel panel = pPanel.getHandPanel();
     if (panel.getCardZone().equals(zone)) found = panel;
     else {
       panel = pPanel.getFieldPanel();
       if (panel.getCardZone().equals(zone)) found = panel;
     }
   }
   return found;
 }
Ejemplo n.º 10
0
 public void makeAllUnSelectable() {
   for (PlayerPanel pPanel : players) {
     pPanel.makeAllUnSelectable();
   }
 }
Ejemplo n.º 11
0
 public void refreshPlayerLifeTotals() {
   for (PlayerPanel pPanel : players) {
     pPanel.setLife(pPanel.getReference().getRemainingLifePoints());
   }
 }