summaryrefslogtreecommitdiffstats
path: root/game.h
diff options
context:
space:
mode:
Diffstat (limited to 'game.h')
-rw-r--r--game.h57
1 files changed, 57 insertions, 0 deletions
diff --git a/game.h b/game.h
new file mode 100644
index 0000000..f3f24de
--- /dev/null
+++ b/game.h
@@ -0,0 +1,57 @@
+#ifndef _GAME_H_
+#define _GAME_H_
+
+#include <iostream>
+#include <cstdio>
+#include <string>
+#include <cstdlib>
+#include <ctime>
+#include <cctype>
+#include <limits>
+
+#include "cardpile.h"
+#include "user.h"
+#include "opponent.h"
+
+#define ANSI_COLOR_RED "\x1b[31m"
+#define ANSI_COLOR_GREEN "\x1b[32m"
+#define ANSI_COLOR_YELLOW "\x1b[33m"
+#define ANSI_COLOR_BLUE "\x1b[34m"
+#define ANSI_COLOR_MAGENTA "\x1b[35m"
+#define ANSI_COLOR_CYAN "\x1b[36m"
+#define ANSI_COLOR_RESET "\x1b[0m"
+#define PRINT_COLOR(C, S) printf("%s%s%s", C, S, ANSI_COLOR_RESET)
+
+using std::cout;
+using std::endl;
+using std::cin;
+
+class Game : virtual public CardPile, public User, public Opponent
+{
+ private:
+
+ protected:
+ static string *hands[10];
+
+ public:
+ Game(void);
+ void shufflePile(void);
+ void askForNumberOfOpponents(void);
+ void repeatGame(bool *);
+
+ /* asks user for a number, param1 = msg, 2 = rangeA, 3 = rangeB */
+ int parseInt(string *, int, int);
+ int howManyCardsOfSameSuit(Card **);
+ bool pairOrBetter(Card **cards);
+ int numOfSameCards(Card **);
+
+ void opponentAI(Card **cards);
+
+ /* variables */
+ int numOfOpponents;
+ int handsPlayed;
+ int handsWon;
+};
+
+#endif
+