NovelStateSnapshot class

Constructors

NovelStateSnapshot.new({required String sceneId, required Map<String, dynamic> variables, required List<Verse> verseHistory, required Tree tree, required AudioManager audio, required Preferences preferences, String? lastScene, bool isTerminator = false, bool shouldAutosave = true, bool isSkippable = true})

Properties

audio AudioManager
Should have a reference to the current AudioManager here to maintain audio between states.
final
hashCode int
The hash code for this object.
no setterinherited
isSkippable bool
Will mark the scene as 'visited', therefore it can be skipped through.
final
isTerminator bool
Will cause exit from scenes tree if this is true.
final
lastScene String?
final
preferences Preferences
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sceneId String
final
shouldAutosave bool
Will not affect autosaving if this is false.
final
tree Tree
final
variables Map<String, dynamic>
final
verseHistory List<Verse>
final

Methods

copyWith({String? sceneId, String? lastScene, Map<String, dynamic>? variables, List<Verse>? verseHistory, Tree? tree, AudioManager? audio, Preferences? preferences, bool? isTerminator, bool? shouldAutosave, bool? isSkippable}) NovelStateSnapshot
doNotMarkVisited() NovelStateSnapshot
Makes this NovelStateSnapshot not affect the list of visited scenes. This behavior will not persist through the next states.
doNotSave() NovelStateSnapshot
Makes this NovelStateSnapshot not affect the saves. This behavior will not persist through the next states.
getData(String key) Object?
Return a data binded with a key from the global state if such a key exists. Otherwise returns null.
loadScene(String sceneId) NovelStateSnapshot
Seeks a scene with sceneId in the Tree, then makes it the next one.
logVerses(List<Verse> verses) NovelStateSnapshot
Adds all the verses from current scene to the history log.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeData(String key) NovelStateSnapshot
setData(String key, Object value) NovelStateSnapshot
Binds provided value with key. Value object must be json-encodable.
terminate() NovelStateSnapshot
Makes this NovelStateSnapshot a terminator. It will cause the novel to call onExit() callback.
toString() String
A string representation of this object.
inherited
updatePreferences(Preferences preferences) NovelStateSnapshot
Updates Preferences according to the provided changes.

Operators

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