ColorShapeLinks
An assignment for the AI course unit of the Bachelor in Videogames at Lusófona University
IThinker Interface Reference

The actual AI code of specific AIs should be placed in classes which implement this interface. More...

Inheritance diagram for IThinker:
Inheritance graph
Collaboration diagram for IThinker:
Collaboration graph

Public Member Functions

FutureMove Think (Board board, CancellationToken ct)
 Perform a move. More...
 

Detailed Description

The actual AI code of specific AIs should be placed in classes which implement this interface.

Definition at line 14 of file IThinker.cs.

Member Function Documentation

◆ Think()

FutureMove Think ( Board  board,
CancellationToken  ct 
)

Perform a move.

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

The main thread may ask the AI 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;

Implemented in RandomAIThinker, SequentialAIThinker, and LoserSleeperAIThinker.


The documentation for this interface was generated from the following file:
FutureMove.NoMove
static FutureMove NoMove
Represent a "no move" decision, when an IA is unable to decide which move to perform,...
Definition: FutureMove.cs:28
FutureMove
Represents a move to be performed in the future.
Definition: FutureMove.cs:11