Choice class Getting started
A generated Choice from the story. A single ChoicePoint in the Story could potentially generate different Choices dynamically dependent on state, so they're separated.
Constructors
- Choice()
- Creates an empty choice; the story fills it in when generating choices.
Properties
- debugMetadata ↔ DebugMetadata?
-
Source location of this content, or of its nearest ancestor that has
one; null for stories compiled without debug information.
getter/setter pairinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- index ↔ int
-
The original index into currentChoices list on the Story when
this Choice was generated, for convenience.
getter/setter pair
- isInvisibleDefault ↔ bool
-
Whether this is an invisible default choice (a fallback
* ->), taken automatically when no other choice is available. Not shown inStory.currentChoices.getter/setter pair - originalThreadIndex ↔ int
-
The index of threadAtGeneration, as saved in state JSON.
getter/setter pair
- ownDebugMetadata → DebugMetadata?
-
This object's own source location, without falling back to ancestors.
no setterinherited
- parent ↔ InkObject?
-
Usually a
Container.getter/setter pairinherited - path → Path
-
The path to this object from the root of the story.
no setterinherited
- pathStringOnChoice ↔ String
-
The target path that the Story should be diverted to if
this Choice is chosen.
getter/setter pair
- rootContentContainer → Container?
-
The container at the root of this object's hierarchy, or null if the
root isn't a container.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sourcePath ↔ String
-
Get the path to the original choice point - where was this choice
defined in the story?
getter/setter pair
-
Tags written on the choice, or null if it has none.
getter/setter pair
- targetPath ↔ Path
-
The path the story diverts to when this choice is chosen.
getter/setter pair
- text ↔ String
-
The main text to presented to the player for this Choice.
getter/setter pair
- threadAtGeneration ↔ Thread?
-
A copy of the call stack thread as it was when this choice was generated;
restored when the choice is chosen.
getter/setter pair
Methods
-
clone(
) → Choice - A copy of this choice with its own copy of threadAtGeneration.
-
compactPathString(
Path otherPath) → String -
Finds the most compact representation for a path, whether relative or
global.
inherited
-
convertPathToRelative(
Path globalPath) → Path -
Converts
globalPathinto a path relative to this object, using^components to climb to the nearest shared ancestor.inherited -
copy(
) → InkObject -
A copy of this object, for the few runtime types that support it
(values and control commands); others throw UnsupportedError, as in
the reference.
inherited
-
debugLineNumberOfPath(
Path? path) → int? -
The source line number of the content at
path, if debug metadata is available; otherwise null.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
resolvePath(
Path path) → SearchResult -
Looks up the content at
path, relative to this object if the path is relative, else from the root.inherited -
toString(
) → String -
A copy of this object; throws for kinds of content that can't be copied.
The reference's default
Object.ToString(): the runtime type's full name. Most subclasses override it.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited