#include <ConnectFour.h>
ConnectFour Game.
- Author
- Darren Brogan
| ConnectFour::ConnectFour |
( |
| ) |
|
| ConnectFour::~ConnectFour |
( |
| ) |
|
Deconstructor for Connect Four.
| int ConnectFour::checkNext |
( |
const Square & |
current, |
|
|
int |
yOffset, |
|
|
int |
xOffset |
|
) |
| const |
|
private |
Recursive function to check the next square to see if it has a piece to see if it's owned by current player.
| void ConnectFour::drawScreen |
( |
| ) |
const |
|
privatevirtual |
Prints out the board and all the players pieces.
Implements Game.
| bool ConnectFour::executeMove |
( |
int |
x | ) |
|
|
private |
Function to take an int representing a column and move a piece to the next available slot in that column.
| bool ConnectFour::fourInRow |
( |
const Square & |
current | ) |
const |
|
private |
Function to get the max amount of pieces in a line around the piece added returns weather or not the number is greater than 3, signifying a win.
| bool ConnectFour::getMove |
( |
| ) |
|
|
privatevirtual |
Function to request a move from the user and read it in Pass move to executeMove().
Implements Game.
| int ConnectFour::getOpposition |
( |
| ) |
const |
|
private |
| int ConnectFour::getPoint |
( |
const string |
message, |
|
|
const int |
range |
|
) |
| const |
|
private |
Prompts with message to get a point between 0 and range.
| bool ConnectFour::isDraw |
( |
| ) |
const |
|
private |
Functions to test if the game has ended in a draw.
| bool ConnectFour::isLegal |
( |
const Square & |
current, |
|
|
int |
yOffset, |
|
|
int |
xOffset |
|
) |
| const |
|
private |
Function to test if the next square is legal.
| int ConnectFour::isOver |
( |
| ) |
|
|
privatevirtual |
Overloaded function to to return weather or not the game is over.
Implements Game.
| int ConnectFour::isOver |
( |
const Square & |
current | ) |
const |
|
private |
| vector<int> ConnectFour::columnHeight |
|
private |
Vector to hold how much pieces lie in each column.
Int to store the current state of the game.
The documentation for this class was generated from the following files: