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

Implementation of an AI that will play randomly. More...

Inheritance diagram for RandomAIThinker:
Inheritance graph
Collaboration diagram for RandomAIThinker:
Collaboration graph

Public Member Functions

 RandomAIThinker ()
 Create a new instance of RandomIAThinker. More...
 
FutureMove Think (Board board, CancellationToken ct)
 Perform a move. More...
 

Detailed Description

Implementation of an AI that will play randomly.

Definition at line 14 of file RandomAIThinker.cs.

Constructor & Destructor Documentation

◆ RandomAIThinker()

RandomAIThinker ( )
inline

Create a new instance of RandomIAThinker.

Definition at line 22 of file RandomAIThinker.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 29 of file RandomAIThinker.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