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

Base class for all ink threads. More...

#include <InkThread.h>

Inheritance diagram for UInkThread:

Public Member Functions

void Yield ()
 Yields the thread immediatly.
 
bool IsYielding ()
 Checks if the thread is stopped.
 
void Resume ()
 Resumes yielded thread.
 
void Stop ()
 Kills thread at next possible moment.
 
AInkRuntimeGetRuntime () const
 Access runtime the thread belongs to.
 
void OnStartup ()
 triggered after initalizing the runner
 
void OnLineWritten (const FString &line, const UTagList *tags)
 triggerd if a new line of context is available
 
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
 
void RegisterTagFunction (FName functionName, const FTagFunctionDelegate &function)
 Register a callback for a named "tag function".
 
void RegisterExternalFunction (const FString &functionName, const FExternalFunctionDelegate &function, bool lookaheadSafe=false)
 register a external function.
 
void RegisterExternalEvent (const FString &functionName, const FExternalFunctionVoidDelegate &function, bool lookaheadSafe=false)
 register external event.
 

Friends

class AInkRuntime
 

Detailed Description

Base class for all ink threads.

Member Function Documentation

◆ GetRuntime()

AInkRuntime * UInkThread::GetRuntime ( ) const
inline

Access runtime the thread belongs to.

Returns
runtime of the thread

Get Runtime
Target
Return Value

◆ IsYielding()

bool UInkThread::IsYielding ( )

Checks if the thread is stopped.

Return values
trueif the thread currently waiting to resume
See also
Yield() Resume()

Is Yielding
Target
Return Value

◆ OnChoice()

void UInkThread::OnChoice ( const TArray< UInkChoice * > & choices)

triggered when reached a choice point.

Parameters
choicespossible branches to choos for continue
See also
PickChoice()

Event OnChoice
Choices

◆ OnLineWritten()

void UInkThread::OnLineWritten ( const FString & line,
const UTagList * tags )

triggerd if a new line of context is available

Parameters
linetext of new line
tagstags assoziated with this line

Event OnLineWritten
Line
Tags

◆ OnShutdown()

void UInkThread::OnShutdown ( )

triggered when the thread reached the end of context

See also
AInkRuntime::StartExisting()

Event OnShutdown

◆ OnStartup()

void UInkThread::OnStartup ( )

triggered after initalizing the runner

Event OnStartup

◆ OnTag()

void UInkThread::OnTag ( const FString & tag_name)

triggered when a tag is encountered

Parameters
tag_namethe tag found

Event OnTag
Tag name

◆ PickChoice()

bool UInkThread::PickChoice ( int index)

picks a choice to continue with

See also
UInkChoice::GetIndex()
Return values
falseif the index is out of range

Pick Choice
Target
Index
0
Return Value

◆ RegisterExternalEvent()

void UInkThread::RegisterExternalEvent ( const FString & functionName,
const FExternalFunctionVoidDelegate & function,
bool lookaheadSafe = false )

register external event.

A event has the return type void.

See also
If you want to return a value use RegisterExternalFunction()

Register External Event
Target
Function Name
Function
Lookahead Safe

◆ RegisterExternalFunction()

void UInkThread::RegisterExternalFunction ( const FString & functionName,
const FExternalFunctionDelegate & function,
bool lookaheadSafe = false )

register a external function.

A function provides a return value

See also
if you do not want to return something RegisterExternalEvent()

Register External Function
Target
Function Name
Function
Lookahead Safe

◆ RegisterTagFunction()

void UInkThread::RegisterTagFunction ( FName functionName,
const FTagFunctionDelegate & function )

Register a callback for a named "tag function".

See also
TagFunction

Register Tag Function
Target
Function Name
Function

◆ Resume()

void UInkThread::Resume ( )

Resumes yielded thread.

See also
Yield()

Resume
Target

◆ Stop()

void UInkThread::Stop ( )

Kills thread at next possible moment.

Stop
Target

◆ Yield()

void UInkThread::Yield ( )

Yields the thread immediatly.

This will stop the execution (after finishing the current line). until Resume() is called.

Yield() and Resume() working with a refernce counter. therfore a thread can be yield multiple times, and must then be resumed the same amount.

Yield
Target


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