AIPlayerBase Class

Represents an AI player in the game. AI players pick their action using an algorithm by implementing the GetAction(GameStateGameInfo, PlayerStatePlayerInfo, ListPlayerStatePlayerInfo, TurnInfo, ActionVerifier) and GetReward(ListTetrominoShape, Puzzle) methods.

Definition

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

Constructors

AIPlayerBaseInitializes a new instance of the AIPlayerBase class

Properties

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

Methods

GetAction(GameStateGameInfo, PlayerStatePlayerInfo, TurnInfo, ActionVerifier) 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.
GetAction(GameStateGameInfo, PlayerStatePlayerInfo, ListPlayerStatePlayerInfo, TurnInfo, ActionVerifier) Implementation of an algorithm that decides the action the player wants to take based on the current game context.
GetActionAsync Asynchronously passes the parameters to GetAction(GameStateGameInfo, PlayerStatePlayerInfo, ListPlayerStatePlayerInfo, TurnInfo, ActionVerifier) and returns a Task containing the result.
(Overrides PlayerGetActionAsync(GameStateGameInfo, PlayerStatePlayerInfo, TurnInfo, ActionVerifier, CancellationToken))
GetReward Implementation of an algorithm that decides the shape the player wants as a reward for completing a puzzle.
GetRewardAsync Asynchronously passes the parameters to GetReward(ListTetrominoShape, Puzzle) and returns a Task containing the result. 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))
Init Function for initializing the AI player. This function is called once at the beginning of the game.
InitAsync Asynchronously passes the parameters to Init(Int32, ListPuzzle, String) and initializes the player. This method should be called once at the beginning of the game.

See Also