Since we now have a complex Deck structure, we must revisit each of the functions that operate on a deck:
- The first of these is InitializeDeck(). Modify InitializeDeck(), as follows:
void InitializeDeck( Deck* pDeck ) {
Face f[] = { two , three , four , five , six , seven ,
eight , nine, ten, jack , queen , king, ace };
Card* pC;
for( int i = 0 ; i < kCardsInSuit ; i++ ){
pC = &(pDeck->ordered[ i + (0*kCardsInSuit) ]);
InitializeCard( pC , spade , f[i], kNotWildCard );
pC = &(pDeck->ordered[ i + (1*kCardsInSuit) ]);
InitializeCard( pC , heart , f[i], kNotWildCard );
pC = &(pDeck->ordered[ i + (2*kCardsInSuit) ]);
InitializeCard( pC , diamond , f[i], kNotWildCard );
pC = &(pDeck->ordered[ i + (3*kCardsInSuit) ]);
InitializeCard( pC , club , f[i], kNotWildCard );
}
for( int i = 0 ; i < kCardsInDeck ; i++ ){
pDeck->shuffled[i] = &(pDeck->ordered[i]);
}
pDeck->bIsShuffled = false;
pDeck->...