public abstract class AbstractPlayer extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
AbstractPlayer.TimeoutException
An Exception thrown by
getOutputs() when the player's AI did not respond in time after an execute(). |
| Modifier and Type | Field and Description |
|---|---|
protected int |
index |
| Constructor and Description |
|---|
AbstractPlayer() |
| Modifier and Type | Method and Description |
|---|---|
void |
execute()
Executes the player for a maximum of turnMaxTime milliseconds and store the output.
|
String |
getAvatarToken()
Returns a string that will be converted into the real avatar by the viewer, if it exists.
|
abstract int |
getExpectedOutputLines()
Returns the number of lines that the player must return.
|
String |
getNicknameToken()
Returns a string that will be converted into the real nickname by the viewer.
|
List<String> |
getOutputs()
Gets the output obtained after an execution.
|
void |
sendInputLine(String line)
Adds a new line to the input to send to the player on execute.
|
public final String getNicknameToken()
public final String getAvatarToken()
public final void sendInputLine(String line)
line - The input to send.public final void execute()
public final List<String> getOutputs() throws AbstractPlayer.TimeoutException
AbstractPlayer.TimeoutException - if the player's AI crashes or stops respondingpublic abstract int getExpectedOutputLines()
Copyright © 2018. All rights reserved.