コード例 #1
0
 public void refreshHandsVisible() {
   for (PlayerPanel pPanel : players) {
     if (Engine.getCurrentGame().getCurrentPlayer().equals(pPanel.getReference())) {
       pPanel.setHandVisible(true);
     } else pPanel.setHandVisible(false);
   }
 }
コード例 #2
0
 public void refreshPlayerPhases() {
   for (PlayerPanel pPanel : players) {
     if (pPanel.getReference().equals(Engine.getCurrentGame().getCurrentPlayer()))
       pPanel.setPhase(Engine.getCurrentGameState().getCurrentPhase());
     else pPanel.setPhase(null);
   }
 }
コード例 #3
0
 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;
 }
コード例 #4
0
 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;
 }
コード例 #5
0
 public void refreshCardPanels() {
   for (PlayerPanel pPanel : players) {
     pPanel.getHandPanel().refreshCardPanels();
     pPanel.getFieldPanel().refreshCardPanels();
     pPanel.getDeckPanel().refreshSize();
     pPanel.getGraveyardPanel().refreshSize();
   }
 }
コード例 #6
0
 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;
 }
コード例 #7
0
 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);
   }
 }
コード例 #8
0
 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;
 }
コード例 #9
0
 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;
 }
コード例 #10
0
 public void makeAllUnSelectable() {
   for (PlayerPanel pPanel : players) {
     pPanel.makeAllUnSelectable();
   }
 }
コード例 #11
0
 public void refreshPlayerLifeTotals() {
   for (PlayerPanel pPanel : players) {
     pPanel.setLife(pPanel.getReference().getRemainingLifePoints());
   }
 }