Class Session
java.lang.Object
edu.uky.cs.nil.tt.Session
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classAn event represents a singleturnduring a storytelling session as well as the actual state of the story world after the turn and the state of the world as perceived by the player.static classA report occurs when one participant in a session sends their response to a question about the narrative.static classA result explains how the session ended.static classA timestamped object records the moment at which it was created. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidAdds a new report to this session, which records a response by one of the participants to a rating or survey question about the story.protected voidAdds a new event to this session, which records a turn in the story, the actual and player perceived states after that turn, and the time it occurred.static voidconfigure(com.google.gson.GsonBuilder builder) Configures aGsonBuilderto encode and decode session objects.Returns an unmodifiable list of all eventsappendedto this session so far.Returns an unmodifiable list of all reportsappendedto this session so far.Returns the result of this session, or null if this session does not yet have a result.protected voidSets the result of this session based on the message which caused the session to end.toString()
-
Field Details
-
world
The world in which the session took place -
gm
The system name of the agent in the game master role -
player
The system name of the agent in the player role
-
-
Constructor Details
-
Session
Constructs a new session from a story world and the names of the game master and player agents.- Parameters:
world- the story world in which the session will take placegm- the name of the agent in the game mast roleplayer- the name of the agent in the player role
-
-
Method Details
-
configure
public static void configure(com.google.gson.GsonBuilder builder) Configures aGsonBuilderto encode and decode session objects.- Parameters:
builder- the GSON builder to configure
-
toString
-
getEvents
Returns an unmodifiable list of all eventsappendedto this session so far.- Returns:
- a list of this session's events
-
getReports
Returns an unmodifiable list of all reportsappendedto this session so far.- Returns:
- a list of this session's reports
-
getResult
Returns the result of this session, or null if this session does not yet have a result.- Returns:
- this session's result
-
append
Adds a new event to this session, which records a turn in the story, the actual and player perceived states after that turn, and the time it occurred.- Parameters:
turn- a turn in the storyactual- the actual state of the story world after the turnperceived- the state of the story world as perceived by the player after the turn
-
append
Adds a new report to this session, which records a response by one of the participants to a rating or survey question about the story.- Parameters:
role- the role who sent the reportreport- the message that contains the item, value, and comment of the report
-
setResult
Sets the result of this session based on the message which caused the session to end.- Parameters:
stop- the message which caused the session to end and which contains the pre-definded ending (if any) and a message explaining why the session ended
-