Class Test.RandomClient
java.lang.Object
edu.uky.cs.nil.tt.Client
edu.uky.cs.nil.tt.Test.RandomClient
- All Implemented Interfaces:
AutoCloseable, Callable<String>
- Enclosing class:
Test
-
Field Summary
Fields inherited from class Client
DEFAULT_PORT, DEFAULT_URL, ENVIRONMENT_VARIABLE_API_KEY, ENVIRONMENT_VARIABLE_PASSWORD -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class Client
call, close, complete, connect, embed, getChoices, getHistory, getName, getPartner, getRole, getSession, getState, getWorld, getWorldName, onClose, onConnect, onDisconnect, onEnd, onError, onStart, onStop, onUpdate, onWarning, receive, receive, send, setName, setPartner, setPassword, setRole, setWorldName, toString
-
Constructor Details
-
RandomClient
-
RandomClient
public RandomClient()
-
-
Method Details
-
onChoice
Description copied from class:ClientThis method is called each time it is this client's turn to make a choice in the story. Calls to this method will always be preceded by a call toClient.onStart(World, Role, State)if this is the start of the session orClient.onUpdate(Status)if this is not the start of the session.- Specified by:
onChoicein classClient- Parameters:
status- the current status of the story world, including thehistory of all turns so far, thecurrent stateof the world, and thelist of choicesavailable for the client to choose from- Returns:
- the index (starting at 0) of the turn this client wants to take
from the
list of choicesgiven
-