Class AI
This is where you build your AI for Chess.
Inherited Members
Namespace: Joueur.cs.Games.Chess
Assembly: joueur-cs.dll
Syntax
public class AI : BaseAI
Fields
Game
This is the Game object itself. It contains all the information about the current game.
Declaration
public readonly Game Game
Field Value
Type | Description |
---|---|
Game |
Player
This is your AI's player. It contains all the information about your player's state.
Declaration
public readonly Player Player
Field Value
Type | Description |
---|---|
Player |
Methods
Ended(Boolean, String)
This is automatically called when the game ends.
Declaration
public override void Ended(bool won, string reason)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | won | True if your player won, false otherwise |
System.String | reason | A string explaining why you won or lost |
Overrides
Remarks
You can do any cleanup of you AI here, or do custom logging. After this function returns, the application will close.
GameUpdated()
This is automatically called every time the game (or anything in it) updates.
Declaration
public override void GameUpdated()
Overrides
Remarks
If a function you call triggers an update, this will be called before that function returns.
GetName()
This returns your AI's name to the game server. Just replace the string.
Declaration
public override string GetName()
Returns
Type | Description |
---|---|
System.String | Your AI's name |
Overrides
MakeMove()
This is called every time it is this AI.player's turn to make a move.
Declaration
public string MakeMove()
Returns
Type | Description |
---|---|
System.String | A string in Universal Chess Interface (UCI) or Standard Algebraic Notation (SAN) formatting for the move you want to make. If the move is invalid or not properly formatted you will lose the game. |
Start()
This is automatically called when the game first starts, once the Game and all GameObjects have been initialized, but before any players do anything.
Declaration
public override void Start()
Overrides
Remarks
This is a good place to initialize any variables you add to your AI or start tracking game objects.