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

This class runs a game-engine independent match of ColorShapeLinks. More...

+ Inheritance diagram for MatchController:
+ Collaboration diagram for MatchController:

Public Member Functions

 MatchController (IMatchConfig matchConfig, IMatchDataProvider matchData)
 Sets up a new match. More...
 
Winner Run ()
 Runs the match. More...
 

Events

Action< IMatchConfig, IList< string > > MatchStart
 Event raised when the match is about to start. More...
 
Action< BoardBoardUpdate
 Event raised when the board is updated. More...
 
Action< PColor, string > NextTurn
 Event raised when the next turn is about to start. More...
 
Action< PColor, string, string > InvalidPlay
 Event raised when a given player performed an invalid play, for example taking too long to play, returning an invalid move or causing or throwing an exception. More...
 
Action< PColor, string, FutureMove, int > MovePerformed
 Event raised when a given player makes a move. More...
 
Action< Winner, ICollection< Pos >, IList< string > > MatchOver
 Event raised when the match is over. More...
 

Detailed Description

This class runs a game-engine independent match of ColorShapeLinks.

Constructor & Destructor Documentation

◆ MatchController()

MatchController ( IMatchConfig  matchConfig,
IMatchDataProvider  matchData 
)
inline

Sets up a new match.

Parameters
matchConfigMatch configuration.
matchDataMatch data.

Member Function Documentation

◆ Run()

Winner Run ( )
inline

Runs the match.

Returns
The match result.

Event Documentation

◆ BoardUpdate

Action<Board> BoardUpdate

Event raised when the board is updated.

See also
ColorShapeLinks.TextBased.Lib.IMatchSubject.BoardUpdate

◆ InvalidPlay

Action<PColor, string, string> InvalidPlay

Event raised when a given player performed an invalid play, for example taking too long to play, returning an invalid move or causing or throwing an exception.

  • The ColorShapeLinks.Common.PColor type parameter is the color of the player that made an invalid play.
  • The first string type parameter is the name of the player that made an invalid play.
  • The second string type parameter is the description of the invalid play.
See also
ColorShapeLinks.TextBased.Lib.IMatchSubject.InvalidPlay

◆ MatchOver

Action<Winner, ICollection<Pos>, IList<string> > MatchOver

Event raised when the match is over.

  • The ColorShapeLinks.Common.Winner type parameter contains the match result.
  • The ICollection<ColorShapeLinks.Common.Pos> type parameter contains the winning solution, if any.
  • The IList<string> type parameter contains a list of player names, with White player at index 0, and Red player at index 1.
See also
ColorShapeLinks.TextBased.Lib.IMatchSubject.MatchOver

◆ MatchStart

Action<IMatchConfig, IList<string> > MatchStart

Event raised when the match is about to start.

  • The ColorShapeLinks.Common.Session.IMatchConfig type parameter contains the match configuration.
  • The IList<string> type parameter contains a list of player names, with White player at index 0, and Red player at index 1.
See also
ColorShapeLinks.TextBased.Lib.IMatchSubject.MatchStart

◆ MovePerformed

Action<PColor, string, FutureMove, int> MovePerformed

Event raised when a given player makes a move.

See also
ColorShapeLinks.TextBased.Lib.IMatchSubject.MovePerformed

◆ NextTurn

Action<PColor, string> NextTurn

Event raised when the next turn is about to start.

  • The ColorShapeLinks.Common.PColor type parameter is the color of the player that is playing in the next turn.
  • The string type parameter is the name of the player that is playing in the next turn.
See also
ColorShapeLinks.TextBased.Lib.IMatchSubject.NextTurn

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