C# Class Ink.Runtime.StoryState

All story state information is included in the StoryState class, including global variables, read counts, the pointer to the current point in the story, the call stack (for tunnels, functions, etc), and a few other smaller bits and pieces. You can save the current state using the json serialisation functions ToJson and LoadJson.
Mostra file Open project: inkle/ink Class Usage Examples

Private Properties

Property Type Description
AddError void
CompleteExternalFunctionEvaluation object
Copy StoryState
GoToStart void
MatchRightGlueForLeftGlue Runtime.Glue
PeekEvaluationStack Runtime.Object
PopEvaluationStack List
PopEvaluationStack Runtime.Object
PushEvaluationStack void
PushToOutputStream void
ResetErrors void
ResetOutput void
SetChosenPath void
StartExternalFunctionEvaluation void
StoryState System
TryExitExternalFunctionEvaluation bool
TrySplittingHeadTailWhitespace List

Public Methods

Method Description
ForceEnd ( ) : void
LoadJson ( string json ) : void

Loads a previously saved state in JSON format.

PushToOutputStreamIndividual ( Runtime obj ) : void
RemoveExistingGlue ( ) : void
ToJson ( ) : string

Exports the current state to json format, in order to save the game.

TrimFromExistingGlue ( ) : void
TrimNewlinesFromOutputStream ( Glue rightGlueToStopAt ) : void
VisitCountAtPathString ( string pathString ) : int

Gets the visit/read count of a particular Container at the given path. For a knot or stitch, that path string will be in the form: knot knot.stitch

Private Methods

Method Description
AddError ( string message ) : void
CompleteExternalFunctionEvaluation ( ) : object
Copy ( ) : StoryState
GoToStart ( ) : void
MatchRightGlueForLeftGlue ( Glue leftGlue ) : Runtime.Glue
PeekEvaluationStack ( ) : Runtime.Object
PopEvaluationStack ( int numberOfObjects ) : List
PopEvaluationStack ( ) : Runtime.Object
PushEvaluationStack ( Runtime obj ) : void
PushToOutputStream ( Runtime obj ) : void
ResetErrors ( ) : void
ResetOutput ( ) : void
SetChosenPath ( Path path ) : void
StartExternalFunctionEvaluation ( Container funcContainer ) : void
StoryState ( Story story ) : System
TryExitExternalFunctionEvaluation ( ) : bool
TrySplittingHeadTailWhitespace ( Runtime single ) : List

Method Details

ForceEnd() public method

public ForceEnd ( ) : void
return void

LoadJson() public method

Loads a previously saved state in JSON format.
public LoadJson ( string json ) : void
json string The JSON string to load.
return void

PushToOutputStreamIndividual() public method

public PushToOutputStreamIndividual ( Runtime obj ) : void
obj Runtime
return void

RemoveExistingGlue() public method

public RemoveExistingGlue ( ) : void
return void

ToJson() public method

Exports the current state to json format, in order to save the game.
public ToJson ( ) : string
return string

TrimFromExistingGlue() public method

public TrimFromExistingGlue ( ) : void
return void

TrimNewlinesFromOutputStream() public method

public TrimNewlinesFromOutputStream ( Glue rightGlueToStopAt ) : void
rightGlueToStopAt Glue
return void

VisitCountAtPathString() public method

Gets the visit/read count of a particular Container at the given path. For a knot or stitch, that path string will be in the form: knot knot.stitch
public VisitCountAtPathString ( string pathString ) : int
pathString string The dot-separated path string of /// the specific knot or stitch.
return int