Session class final

One story being played.

Every verb answers the effects it led to, in the order they are applied, the Turn last. One caller at a time. Disposing frees it at once; a session that is never disposed is freed when it is collected.

Implemented types

Constructors

Session.create(Campaign campaign, SessionConfig config)
A new session over campaign, before its first turn: start it next.
factory
Session.resume(Campaign campaign, String save, {int seed = 0, SessionOptions? options})
A session picking up a save — JSON text, as pause or checkpoint answered it — over the same campaign; start it next.
factory

Properties

ambience → Ambience?
no setter
board → int
The board the story is on, by index into the manifest's boards.
no setter
cvars → List<CvarSnapshot>
no setter
defaultLocale → String
no setter
entities → List<Entity>
no setter
generator ↔ Generator
The dice's state; set it on a resumed session for the dice to run on.
getter/setter pair
guard → GuardReport
no setter
handle → Pointer<RippleSession>
The engine's handle, for a call this binding does not wrap.
no setter
hashCode → int
The hash code for this object.
no setterinherited
locale → String
no setter
memory → Memory
no setter
pythonAvailable → bool
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

answer(Map<String, Value>? fields) → List<Effect>
Answers the form showing, field by field in the order given — or, with null, the reader leaves it.
checkpoint() → String?
A save of the turn the story is on, without stopping it; null when there is nothing to save.
choose(int index) → List<Effect>
Takes the choice at index among those the passage offers.
consoleFeed(String code) → ConsoleResult
Runs a line of Python in the story's interpreter, as the editor's console does.
describeCvarWrite(String name, Value value) → String?
Why writing value to the cvar would be refused; null when it would not.
dispose() → void
Frees the session now; anything else on it throws a StateError.
elapsed() → List<Effect>
Answers a wait, once the host's clock says it is over.
leave() → List<Effect>
The reader leaves the passage without choosing.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pause() → Paused
Puts the story down: its save, and what pausing did.
removeEntity(String key) → EntityRemoval
resetAllCvars() → List<Effect>
resetCvar(String name) → CvarChange
restart() → List<Effect>
setLocale(String locale) → List<Effect>
setTrace(bool enabled) → void
setTracePayloads(bool enabled) → void
start() → List<Effect>
Steps the story to its first turn — or, resumed, back to the turn it was saved on.
stop() → List<Effect>
toString() → String
A string representation of this object.
inherited
writeCvar(String name, Value value) → CvarChange

Operators

operator ==(Object other) → bool
The equality operator.
inherited