11#include "functional.h"
14#ifdef INK_ENABLE_UNREAL
15# include "Containers/UnrealString.h"
41#pragma region Interface Methods
131#ifdef INK_ENABLE_UNREAL
183 virtual const char*
get_tag(
size_t index)
const = 0;
188 virtual void internal_bind(
hash_t name, internal::function_base* function) = 0;
208 inline void bind(
hash_t name, F function,
bool lookaheadSafe =
false)
210 internal_bind(name,
new internal::function(function, lookaheadSafe));
226 inline void bind(
const char* name, F function,
bool lookaheadSafe =
false)
231#ifdef INK_ENABLE_UNREAL
240 internal_bind(name,
new internal::function_array_delegate(functionDelegate, lookaheadSafe));
246#pragma region Convenience Methods
An ink choice that is being presented to the user.
Definition choice.h:32
A runner to execute ink script from a story.
Definition runner.h:37
virtual std::string getall()=0
Gets all the text until the next choice or end.
virtual const choice * begin() const =0
Choice iterator.
virtual bool has_tags() const =0
check if since last choice selection tags have been added
virtual void set_rng_seed(uint32_t seed)=0
Sets seed for PRNG used in runner.
virtual std::string getline()=0
Gets the next line of output using C++ STL string.
void bind(hash_t name, F function, bool lookaheadSafe=false)
Binds an external callable to the runtime.
Definition runner.h:208
virtual void choose(size_t index)=0
Make a choice.
virtual snapshot * create_snapshot() const =0
creates a snapshot containing the runner, globals and all other runners connected to the globals.
void bind(const char *name, F function, bool lookaheadSafe=false)
Binds an external callable to the runtime.
Definition runner.h:226
virtual void getall(std::ostream &)=0
Gets all the text until the next choice or end.
virtual size_t num_tags() const =0
return the number of current.
virtual bool can_continue() const =0
Can the runner continue?
virtual const choice * end() const =0
Terminal choice iterator.
virtual void getline(std::ostream &)=0
Gets the next line of output using C++ STL string.
virtual const char * getline_alloc()=0
Continue execution until the next newline, then allocate a c-style string with the output.
const choice * get_choice(size_t index) const
Gets a choice.
virtual bool move_to(hash_t path)=0
Moves the runner to the specified path.
bool has_choices() const
Checks if we're currently facing any choices.
Definition runner.h:260
void bind_delegate(hash_t name, D functionDelegate, bool lookaheadSafe)
bind and unreal delegate
Definition runner.h:238
virtual const char * get_tag(size_t index) const =0
access tag.
const choice * operator[](size_t index)
Shorcut for accessing a choice.
Definition runner.h:287
virtual FString getline()=0
Gets the next line of output using unreal string allocation.
size_t num_choices() const
Returns the number of choices currently available.
Container for an InkCPP runtime snapshot.
Definition snapshot.h:27
Contaning all modules and classes used for the inkles ink runtime.
Definition choice.h:13
unsigned int uint32_t
define basic numeric type
Definition system.h:47
hash_t hash_string(const char *string)
Simple hash for serialization of strings.
Definition system.h:57
uint32_t hash_t
Name hash (used for temporary variables)
Definition system.h:50