Table of Contents

Class GameManager

Namespace
WeiqiSharp.Core
Assembly
WeiqiSharp.Core.dll

In charge of providing Moves from IAgents to a Game instance.

public class GameManager
Inheritance
GameManager
Inherited Members

Constructors

GameManager(Game, IAgent, IAgent, int)

In charge of providing Moves from IAgents to a Game instance.

public GameManager(Game game, IAgent blackPlayer, IAgent whitePlayer, int maxRetries = -1)

Parameters

game Game

The Game which will be managed.

blackPlayer IAgent

An IAgent representing the player of the black stones.

whitePlayer IAgent

An IAgent representing the player of the white stones.

maxRetries int

The 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

int

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

int

WhoseTurn

Which color should be next to move.

public SpaceState WhoseTurn { get; }

Property Value

SpaceState

Methods

DoMove()

Triggers the IAgent whose turn it is to produce a move.

public bool DoMove()

Returns

bool

true if the move was legal and resulted in a change to the state, false otherwise.

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.