Package game

Class DeckBuilder

java.lang.Object
game.DeckBuilder

public class DeckBuilder extends Object
This class is responsible for building prebuilt decks. It initializes the decks with specific Pokémon, Trainer, and Energy cards. It also provides methods to retrieve all prebuilt decks and a specific prebuilt deck by name.
Version:
1.0
Author:
Tyler Mong
  • Field Details

    • prebuiltDecks

      private static final Map<String,Deck> prebuiltDecks
      Maps deck name to deck object. Uses a LinkedHashMap to maintain insertion order for consistent deck retrieval.
  • Constructor Details

    • DeckBuilder

      public DeckBuilder()
  • Method Details

    • initializePrebuiltDecks

      public static void initializePrebuiltDecks()
      Initializes the prebuilt decks by calling individual methods for each deck type. Each deck is populated with a specific set of Pokémon, Trainer, and Energy cards. This method is called at the start of the game to build the decks, so the players can choose from them. It also initializes some debug decks for testing purposes. These debug decks are not meant for actual gameplay.
    • initializeFireDeck

      private static void initializeFireDeck()
      Initializes the Fire deck with Fire-type Pokémon, Trainer cards, and Fire Energy cards.
    • initializeFightingDeck

      private static void initializeFightingDeck()
      Initializes the Fighting deck with Fighting-type Pokémon, Trainer cards, and Fighting Energy cards.
    • initializeWaterDeck

      private static void initializeWaterDeck()
      Initializes the Water deck with Water-type Pokémon, Trainer cards, and Water Energy cards.
    • initializeColorlessDeck

      private static void initializeColorlessDeck()
      Initializes the Colorless deck with Colorless-type Pokémon, Trainer cards, and Double Colorless Energy cards.
    • initializeMulliganDeck

      private static void initializeMulliganDeck()
      Initializes the Mulligan deck, used for testing purposes. It contains a high probability of Mulligan-ing. With 1 Pokémon card, the odds of Mulligan-ing are ~88.33%.
    • initializeEnergyDeck

      private static void initializeEnergyDeck()
      Initializes the Energy deck, used for testing purposes. It contains some Pokémon cards, lots of energy, and no trainers.
    • getAllPrebuiltDecks

      public static String[] getAllPrebuiltDecks()
      Returns an array of the prebuiltDeck map keys (deck names). This method is used to retrieve the names of all prebuilt decks available during the player's deck selection phase.
      Returns:
      An array of deck names.
    • getPrebuiltDeck

      public static Deck getPrebuiltDeck(String deckName)
      Returns a specific prebuilt deck by its name. This method is used to retrieve a specific deck when the player selects a deck to play with.
      Parameters:
      deckName - The name of the deck to retrieve.
      Returns:
      The prebuilt deck associated with the given name.