13typedef struct InkFlag InkFlag;
133 void ink_list_add(
HInkList* self,
const char* flag_name);
134 void ink_list_remove(
HInkList* self,
const char* flag_name);
135 int ink_list_contains(
const HInkList* self,
const char* flag_name);
208 typedef void (*InkExternalFunctionVoid)(
int argc,
const InkValue argv[]);
386 ink_compile_json(
const char* input_filename,
const char* output_filename,
const char** error);
Handler for a ink choice.
int ink_choice_num_tags(const HInkChoice *self)
number of tags assoziated with this choice
const char * ink_choice_get_tag(const HInkChoice *self, int index)
access tag.
const char * ink_choice_text(const HInkChoice *self)
Choice text.
Handle for the global variable store shared among ink runners.
int ink_globals_set(HInkGlobals *self, const char *variable_name, InkValue value)
Sets the value of a globals variable.
void(* InkObserver)(InkValue new_value, InkValue old_value)
Definition inkcpp.h:300
void ink_globals_observe(HInkGlobals *self, const char *variable_name, InkObserver observer)
assignes a observer to the variable with the corresponding name.
void ink_globals_delete(HInkGlobals *self)
Deconstructs the globals store and frees all assoziated memories.
HInkSnapshot * ink_globals_create_snapshot(const HInkGlobals *self)
Creates a snapshot for later reloading.
InkValue ink_globals_get(const HInkGlobals *self, const char *variable_name)
Gets the value of a global variable.
int ink_list_flags_from(const HInkList *self, const char *list_name, InkListIter *iter)
Creates an Iterator over all flags contained in a list assziated with a defined list.
int ink_list_flags(const HInkList *self, InkListIter *iter)
Creates an Iterator over all flags contained in a list.
A handle for an ink runner.
const HInkChoice * ink_runner_get_choice(const HInkRunner *self, int index)
Gets a choice.
void ink_runner_bind(HInkRunner *self, const char *function_name, InkExternalFunction callback, int lookaheadSafe)
Binds a external function which is called from the runtime, with a return vallue.
HInkSnapshot * ink_runner_create_snapshot(const HInkRunner *self)
Creates a snapshot, for later reloading.
InkValue(* InkExternalFunction)(int argc, const InkValue argv[])
Callback for a Ink external function which returns void.
Definition inkcpp.h:201
int ink_runner_num_tags(const HInkRunner *self)
return the number of current.
const char * ink_runner_tag(const HInkRunner *self, int index)
access tag.
void ink_runner_bind_void(HInkRunner *self, const char *function_name, InkExternalFunctionVoid callback, int lookaheadSafe)
Binds a external function which is called form the runtime, with no return value.
void ink_runner_choose(HInkRunner *self, int index)
Make a choice.
const char * ink_runner_get_line(HInkRunner *self)
Continue execution until the next newline, then allocate a c-style string with the output.
int ink_runner_num_choices(const HInkRunner *self)
Returns the number of choices currently available.
void(* InkExternalFunctionVoid)(int argc, const InkValue argv[])
Callback for a Ink external function wihich returns a value.
Definition inkcpp.h:208
int ink_runner_can_continue(const HInkRunner *self)
Can the runner continue?
void ink_runner_delete(HInkRunner *self)
Deconstructs the Runner and all frees assoziated resources.
Handler for a ink snapshot.
int ink_snapshot_num_runners(const HInkSnapshot *self)
number of runners which are stored inside this snapshot
HInkSnapshot * ink_snapshot_from_file(const char *filename)
deserialize snapshot from file.
void ink_snapshot_write_to_file(const HInkSnapshot *self, const char *filename)
serialize snapshot to file
Handle for a loaded ink story.
HInkGlobals * ink_story_new_globals_from_snapshot(HInkStory *self, const HInkSnapshot *obj)
Reconstructs globals from snapshot.
void ink_story_delete(HInkStory *self)
deletes a story and all assoziated resources
HInkRunner * ink_story_new_runner(HInkStory *self, HInkGlobals *store)
Creates a new runner.
HInkGlobals * ink_story_new_globals(HInkStory *self)
Creates a new global store.
HInkStory * ink_story_from_file(const char *filename)
Creates a new story object from a file.
HInkRunner * ink_story_new_runner_from_snapshot(HInkStory *self, const HInkSnapshot *obj, HInkGlobals *store, int runner_id)
reconstruct runner from a snapshot
void ink_compile_json(const char *input_filename, const char *output_filename, const char **error)
Compiles a .ink.json file to an inkCPP .bin file.
Iterater used to iterate flags of a HInkList.
Definition inkcpp.h:125
const char * list_name
name of the list the flag corresponds to
Definition inkcpp.h:130
int ink_list_iter_next(InkListIter *self)
const char * flag_name
Name of the current flag.
Definition inkcpp.h:129
Repserentation of a ink variable.
Definition inkcpp.h:167
int32_t int32_v
contains value if type == ValueTypeInt32
Definition inkcpp.h:172
const char * string_v
contains value if type == ValueTypeString
Definition inkcpp.h:174
enum InkValue::Type type
indicates type contained in value
Type
indicates which type is contained in the value
Definition inkcpp.h:183
@ ValueTypeString
a string
Definition inkcpp.h:188
@ ValueTypeNone
the Value does not contain any value
Definition inkcpp.h:184
@ ValueTypeList
a ink list
Definition inkcpp.h:190
@ ValueTypeFloat
a floating point number
Definition inkcpp.h:189
@ ValueTypeBool
a boolean
Definition inkcpp.h:185
@ ValueTypeInt32
a signed integer
Definition inkcpp.h:187
@ ValueTypeUint32
a unsigned integer
Definition inkcpp.h:186
int bool_v
contains value if type == ValueTypeBool
Definition inkcpp.h:169
float float_v
contains value if type == ValueTypeFloat
Definition inkcpp.h:176
HInkList * list_v
contains value if type == ValueTypeList
Definition inkcpp.h:179
uint32_t uint32_v
contains value if type == ValueTypeUint32
Definition inkcpp.h:170