public sealed class HumanPlayer : Player
HumanPlayer | Initializes a new instance of the HumanPlayer class |
Id |
The unique ID of the player.
(Inherited from Player) |
Name |
The name of the player.
(Inherited from Player) |
GetActionAsync |
Creates a new TaskCompletionSourceTResult for GameAction and asynchronously waits until it is set by calling the SetAction(GameAction) method.
(Overrides PlayerGetActionAsync(GameStateGameInfo, PlayerStatePlayerInfo, TurnInfo, ActionVerifier, CancellationToken)) |
GetRewardAsync |
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.
(Overrides PlayerGetRewardAsync(ListTetrominoShape, Puzzle, CancellationToken)) |
SetAction | Sets the next action the player wants to take. This method should be called after the player has made a decision through the UI. |
SetReward | Sets the reward the player wants to get. This method should be called after the player has made a decision through the UI. |
ActionRequested | Occurs when the player is requested to provide an action during their turn. |
RewardChoiceRequested | Occurs when the player is requested to select a reward after completing a puzzle. |