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

Implementation of an AI that will always play in sequence, from the first to the last column. It will start by spending all round pieces, and only then start using the square pieces. More...

Inheritance diagram for SequentialAIThinker:
Inheritance graph
Collaboration diagram for SequentialAIThinker:
Collaboration graph

Public Member Functions

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

Detailed Description

Implementation of an AI that will always play in sequence, from the first to the last column. It will start by spending all round pieces, and only then start using the square pieces.

Definition at line 15 of file SequentialAIThinker.cs.

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 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;
See also
IThinker.Think

Implements IThinker.

Definition at line 22 of file SequentialAIThinker.cs.


The documentation for this class 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