HumanPlayer Class

Represents a human player in the game. Human players pick their action using the UI.

Definition

Namespace: ProjectLCore.Players
Assembly: ProjectLCore (in ProjectLCore.dll) Version: 1.0.0+d0f5e2a7a5f4bb0431970f279d2f79d24b15d256
C#
public sealed class HumanPlayer : Player
Inheritance
Object    Player    HumanPlayer

Constructors

HumanPlayerInitializes a new instance of the HumanPlayer class

Properties

Id The unique ID of the player.
(Inherited from Player)
Name The name of the player.
(Inherited from Player)

Methods

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.

Events

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.

See Also