HumanPlayerGetRewardAsync Method

Creates a new TaskCompletionSourceTResult for TetrominoShape and asynchronously waits until it is set by calling the SetReward(TetrominoShape) method. Note that the player doesn't get the current game context here. This is because this function will be called right after he completes a puzzle and therefore he knows the current game state from the last GetActionAsync(GameStateGameInfo, PlayerStatePlayerInfo, TurnInfo, ActionVerifier, CancellationToken) call.

Definition

Namespace: ProjectLCore.Players
Assembly: ProjectLCore (in ProjectLCore.dll) Version: 1.0.0+d0f5e2a7a5f4bb0431970f279d2f79d24b15d256
C#
public override Task<TetrominoShape> GetRewardAsync(
	List<TetrominoShape> rewardOptions,
	Puzzle puzzle,
	CancellationToken cancellationToken = default
)

Parameters

rewardOptions  ListTetrominoShape
The reward options.
puzzle  Puzzle
The puzzle that was completed.
cancellationToken  CancellationToken  (Optional)
A cancellation token to observe while waiting for the task to complete.

Return Value

TaskTetrominoShape
The shape the player wants to take.

Exceptions

OperationCanceledExceptionThe task was canceled.

See Also