The Deck Classes
See the full Java Deck Classes by clicking the buttons below.Java Full Deck Class Java Player Deck Class
The 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.
In order to import the card data, a Blueprint Structure (Struct) had to be created. This tells Unreal Engine how to define the various parts of the table.
Deck Data Table
The Full Perang Deck of cards is kept in a .csv table. This makes it easier to update. I can add, subtract, or modify card data in the table and click the 'Reimport' button to update it in Unreal Engine. Quick and easy. The Level Database Actor is where these accessed. I'll talk about those on that page.