Class GameManager
- Namespace
- WeiqiSharp.Core
- Assembly
- WeiqiSharp.Core.dll
public class GameManager
- Inheritance
-
GameManager
- Inherited Members
Constructors
GameManager(Game, IAgent, IAgent, int)
public GameManager(Game game, IAgent blackPlayer, IAgent whitePlayer, int maxRetries = -1)
Parameters
gameGameThe Game which will be managed.
blackPlayerIAgentAn IAgent representing the player of the black stones.
whitePlayerIAgentAn IAgent representing the player of the white stones.
maxRetriesintThe number of times an agent is allowed to retry invalid moves.
Properties
BlackScore
The total number of white stones captured by the black player.
public int BlackScore { get; }
Property Value
BoardState
The board in terms of SpaceState.
public SpaceState[,] BoardState { get; }
Property Value
- SpaceState[,]
WhiteScore
The total number of black stones captured by the white player.
public int WhiteScore { get; }
Property Value
WhoseTurn
Which color should be next to move.
public SpaceState WhoseTurn { get; }
Property Value
Methods
DoMove()
Triggers the IAgent whose turn it is to produce a move.
public bool DoMove()
Returns
- bool
trueif the move was legal and resulted in a change to the state,falseotherwise.
Exceptions
- GameManagerException
This will be thrown if a move was attempted by an IAgent whose turn it was not, or if said agent was unable to produce a legal move in fewer than maxRetries tries.