AIPlayerBaseGetAction(GameStateGameInfo, PlayerStatePlayerInfo, TurnInfo, ActionVerifier) Method

Passes the parameters to GetAction(GameStateGameInfo, PlayerStatePlayerInfo, ListPlayerStatePlayerInfo, TurnInfo, ActionVerifier) and returns the result. This method should be called only after InitAsync(Int32, ListPuzzle, String, CancellationToken) has been called and finished running.

Definition

Namespace: ProjectLCore.Players
Assembly: ProjectLCore (in ProjectLCore.dll) Version: 1.0.0+d0f5e2a7a5f4bb0431970f279d2f79d24b15d256
C#
public GameAction GetAction(
	GameStateGameInfo gameInfo,
	PlayerStatePlayerInfo[] playerInfos,
	TurnInfo turnInfo,
	ActionVerifier verifier
)

Parameters

gameInfo  GameStateGameInfo
Information about the shared resources.
playerInfos  PlayerStatePlayerInfo
Information about the resources of the players.
turnInfo  TurnInfo
Information about the current turn.
verifier  ActionVerifier
Verifier for verifying the validity of actions in the current game context.

Return Value

GameAction
The action the player wants to take.

Remarks

This method should be used for training AI players as it doesn't come with the async performance overhead of GetActionAsync(GameStateGameInfo, PlayerStatePlayerInfo, TurnInfo, ActionVerifier, CancellationToken). It also shouldn't be used outside of CLI applications as it will block the main thread until GetAction(GameStateGameInfo, PlayerStatePlayerInfo, ListPlayerStatePlayerInfo, TurnInfo, ActionVerifier) returns.

Exceptions

ArgumentExceptionPlayerState matching this player's Id not found in playerInfos.
PlayerNotInitializedExceptionThe player has not been initialized yet.

See Also