AIPlayerBaseGetActionAsync Method

Asynchronously passes the parameters to GetAction(GameStateGameInfo, PlayerStatePlayerInfo, ListPlayerStatePlayerInfo, TurnInfo, ActionVerifier) and returns a Task containing the result.

Definition

Namespace: ProjectLCore.Players
Assembly: ProjectLCore (in ProjectLCore.dll) Version: 1.0.0+d0f5e2a7a5f4bb0431970f279d2f79d24b15d256
C#
public override sealed Task<GameAction> GetActionAsync(
	GameStateGameInfo gameInfo,
	PlayerStatePlayerInfo[] playerInfos,
	TurnInfo turnInfo,
	ActionVerifier verifier,
	CancellationToken cancellationToken = default
)

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.
cancellationToken  CancellationToken  (Optional)
A cancellation token to observe while waiting for the task to complete.

Return Value

TaskGameAction
A task representing the action the player wants to take.

Remarks

This methods asynchronously waits for initialization of the AI player. It will not return until InitAsync(Int32, ListPuzzle, String, CancellationToken) is called and finished running.

Exceptions

ArgumentExceptionPlayerState matching this player's Id not found in playerInfos.
OperationCanceledExceptionThe task was canceled.

See Also