ColorShapeLinks
An assignment for the AI course unit of the Bachelor in Videogames at Lusófona University
|
The actual AI code of specific AIs should be placed in classes which implement this interface. More...
Public Member Functions | |
FutureMove | Think (Board board, CancellationToken ct) |
Perform a move. More... | |
The actual AI code of specific AIs should be placed in classes which implement this interface.
Definition at line 14 of file IThinker.cs.
FutureMove Think | ( | Board | board, |
CancellationToken | ct | ||
) |
Perform a move.
board | The game board. |
ct | A cancellation token. |
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:
Implemented in RandomAIThinker, SequentialAIThinker, and LoserSleeperAIThinker.