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

Controls a session of ColorShapeLinks matches. More...

+ Inheritance diagram for SessionController:
+ Collaboration diagram for SessionController:

Public Member Functions

 SessionController (IMatchConfig matchConfig, ISessionConfig sessionConfig, IEnumerable< IThinkerPrototype > thinkerPrototypes, IEnumerable< IThinkerListener > thinkerListeners, IEnumerable< IMatchListener > matchListeners, IEnumerable< ISessionListener > sessionListeners)
 Create a new session controller. More...
 
ExitStatus Run (bool complete)
 Run a session of ColorShapeLinks matches. More...
 
IThinker GetThinker (PColor thinkerColor)
 Get thinker of the specified color. More...
 

Properties

Board Board [get]
 The game board. More...
 
IThinker CurrentThinker [get]
 The current thinker. More...
 
SessionState State [get]
 State of the current session. More...
 
ISessionConfig SessionConfig [get]
 Session configuration. More...
 
IMatchConfig MatchConfig [get]
 Match configuration. More...
 
Match CurrentMatch [get]
 The match currently being played. More...
 
IEnumerable< MatchMatches [get]
 All matches played or to be played in current session. More...
 
IEnumerable< KeyValuePair< Match, Winner > > Results [get]
 Results of matches played so far in current session. More...
 
IEnumerable< KeyValuePair< string, int > > Standings [get]
 Standings (classification, ranking) of thinkers in current session. More...
 
Winner LastMatchResult [get]
 Result of last match. More...
 
string WinnerString [get]
 The winner's name and color. More...
 

Events

Action< ISessionDataProviderBeforeSession
 Event raised when the session is about to start. More...
 
Action< ISessionDataProviderAfterSession
 Event raised when the session is over. More...
 
Action< MatchBeforeMatch
 Event raised before a match starts in the context of a session. More...
 
Action< Match, ISessionDataProviderAfterMatch
 Event raised after a match takes place in the context of a session. More...
 

Detailed Description

Controls a session of ColorShapeLinks matches.

Constructor & Destructor Documentation

◆ SessionController()

SessionController ( IMatchConfig  matchConfig,
ISessionConfig  sessionConfig,
IEnumerable< IThinkerPrototype thinkerPrototypes,
IEnumerable< IThinkerListener thinkerListeners,
IEnumerable< IMatchListener matchListeners,
IEnumerable< ISessionListener sessionListeners 
)
inline

Create a new session controller.

Parameters
matchConfigMatch configuration.
sessionConfigSession configuration.
thinkerPrototypesList of thinker prototypes for thinkers participating in this session.
thinkerListenersList of thinker listeners.
matchListenersList of match listeners.
sessionListenersList of session listeners.

Member Function Documentation

◆ GetThinker()

IThinker GetThinker ( PColor  thinkerColor)

Get thinker of the specified color.

Parameters
thinkerColorColor of the thinker to get.
Returns
Thinker of the specified color.
See also
ColorShapeLinks.Common.Session.IMatchDataProvider.GetThinker

Implements IMatchDataProvider.

◆ Run()

ExitStatus Run ( bool  complete)
inline

Run a session of ColorShapeLinks matches.

Parameters
completeIs the session complete, i.e., should thinkers compete against each other two times, home and away?
Returns
An exit status according to what is defined in ExitStatus.

Property Documentation

◆ Board

Board Board
get

The game board.

The game board.

See also
ColorShapeLinks.Common.Session.IMatchDataProvider.Board

◆ CurrentMatch

Match CurrentMatch
get

The match currently being played.

See also
ColorShapeLinks.Common.Session.ISessionDataProvider.CurrentMatch

◆ CurrentThinker

IThinker CurrentThinker
get

The current thinker.

The current thinker.

See also
ColorShapeLinks.Common.Session.IMatchDataProvider.CurrentThinker

◆ LastMatchResult

Winner LastMatchResult
get

Result of last match.

One of the values of the Winner enumeration.

See also
ColorShapeLinks.Common.Session.ISessionDataProvider.LastMatchResult

◆ MatchConfig

Match configuration.

Match configuration consists of number of board rows and columns, how many pieces in a row to win, initial number of pieces, etc.

See also
ColorShapeLinks.Common.Session.ISessionDataProvider.MatchConfig

◆ Matches

IEnumerable<Match> Matches
get

All matches played or to be played in current session.

Collection of matches.

See also
ColorShapeLinks.Common.Session.ISessionDataProvider.Matches

◆ Results

IEnumerable<KeyValuePair<Match, Winner> > Results
get

Results of matches played so far in current session.

Collection of match-winner pairs.

See also
ColorShapeLinks.Common.Session.ISessionDataProvider.Results

◆ SessionConfig

ISessionConfig SessionConfig
get

Session configuration.

Session configuration consists of points per win, per loss and per draw.

See also
ColorShapeLinks.Common.Session.ISessionDataProvider.SessionConfig

◆ Standings

IEnumerable<KeyValuePair<string, int> > Standings
get

Standings (classification, ranking) of thinkers in current session.

Descending ordered collection of thinker-points pairs.

See also
ColorShapeLinks.Common.Session.ISessionDataProvider.Standings

◆ State

SessionState State
get

State of the current session.

One of the values defined in the SessionState enumeration.

See also
ColorShapeLinks.Common.Session.ISessionDataProvider.State
Exceptions
System.NotImplementedExceptionAlways thrown, since this implementation doesn't track an explicit session state.

◆ WinnerString

string WinnerString
get

The winner's name and color.

A string containing the winner's name and color.

See also
ColorShapeLinks.Common.Session.ISessionDataProvider.WinnerString

Event Documentation

◆ AfterMatch

Action<Match, ISessionDataProvider> AfterMatch

Event raised after a match takes place in the context of a session.

  • The Match type parameter provides information about the match that just finished.
  • The ISessionDataProvider type parameter provides data about the current state of the session.
See also
ColorShapeLinks.TextBased.Lib.ISessionSubject.AfterMatch

◆ AfterSession

Action<ISessionDataProvider> AfterSession

Event raised when the session is over.

  • The ISessionDataProvider type parameter provides data about the finished session.
See also
ColorShapeLinks.TextBased.Lib.ISessionSubject.AfterSession

◆ BeforeMatch

Action<Match> BeforeMatch

Event raised before a match starts in the context of a session.

  • The Match type parameter provides information about the match that is about to start.
See also
ColorShapeLinks.TextBased.Lib.ISessionSubject.BeforeMatch

◆ BeforeSession

Action<ISessionDataProvider> BeforeSession

Event raised when the session is about to start.

  • The ISessionDataProvider type parameter provides data about the session that is about to start.
See also
ColorShapeLinks.TextBased.Lib.ISessionSubject.BeforeSession

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