Closed Apanian25 closed 3 years ago
https://github.com/Apanian25/Comp345-Risk/blob/4204a8d1a297bf38f22c333ad18151d5694f5b3d/Risk/Comp345-Risk/Cards.h#L15 you misspelled Card
as Crad
https://github.com/Apanian25/Comp345-Risk/blob/4204a8d1a297bf38f22c333ad18151d5694f5b3d/Risk/Comp345-Risk/Cards.h#L16 you misspelled which
as whihc
https://github.com/Apanian25/Comp345-Risk/blob/4204a8d1a297bf38f22c333ad18151d5694f5b3d/Risk/Comp345-Risk/Cards.cpp#L50 it's not a default
constructor, it's a no param
constructor
https://github.com/Apanian25/Comp345-Risk/blob/4204a8d1a297bf38f22c333ad18151d5694f5b3d/Risk/Comp345-Risk/Cards.cpp#L206 people usually use i
for the outer loop, and j
for the inner loop
https://github.com/Apanian25/Comp345-Risk/blob/4204a8d1a297bf38f22c333ad18151d5694f5b3d/Risk/Comp345-Risk/Cards.cpp#L61 https://github.com/Apanian25/Comp345-Risk/blob/4204a8d1a297bf38f22c333ad18151d5694f5b3d/Risk/Comp345-Risk/Cards.cpp#L71
if(counter == h.hand.size())
then you know that you looped over every card, and you can take care of it. This makes it so that you check 1 if
condition instead of h.hand.size() if
conditions (if you choose this approach, I believe your counter needs to start at 0)
Tasks
[x] Deck is a finite collection of Warzone cards.
[x] Hand is a finite collection of Warzone cards.
[x] Each card has a type from: spy, bomb, reinforcement, blockade, airlift, and diplomacy.
[x] Deck has a draw() method that allows a player to draw a card at random from the cards remaining in the deck and place it in their hand.
[x] Each card has a play() method that enables a player to use it during game play by creating special orders. Once a card has been played, it is removed from the hand and put back into the deck.
[x] Driver that creates a deck of cards of all different kinds, then creates a hand object that is filled by drawing cards from the deck, then calls the play method of all cards in the hand.
Description
Implement a group of C++ classes that implements a deck and hand of Warzone cards. Each card has a type from: bomb, reinforcement, blockade, airlift and diplomacy. The deck must have a draw() method that allows a player to draw a card at random from the cards remaining in the deck and place it in their hand of cards. The cards must have a play() method that is called to play the card, which creates an order and adds it to the player’s list of orders and then returns the card to the deck. All the classes/functions that you implement for this component must all reside in a single .cpp/.h file duo named Cards.cpp/Cards.h. You must deliver a file named CardsDriver.cpp file that creates a deck of Warzone cards. The driver must also create a hand object that is filled by drawing cards from the deck.