|
inkcpp
|
Base class for all ink threads. More...
#include <InkThread.h>
Public Member Functions | |
| void | Yield () |
| Yields the thread immediately. | |
| bool | IsYielding () |
| Checks if the thread is stopped. | |
| void | Resume () |
| Resumes yielded thread. | |
| void | Stop () |
| Kills thread at next possible moment. | |
| AInkRuntime * | GetRuntime () const |
| Access runtime the thread belongs to. | |
| void | OnStartup () |
| triggered after initializing the runner | |
| void | OnLineWritten (const FString &line, const UTagList *tags) |
| triggered if a new line of context is available | |
| void | OnKnotEntered (const UTagList *global_tags, const UTagList *knot_tags) |
| triggered if a knew knot/stitch is entered (tunneling is ignored). | |
| void | OnTag (const FString &tag_name) |
| triggered when a tag is encountered | |
| void | OnChoice (const TArray< UInkChoice * > &choices) |
| triggered when reached a choice point. | |
| void | OnShutdown () |
| triggered when the thread reached the end of context | |
| bool | PickChoice (int index) |
| picks a choice to continue with | |
| FInkHandle | RegisterTagFunction (FName functionName, const FTagFunctionDelegate &function) |
| Register a callback for a named "tag function". | |
| FInkHandle | RegisterExternalFunction (const FString &functionName, const FExternalFunctionDelegate &function, bool lookaheadSafe=false) |
| Register an external function that returns a value. | |
| FInkHandle | RegisterExternalEvent (const FString &functionName, const FExternalFunctionVoidDelegate &function, bool lookaheadSafe=false) |
| Register an external event (void return). | |
| void | Unregister (const FInkHandle &handle) |
| Unregister a previously registered external function, event, or tag function. | |
| void | ClearExternalFunctions () |
| Unregister all external functions and events bound to this thread. | |
| const UTagList * | GetKnotTags () |
| get knots assoziated with current knot. | |
| const UTagList * | GetGlobalTags () |
| get global tags. | |
| const TArray< UInkChoice * > & | GetCurrentChoices () const |
| Get choices from the last OnChoice event. | |
Friends | |
| class | AInkRuntime |
| friend | FInkVar::FInkVar (UInkList &) |
| friend | FInkVar::FInkVar (ink::runtime::value) |
Base class for all ink threads.
| void UInkThread::ClearExternalFunctions | ( | ) |
Unregister all external functions and events bound to this thread.
Useful when reusing a thread via StartExisting() to ensure no stale bindings remain.
|
inline |
Get choices from the last OnChoice event.
| const UTagList * UInkThread::GetGlobalTags | ( | ) |
get global tags.
global tags are tags listed at the top of the file before the first line of content
| const UTagList * UInkThread::GetKnotTags | ( | ) |
get knots assoziated with current knot.
knot tags are tags listed behind a knot == knot name == before the first line of content
|
inline |
Access runtime the thread belongs to.
| bool UInkThread::IsYielding | ( | ) |
| void UInkThread::OnChoice | ( | const TArray< UInkChoice * > & | choices | ) |
triggered when reached a choice point.
| choices | possible branches to choose from, in order to continue |
triggered if a knew knot/stitch is entered (tunneling is ignored).
Triggers before the first line of a knot/stitch is written
| global_tags | tags assoziated with global file |
| knot_tags | tags assoziated with the current knot/stitch |
| void UInkThread::OnLineWritten | ( | const FString & | line, |
| const UTagList * | tags ) |
triggered if a new line of context is available
| line | text of new line |
| tags | tags associated with this line |
| void UInkThread::OnShutdown | ( | ) |
| void UInkThread::OnStartup | ( | ) |
triggered after initializing the runner
| void UInkThread::OnTag | ( | const FString & | tag_name | ) |
triggered when a tag is encountered
| tag_name | the tag found |
| bool UInkThread::PickChoice | ( | int | index | ) |
picks a choice to continue with
| false | if the index is out of range |
| FInkHandle UInkThread::RegisterExternalEvent | ( | const FString & | functionName, |
| const FExternalFunctionVoidDelegate & | function, | ||
| bool | lookaheadSafe = false ) |
Register an external event (void return).
| FInkHandle UInkThread::RegisterExternalFunction | ( | const FString & | functionName, |
| const FExternalFunctionDelegate & | function, | ||
| bool | lookaheadSafe = false ) |
Register an external function that returns a value.
| FInkHandle UInkThread::RegisterTagFunction | ( | FName | functionName, |
| const FTagFunctionDelegate & | function ) |
Register a callback for a named "tag function".
| void UInkThread::Resume | ( | ) |
| void UInkThread::Stop | ( | ) |
Kills thread at next possible moment.
|
inline |
Unregister a previously registered external function, event, or tag function.
Prefer calling FInkHandle::Cancel() directly — that does not require the thread.
| handle | the handle returned by RegisterExternalFunction() / RegisterExternalEvent() / RegisterTagFunction() |
| void UInkThread::Yield | ( | ) |