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

This thinker always tries to make an invalid or illogical move. Used for testing purposes only. More...

+ Inheritance diagram for BadMoveAIThinker:
+ Collaboration diagram for BadMoveAIThinker:

Public Types

enum class  BadMove {
  AboveColumn , BelowColumn , Repeat , NoMove ,
  Timeout , Uncooperative , Exception
}
 Types of invalid or illogical moves this thinker can make. More...
 

Public Member Functions

override void Setup (string str)
 Specify type of invalid move the thinker will make. More...
 
override FutureMove Think (Board board, CancellationToken ct)
 Perform a move. More...
 

Additional Inherited Members

Detailed Description

This thinker always tries to make an invalid or illogical move. Used for testing purposes only.

Member Enumeration Documentation

◆ BadMove

enum BadMove
strong

Types of invalid or illogical moves this thinker can make.

Enumerator
AboveColumn 

Place a piece on a column above the number of existing columns.

BelowColumn 

Place a piece on a column below the number of existing columns, i.e., at -1.

Repeat 

Always try to place a piece in the same column.

NoMove 

Return a FutureMove.NoMove.

Timeout 

Always terminates with a timeout.

Uncooperative 

Refuses to terminate execution.

Exception 

Throw an exception.

Member Function Documentation

◆ Setup()

override void Setup ( string  str)
inlinevirtual

Specify type of invalid move the thinker will make.

Parameters
strA string representation of BadMove values.
Exceptions
ArgumentExceptionThrown when an unknown option is given in str .
See also
AbstractThinker.Setup

Reimplemented from AbstractThinker.

◆ Think()

override FutureMove Think ( Board  board,
CancellationToken  ct 
)
inlinevirtual

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
IThinker.Think

Implements AbstractThinker.


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