Class Session
java.lang.Object
edu.uky.cs.nil.tt.Session
- All Implemented Interfaces:
Duration
-
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.Nested classes/interfaces inherited from interface Duration
Duration.Adapter, Duration.Ongoing -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal TitledThe name, title, and description of the agent in the game master rolefinal TitledThe name, title, and description of the agent in the player rolefinal StringThe version number of the server that created this sessionfinal TitledWorldThe world in which the session took place -
Constructor Summary
ConstructorsConstructorDescriptionSession(TitledWorld world, Titled gm, Titled player) Constructs a new session from a story world and the names of the game master and player agents. -
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.longReturns the time this duration stopped as the number of milliseconds from the epoch (1970-01-01T00:00:00Z) in Coordinated Universal Time (UTC).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.longReturns the time this duration began as the number of milliseconds from the epoch (1970-01-01T00:00:00Z) in Coordinated Universal Time (UTC).protected voidSets the result of this session based on the message which caused the session to end.toString()Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Duration
getDuration
-
Field Details
-
version
-
world
The world in which the session took place -
gm
The name, title, and description of the agent in the game master role -
player
The name, title, and description 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, title, and description of the agent in the game master roleplayer- the name, title, and description 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-defined ending (if any) and a message explaining why the session ended
-
getStartTime
public long getStartTime()Description copied from interface:DurationReturns the time this duration began as the number of milliseconds from the epoch (1970-01-01T00:00:00Z) in Coordinated Universal Time (UTC).- Specified by:
getStartTimein interfaceDuration- Returns:
- the time this duration began
-
getEndTime
public long getEndTime()Description copied from interface:DurationReturns the time this duration stopped as the number of milliseconds from the epoch (1970-01-01T00:00:00Z) in Coordinated Universal Time (UTC).- Specified by:
getEndTimein interfaceDuration- Returns:
- the time this duration stopped
-