Chess Game  1.1.0
A full chess game for Unity
cgEngine Class Reference

The AI Opponent More...

Public Member Functions

 cgEngine (byte searchDepthWeak=3, byte searchDepthStrong=4)
 
void makeMove (cgBoard board, bool MoveAsWhiteP, Action< List< cgSimpleMove >> completeCallback, Action< float > progressCallback=null)
 Called when the engine should generate a new move. More...
 
void TellLegals (bool p)
 

Public Attributes

bool MoveAsWhite = true
 Should a move for white(true) or black(false) be generated? More...
 
bool Finished = false
 Has the engine finished analyzing moves? More...
 
byte SearchDepthWeak = 4
 How deep should the engine search seemingly weak move? More...
 
byte SearchDepthStrong = 4
 How deep should the engine search a seemingly strong move? More...
 
byte SearchDepthEndGame =4
 How deep should the engine search when the number of possible moves are low(i.e. lategame or king checked situations). More...
 
int BoardStatesExamined = 0
 How many board states have been examined More...
 
int CurrentBoardValue = 0
 The current value of the board. More...
 
List< cgSimpleMoveMoves
 All legal moves being analyzed. More...
 
int MovesLeftToAnalyze = 0
 How many moves are left to analyze. More...
 
int TotalMovesToAnalyze = 0
 How many moves in total have to be analyzed. More...
 

Detailed Description

The AI Opponent

Member Function Documentation

◆ makeMove()

void cgEngine.makeMove ( cgBoard  board,
bool  MoveAsWhiteP,
Action< List< cgSimpleMove >>  completeCallback,
Action< float >  progressCallback = null 
)

Called when the engine should generate a new move.

Parameters
boardThe current board state.
MoveAsWhitePMove as white(true) or black(false).
completeCallbackWhere the prefered move will be returned.

Member Data Documentation

◆ BoardStatesExamined

int cgEngine.BoardStatesExamined = 0

How many board states have been examined

◆ CurrentBoardValue

int cgEngine.CurrentBoardValue = 0

The current value of the board.

◆ Finished

bool cgEngine.Finished = false

Has the engine finished analyzing moves?

◆ MoveAsWhite

bool cgEngine.MoveAsWhite = true

Should a move for white(true) or black(false) be generated?

◆ Moves

List<cgSimpleMove> cgEngine.Moves

All legal moves being analyzed.

◆ MovesLeftToAnalyze

int cgEngine.MovesLeftToAnalyze = 0

How many moves are left to analyze.

◆ SearchDepthEndGame

byte cgEngine.SearchDepthEndGame =4

How deep should the engine search when the number of possible moves are low(i.e. lategame or king checked situations).

◆ SearchDepthStrong

byte cgEngine.SearchDepthStrong = 4

How deep should the engine search a seemingly strong move?

◆ SearchDepthWeak

byte cgEngine.SearchDepthWeak = 4

How deep should the engine search seemingly weak move?

◆ TotalMovesToAnalyze

int cgEngine.TotalMovesToAnalyze = 0

How many moves in total have to be analyzed.


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