Difference between revisions of "2022 - Add a retrieve card"

From TRCCompSci - AQA Computer Science
Jump to: navigation, search
(Created page with "=Task= Create a new card child class for a Retrieve card. If a player draws a retrieve card they are able to retrieve one card from the discard pile and return it to their h...")
 
(Task)
Line 4: Line 4:
 
If a player draws a retrieve card they are able to retrieve one card from the discard pile and return it to their hand.  
 
If a player draws a retrieve card they are able to retrieve one card from the discard pile and return it to their hand.  
  
There should be two retrieve cards in the deck. These should be added, like the difficulty cards, should be added after the user draws their hand.
+
There should be two retrieve cards in the deck. These should be added like the difficulty cards, and should be added after the user draws their hand.
  
 
=What you need to do=
 
=What you need to do=

Revision as of 11:45, 14 November 2021

Task

Create a new card child class for a Retrieve card.

If a player draws a retrieve card they are able to retrieve one card from the discard pile and return it to their hand.

There should be two retrieve cards in the deck. These should be added like the difficulty cards, and should be added after the user draws their hand.

What you need to do

  • Create a subclass of Card called RetrieveCard (look at DifficultyCard)
  • Look at how DifficultyCards are added to the deck (find the SetupGame & AddDifficultyCardsToDeck methods)
  • Add the code to create 2 RetrieveCards, and add them to the deck before they are shuffled
  • Find the GetCardFromDeck method, look at the 'if (Deck.GetCardDescriptionAt(0) == "Dif")'
  • Add the code to GetCardFromDeck that will process a RetrieveCard