inkcpp
Loading...
Searching...
No Matches
HInkStory Class Reference

Handle for a loaded ink story. More...

#include <inkcpp.h>

Public Member Functions

HInkStoryink_story_from_file (const char *filename)
 Creates a new story object from a file.
 
void ink_story_delete (HInkStory *self)
 deletes a story and all assoziated resources
 
HInkGlobalsink_story_new_globals (HInkStory *self)
 Creates a new global store.
 
HInkRunnerink_story_new_runner (HInkStory *self, HInkGlobals *store)
 Creates a new runner.
 
HInkGlobalsink_story_new_globals_from_snapshot (HInkStory *self, const HInkSnapshot *obj)
 Reconstructs globals from snapshot.
 
HInkRunnerink_story_new_runner_from_snapshot (HInkStory *self, const HInkSnapshot *obj, HInkGlobals *store, int runner_id)
 reconstruct runner from a snapshot
 

Detailed Description

Handle for a loaded ink story.

Created by loading a binary ink story into memory. Once loaded, the story class can create "runners" which execute story code. A story can have any number of runners, which can optionally share globals (variables, visit counts, etc). through the globals object. By default, each runner gets its own newly created globals store.

See also
ink::runtime::runner_interface
ink::runtime::globals_interface
HInkGlobals
HInkRunner

Member Function Documentation

◆ ink_story_delete()

void ink_story_delete ( HInkStory * self)

deletes a story and all assoziated resources

Parameters
self
Attention
this will invalidate all HInkRunner and HInkGlobals handles assoziated with this story

◆ ink_story_from_file()

HInkStory * ink_story_from_file ( const char * filename)

Creates a new story object from a file.

Requires STL or other extension which allows files to be loaded and read. Will allocate all the data necessary to load the file and close it.

Parameters
filenamefilename of the binary ink data
Returns
new story object

◆ ink_story_new_globals()

HInkGlobals * ink_story_new_globals ( HInkStory * self)

Creates a new global store.

Creates a new global store that can be passed in when creating new runners for this story. Note: Can not be used for other stories. It is tied to this story.

Returns
managed pointer to a new global store
Parameters
self

◆ ink_story_new_globals_from_snapshot()

HInkGlobals * ink_story_new_globals_from_snapshot ( HInkStory * self,
const HInkSnapshot * obj )

Reconstructs globals from snapshot.

Parameters
objsnapshot to load
self

◆ ink_story_new_runner()

HInkRunner * ink_story_new_runner ( HInkStory * self,
HInkGlobals * store )

Creates a new runner.

Creates a new runner whose initial instruction pointer is the first instruction in this story. If no global store is passed, a new one will be created for the runner.

Parameters
storeglobals to use for the runner
Returns
managed pointer to a new runner
Parameters
self

◆ ink_story_new_runner_from_snapshot()

HInkRunner * ink_story_new_runner_from_snapshot ( HInkStory * self,
const HInkSnapshot * obj,
HInkGlobals * store,
int runner_id )

reconstruct runner from a snapshot

Attention
runner must be snap_shotted from the same story
if globals is explicit set, make sure the globals are from the same snapshot as
if you snap_shotted a multiple runner with shared global please reconstruct it in the same fashion
Parameters
obj
storecan be set if explicit access to globals is required or multiple runner with a shared global are used
runner_idif the snapshot was of a multiple runner one global situation load first the global, and then each runner with global set and increasing idx
self

The documentation for this class was generated from the following file: