Package com.codingame.gameengine.core
Class AbstractMultiplayerPlayer
java.lang.Object
com.codingame.gameengine.core.AbstractPlayer
com.codingame.gameengine.core.AbstractMultiplayerPlayer
The representation of a player's AI during the game's execution.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.codingame.gameengine.core.AbstractPlayer
AbstractPlayer.TimeoutException
-
Field Summary
Fields inherited from class com.codingame.gameengine.core.AbstractPlayer
index
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal void
Deactivate a player.final void
deactivate
(String reason) Deactivate a player and adds a tooltip with the reason.final int
Returns an integer that will be converted into the player's real color by the viewer.final int
getIndex()
Get player index from 0 (included) to number of players (excluded).final int
getScore()
Get current score.final boolean
isActive()
Returns true is the player is still active in the game (can be executed).final void
setScore
(int score) Set current score.Methods inherited from class com.codingame.gameengine.core.AbstractPlayer
execute, getAvatarToken, getExpectedOutputLines, getNicknameToken, getOutputs, sendInputLine
-
Constructor Details
-
AbstractMultiplayerPlayer
public AbstractMultiplayerPlayer()
-
-
Method Details
-
getColorToken
public final int getColorToken()Returns an integer that will be converted into the player's real color by the viewer.- Returns:
- the player's color token.
-
isActive
public final boolean isActive()Returns true is the player is still active in the game (can be executed).- Returns:
- true is the player is active.
-
getIndex
public final int getIndex()Get player index from 0 (included) to number of players (excluded).- Returns:
- the player index.
-
getScore
public final int getScore()Get current score.- Returns:
- current player score
-
setScore
public final void setScore(int score) Set current score. This is used to rank the players at the end of the game.- Parameters:
score
- current player score
-
deactivate
public final void deactivate()Deactivate a player. The player can't play after this and is no longer in the list of active players. -
deactivate
Deactivate a player and adds a tooltip with the reason. The player can't play after this and is no longer in the list of active players.- Parameters:
reason
- Message to display in the tooltip.
-