MiniGame-Madness
con4.h
Go to the documentation of this file.
1 #ifndef CON4_H
2 #define CON4_H
3 
4 #include "screenBuffer.h"
5 
6 using namespace std;
7 
17 class Con4 {
18 private:
19  int grid[6][7];
20  int player1 = 1, player2 = 2; //1 for player 1, 2 for 2, 0 for empty space.
21  int currentplayer;
22  bool winquestionmark = false;
23 
24  ScreenBuffer screenBuffer;
25 
30  void endgame(wstring letter);
31 
32 public:
36  Con4();
37 
41  void populategrid();
42 
48  void dropcoin(int column, int playercoin);
49 
53  void checkdraw();
54 
61  void setnum(int player, int xval, int yval);
62 
66  void checkwin();
67 
72  int randomstarter();
73 
78  int swapturn(int playert);
79 
84  void playerturn(int player);
85 
89  void display();
90 
94  int connect4();
95 };
96 
97 #endif // CON4_H
A class that represents the screen buffer.
Definition: screenBuffer.h:26
Class to handle the Connect 4 game logic.
Definition: con4.h:17