chessCAMO
|
#include <iostream>
#include <vector>
#include <string>
#include <fstream>
#include <windows.h>
Go to the source code of this file.
Classes | |
class | Chess |
This class describes the chess board on which the game takes place. It contains functions which analyze specific flags to determinewhen to switch turns, display warnings, and even end the game. More... | |
class | Piece |
This class describes the pieces on the board at any given moment. It contains functions for determining the piece's type, color, possible/legal moves, and more helpful utilities for making decisions regarding move candidates. More... | |
class | Pawn |
This class describes a pawn and provides functions related to pawn movements. More... | |
class | Knight |
This class describes a knight and provides functions related to knight movements. More... | |
class | Bishop |
This class describes a bishop and provides functions related to bishop movements. More... | |
class | Rook |
This class describes a rook and provides functions related to rook movements. More... | |
class | Queen |
This class describes a queen and provides functions related to queen movements. More... | |
class | King |
This class describes a king and provides functions related to king movements. More... | |
class | Empty |
This class describes an empty square which is necessary to keep in mind when playing a game of chess. More... | |
Namespaces | |
chessCAMO | |
This namespace contains the global functions related to chessCAMO which are mainly used as helper functions to print information to the console to improve user experience while playing the game. | |
Macros | |
#define | GREEN 10 |
#define | CYAN 11 |
#define | RED 12 |
#define | PINK 13 |
#define | YELLOW 14 |
#define | DEFAULT 15 |
Enumerations | |
enum | pieceType { PAWN, KNIGHT, BISHOP, ROOK, QUEEN, KING, EMPTY } |
Piece's Type. More... | |
enum | pieceColor { BLACK, NEUTRAL, WHITE } |
Piece's Color. More... | |
Functions | |
template<class T > | |
int | chessCAMO::preProcessInput (T input) |
Converts the input string into its corresponding coordinate (integer) for easier computation in chess::makeMove(int src, int dest, istream& in). More... | |
void | chessCAMO::printBoard (const vector< Piece * > &board, const vector< pair< int, char >> &reservoir) |
Iterates through the pieces on a current board representation to produce the board on the console screen. More... | |
void | chessCAMO::printFooterMessage (string input_message, const Chess &chess) |
Prints the footer message before each move indicating whose move it is for the current board representation. More... | |
void | chessCAMO::drawOrResign (bool clear_screen, Chess &chess, istream &in) |
At any moment, the players can either continue, draw, or resign. More... | |
void | chessCAMO::printMessage (string text, int color) |
Prints the given message ('text') with a given 'color' to console. More... | |
void | chessCAMO::clearScreen (bool apply) |
Clears the screen of the console window using a special string instead of a platform specific command. More... | |
void | chessCAMO::saveObject (const Chess &chess_object) |
Saves an object by serializing its member fields to a text file, allowing it to later be reset. More... | |
void | chessCAMO::restoreObject (Chess &chess_object) |
De-serializes an object from a file based on the number of moves made, essentially restoring the object's saved properties (in the file). More... | |
#define GREEN 10 |
Changes console text color to green
#define CYAN 11 |
Changes console text color to cyan
#define RED 12 |
Changes console text color to red
#define PINK 13 |
Changes console text color to pink
#define YELLOW 14 |
Changes console text color to yellow
#define DEFAULT 15 |
Changes console text color to white (default)
enum pieceType |
Piece's Type.
Enumerator | |
---|---|
PAWN | 0 |
KNIGHT | 1 |
BISHOP | 2 |
ROOK | 3 |
QUEEN | 4 |
KING | 5 |
EMPTY | 6 |
enum pieceColor |