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})
-
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.