Package pile.piles
Class Hand
java.lang.Object
pile.Pile
pile.piles.Hand
Represents the player's hand in the Pokémon Trading Card Game, where the player holds their cards.
This class extends the Pile class and provides methods for managing the player's hand, such as playing a card and checking for basic Pokémon.
- Version:
- 1.0
- Author:
- Tyler Mong
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Checks if the player's hand contains any basic Pokémon cards.Plays a card from the player's hand and removes it from the hand.Methods inherited from class pile.Pile
addCard, display, drawCard, getCardAtIndex, getCards, getSize, isEmpty, removeCard, secondaryDisplay, shuffle
-
Constructor Details
-
Hand
public Hand()Constructor for the Hand class. Initializes the player's hand.
-
-
Method Details
-
playCard
Plays a card from the player's hand and removes it from the hand.- Parameters:
card
- The card to be played.- Returns:
- The played card.
-
hasBasicPokemon
public boolean hasBasicPokemon()Checks if the player's hand contains any basic Pokémon cards. This is used in the game setup to check for a Mulligan.- Returns:
- True if there are basic Pokémon cards, false otherwise.
-