summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKyle K <kylek389@gmail.com>2011-01-29 19:51:34 -0600
committerKamil Kaminski <kamilkss@gmail.com>2011-01-29 19:51:34 -0600
commit1bca9c502c09758bbfc139ccfd0e9b53560b8d13 (patch)
treed9434833df3b57a9cb8601f0015b629af7a695bf
parentda1a7180edee0f108d15314e493faa2e9e067095 (diff)
downloadpoker-1bca9c502c09758bbfc139ccfd0e9b53560b8d13.tar.gz
poker-1bca9c502c09758bbfc139ccfd0e9b53560b8d13.tar.bz2
poker-1bca9c502c09758bbfc139ccfd0e9b53560b8d13.zip
move numOfOpponents to Opponent class
-rw-r--r--main.cpp8
-rw-r--r--opponent.cpp12
-rw-r--r--opponent.h6
3 files changed, 13 insertions, 13 deletions
diff --git a/main.cpp b/main.cpp
index 1dee3e1..f7ecf30 100644
--- a/main.cpp
+++ b/main.cpp
@@ -57,15 +57,15 @@ int main(int argc, char *argv[])
pokerGame->printUserCards();
cout << "\nDealing cards to opponent(s)" << endl;
- pokerGame->dealOpponentCards(pokerGame->numOfOpponents);
- pokerGame->sortOpponentCards(pokerGame->numOfOpponents);
+ pokerGame->dealOpponentCards();
+ pokerGame->sortOpponentCards();
cout << "Opponents' cards:" << endl;
- pokerGame->printOpponentCards(pokerGame->numOfOpponents);
+ pokerGame->printOpponentCards();
#ifdef DEBUG
cout << "Computer's AI" << endl;
pokerGame->opponentAI(pokerGame->getOpponentsCards(1));
- pokerGame->printOpponentCards(pokerGame->numOfOpponents);
+ pokerGame->printOpponentCards();
#endif
#ifdef DEBUG
diff --git a/opponent.cpp b/opponent.cpp
index 7f8a14b..022e26c 100644
--- a/opponent.cpp
+++ b/opponent.cpp
@@ -11,19 +11,19 @@ Opponent::Opponent(void) : whatHand(9)
}
-void Opponent::dealOpponentCards(int opponentsAmount)
+void Opponent::dealOpponentCards(void)
{
/* the cards will be dealt from end of the deck array using deckCurrIndex */
int i, j;
- for (j = 0; j < opponentsAmount; j++)
+ for (j = 0; j < numOfOpponents; j++)
for (i = 0; i < 5; i++)
opponentCards[j][i] = PopCardFromDeck();
}
-void Opponent::printOpponentCards(int opponentsAmount)
+void Opponent::printOpponentCards(void)
{
int j;
- for (j = 0; j < opponentsAmount; j++)
+ for (j = 0; j < numOfOpponents; j++)
{
cout << "Opponent " << j+1 << ": ";
@@ -35,10 +35,10 @@ void Opponent::printOpponentCards(int opponentsAmount)
}
}
-void Opponent::sortOpponentCards(int opponentsAmount)
+void Opponent::sortOpponentCards(void)
{
int j;
- for (j = 0; j < opponentsAmount; j++)
+ for (j = 0; j < numOfOpponents; j++)
sortCards(opponentCards[j]);
}
diff --git a/opponent.h b/opponent.h
index 5376ecf..cda27e1 100644
--- a/opponent.h
+++ b/opponent.h
@@ -13,9 +13,9 @@ class Opponent : virtual public CardPile
public:
Opponent(void);
- void dealOpponentCards(int);
- void printOpponentCards(int);
- void sortOpponentCards(int);
+ void dealOpponentCards();
+ void printOpponentCards();
+ void sortOpponentCards();
Card **getOpponentsCards(int);
int numOfOpponents;