diff options
Diffstat (limited to 'opponent.cpp')
-rw-r--r-- | opponent.cpp | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/opponent.cpp b/opponent.cpp new file mode 100644 index 0000000..82f297a --- /dev/null +++ b/opponent.cpp @@ -0,0 +1,44 @@ +/* + * opponent.cpp + * + * + */ + +#include "opponent.h" + +Opponent::Opponent(void) : whatHand(9) +{ + +} + +void Opponent::dealOpponentCards(int opponentsAmount) +{ + /* the cards will be dealt from end of the deck array using deckCurrIndex */ + int i, j; + for (j = 0; j < opponentsAmount; j++) + for (i = 0; i < 5; i++) + opponentCards[j][i] = PopCardFromDeck(); +} + +void Opponent::printOpponentCards(int opponentsAmount) +{ + int j; + for (j = 0; j < opponentsAmount; j++) + { + cout << "Opponent " << j+1 << ": "; + + int i; + for (i = 0; i < 5; i++) + if (opponentCards[j][i]) + cout << i+1 << ") " << opponentCards[j][i]->getType() << " "; + cout << endl; + } +} + +void Opponent::sortOpponentCards(int opponentsAmount) +{ + int j; + for (j = 0; j < opponentsAmount; j++) + sortCards(opponentCards[j]); +} + |