blob: 8c23478f18135e25f7029a6b7878646feae34f43 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
/*
* 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]);
}
Card **Opponent::getOpponentsCards(int whichOpponent)
{
return opponentCards[whichOpponent];
}
|