Esempio n. 1
0
  /** Method which switches the which phase of the game is being displayed on the GUI */
  public void switchScenes() {
    if (currentRoot == draftLayout) {
      primaryStage.getScene().setRoot(votingLayout);
      currentRoot = votingLayout;
      draftingPhase = false;
      // votingLayout.onResize();
      chatNode = votingLayout.getChatNode();
      tickerReel = votingLayout.getTickerReel();

    } else {
      primaryStage.getScene().setRoot(draftLayout);
      currentRoot = draftLayout;
      draftingPhase = true;
      draftLayout.getHand().onResize();
      chatNode = draftLayout.getChatNode();
      tickerReel = draftLayout.getTickerReel();
    }
  }
Esempio n. 2
0
 /** basic initializing of things that only need to be called once */
 public void initGame() {
   chatNode = draftLayout.getChatNode();
   tickerReel = draftLayout.getTickerReel();
   if (client != null) {
     cardsInHand = client.getHand();
     assignedRegion = client.getRegion();
   }
   if (testing) {
     CardDeck cardDeck = new CardDeck(EnumRegion.USA_MOUNTAIN);
     EnumPolicy[] deck = cardDeck.drawCards();
     draftLayout.getHand().setPolicies(deck);
     System.out.println(Arrays.deepToString(deck));
   }
   if (cardsInHand != null) {
     getDraftLayout()
         .getHand()
         .setPolicies(cardsInHand.toArray(new EnumPolicy[cardsInHand.size()]));
   }
   System.out.println(assignedRegion);
   getDraftLayout().getSummaryBar().setRegion(assignedRegion);
 }