Package card.trainer
Class TrainerCard
java.lang.Object
card.Card
card.trainer.TrainerCard
- Direct Known Subclasses:
Bill
,ProfessorOak
This class represents a Trainer card in the Pokémon Trading Card Game.
It extends the Card class and provides methods to get the description of the card and use its effect.
It is an abstract class that serves as a base for specific trainer cards.
- Version:
- 1.0
- Author:
- Tyler Mong
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionTrainerCard
(String name, String description) Constructor to initialize a trainer card with a name and description. -
Method Summary
Modifier and TypeMethodDescriptionReturns the description of the trainer card.void
Overloaded method to use the effect of the trainer card without a discard pile.abstract void
useEffect
(Deck deck, Hand hand, DiscardPile discardPile) Abstract method to use the effect of the trainer card.
-
Field Details
-
description
-
-
Constructor Details
-
TrainerCard
Constructor to initialize a trainer card with a name and description. This constructor is called by the subclasses to create a new trainer card.- Parameters:
name
- The name of the trainer card.description
- The description of the trainer card, explaining its effect.
-
-
Method Details
-
getDescription
Returns the description of the trainer card.- Returns:
- The description of the trainer card, explaining its effect.
-
useEffect
Abstract method to use the effect of the trainer card.- Parameters:
deck
- The player's deck.hand
- The player's hand.discardPile
- The player's discard pile (null if not applicable).
-
useEffect
Overloaded method to use the effect of the trainer card without a discard pile. This method calls the abstract useEffect method with a null discard pile.- Parameters:
deck
- The player's deck.hand
- The player's hand.
-