ColorShapeLinks AI
An AI competition for the IEEE Conference on Games 2021
HumanThinker Class Reference

Represents a human thinker, for testing purposes. More...

+ Inheritance diagram for HumanThinker:
+ Collaboration diagram for HumanThinker:

Public Member Functions

override string ToString ()
 Name of the human player. More...
 
FutureMove Think (Board board, CancellationToken ct)
 Perform a move. More...
 

Static Public Attributes

const string Name = "Human"
 Name of the human player. More...
 

Events

Action< string > ThinkingInfo
 Event raised when thinkers produce information while thinking. More...
 

Detailed Description

Represents a human thinker, for testing purposes.

Member Function Documentation

◆ Think()

FutureMove Think ( Board  board,
CancellationToken  ct 
)
inline

Perform a move.

Parameters
boardThe game board.
ctA cancellation token.
Returns
The move to be performed.

The main thread may ask the thinker to stop thinking. As such, this method should frequently test if a cancellation request was made to the cancellation token (ct ). If so, it should return immediately with no move performed, as exemplified in the following code:

if (ct.IsCancellationRequested) return FutureMove.NoMove;
See also
ColorShapeLinks.Common.AI.IThinker.Think
Exceptions
InvalidOperationExceptionThrown when this method is invoked.

Implements IThinker.

◆ ToString()

override string ToString ( )

Name of the human player.

Returns
The string "Human".

Member Data Documentation

◆ Name

const string Name = "Human"
static

Name of the human player.

Event Documentation

◆ ThinkingInfo

Action<string> ThinkingInfo

Event raised when thinkers produce information while thinking.

  • Listeners receive a string containing the thinking information.
  • It is not mandatory that thinkers produce any information while thinking.
See also
ColorShapeLinks.Common.AI.IThinker.ThinkingInfo

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