ChineseCheckers
This project is a solver for two players' Chinese Checkers game using the Alpha Beta pruning algorithm. The program is written in C++ and uses a number of heuristics to improve the performance of the algorithm. Overall, the Chinese Checkers solver program has been built with performance in mind, and is designed to deliver fast and efficient game play. Whether you are playing against a bot or using the program as a library in your own project, you can be confident that the program will deliver high-performance results.
Loading...
Searching...
No Matches
GamePlayer Class Reference

This class simulates a game between two solvers. More...

#include <tournament.hpp>

Public Member Functions

 GamePlayer ()
 Default constructor.
 
 GamePlayer (int depth_)
 A constructor used to set a custom depth.
 
 GamePlayer (SolversIndividuals &solver1, SolversIndividuals &solver2, int depth_=1)
 A constructor used to set custom solvers and a custom depth.
 
double playGame ()
 Member used to simulate a game between white_player and black_player.
 
void set_white_player (SolversIndividuals &solver)
 Sets white_player.
 
void set_black_player (SolversIndividuals &solver)
 Sets black_player.
 
void set_depth (const int &depth_)
 Sets depth.
 
void print_players_info ()
 Prints information on the players.
 
int constructor_test ()
 Debug function used to test the constructors.
 

Private Attributes

AlphaBeta white_player
 A solver using AlphaBeta.
 
AlphaBeta black_player
 A solver using AlphaBeta.
 
int depth
 The depth AlphaBeta will use.
 

Detailed Description

This class simulates a game between two solvers.

Constructor & Destructor Documentation

◆ GamePlayer() [1/3]

GamePlayer::GamePlayer ( )

Default constructor.

◆ GamePlayer() [2/3]

GamePlayer::GamePlayer ( int  depth_)

A constructor used to set a custom depth.

◆ GamePlayer() [3/3]

GamePlayer::GamePlayer ( SolversIndividuals solver1,
SolversIndividuals solver2,
int  depth_ = 1 
)

A constructor used to set custom solvers and a custom depth.

Member Function Documentation

◆ constructor_test()

int GamePlayer::constructor_test ( )

Debug function used to test the constructors.

◆ playGame()

double GamePlayer::playGame ( )

Member used to simulate a game between white_player and black_player.

◆ print_players_info()

void GamePlayer::print_players_info ( )

Prints information on the players.

◆ set_black_player()

void GamePlayer::set_black_player ( SolversIndividuals solver)

Sets black_player.

Parameters
solverThe solver to set.
See also
set_white_player
set_depth

◆ set_depth()

void GamePlayer::set_depth ( const int &  depth_)

Sets depth.

Parameters
depth_The depth to set.
See also
set_white_player
set_black_player

◆ set_white_player()

void GamePlayer::set_white_player ( SolversIndividuals solver)

Sets white_player.

Parameters
solverThe solver to set.
See also
set_black_player
set_depth

Member Data Documentation

◆ black_player

AlphaBeta GamePlayer::black_player
private

A solver using AlphaBeta.

◆ depth

int GamePlayer::depth
private

The depth AlphaBeta will use.

◆ white_player

AlphaBeta GamePlayer::white_player
private

A solver using AlphaBeta.


The documentation for this class was generated from the following files: