Пример #1
0
 // called when the User chooses a prebuilt or custom deck
 public void setPlayerDeck(String deckName) {
   if (deckName.equals("Yugi")) {
     currentPlayer = Card.addPrebuiltDeckToPlayerClass(yugiDeck);
   } else if (deckName.equals("Kiaba")) {
     currentPlayer = Card.addPrebuiltDeckToPlayerClass(kiabaDeck);
   } else if (deckName.equals("Joey")) {
     currentPlayer = Card.addPrebuiltDeckToPlayerClass(joeyDeck);
   } else if (deckName.equals("Pegasus")) {
     currentPlayer = Card.addPrebuiltDeckToPlayerClass(pegasusDeck);
   } else if (deckName.equals("Marik")) {
     currentPlayer = Card.addPrebuiltDeckToPlayerClass(marikDeck);
   } else if (deckName.equals("Weevil")) {
     currentPlayer = Card.addPrebuiltDeckToPlayerClass(weevilDeck);
   } else if (deckName.equals("Rex")) {
     currentPlayer = Card.addPrebuiltDeckToPlayerClass(rexDeck);
   } else if (deckName.equals("Random")) {
     currentPlayer = Card.addPrebuiltDeckToPlayerClass(randomDeck);
   } else if (deckName.equals("Custom1")) {
     currentPlayer = player1;
     currentFile = customDeck1File;
   } else if (deckName.equals("Custom2")) {
     currentPlayer = player2;
     currentFile = customDeck2File;
   } else if (deckName.equals("Custom3")) {
     currentPlayer = player3;
     currentFile = customDeck3File;
   } else if (deckName.equals("Custom4")) {
     currentPlayer = player4;
     currentFile = customDeck4File;
   }
 }
Пример #2
0
 // Call anytime you go to dualScreen
 public void setComputerToRandomDeck() {
   computer = Card.addPrebuiltDeckToPlayerClass(allDecks[r.nextInt(allDecks.length - 1)]);
 }