The Deck Classes
See the full Java Deck Classes by clicking the buttons below.
Java Full Deck Class Java Player Deck ClassThe Java Edition has two Deck classes, Full Deck and Player Deck. As titled, the Full Deck class stores the entire deck of Perang cards while the Player Deck is only filled with Cards the player started with or has earned. The Decks are built with information stored in the Game Data class. In both decks, the Cards are stored as an Array List.
To keep multiple instances of the Full Deck from being created, the single_instance variable is used in conjuction with a getInstance method. There is no need to do this for the Player Deck because there are two players and therefore two player decks get created during a session. Or at least, that was the plan. Both the Java and Unreal editions only create a single Player Deck. During a battle, the AI's cards are pulled from the Full Deck. This process is only for the stand-alone edition. When this gets inserted into the main game, non-player characters will be given an AI deck which will combine a set of static cards, which the AI NPC will always carry, and some random cards.
More to come...
Next Class: The Board
The Board →