A Demo Project for the UnrealEngineSDK
Loading...
Searching...
No Matches
FDialogueCompilerContext Class Reference

#include <DialogueCompiler.h>

Public Member Functions

 FDialogueCompilerContext (UDlgDialogue *InDialogue, const UDlgSystemSettings *InSettings, FCompilerResultsLog &InMessageLog)
 
void Compile ()
 

Private Member Functions

void CompileGraph ()
 
void CompileGraphNode (UDialogueGraphNode *GraphNode)
 
void FixBrokenOldIndicesAndUpdateGUID ()
 
bool GetPathToNode (const UDialogueGraphNode *SourceNode, const UDialogueGraphNode *TargetNode, TArray< const UDialogueGraphNode * > &OutPath)
 
bool GetPathToNodeAsSet (const UDialogueGraphNode *SourceNode, const UDialogueGraphNode *TargetNode, TSet< const UDialogueGraphNode * > &OutNodesInPath)
 
void PostCompileGraphNode (UDialogueGraphNode *GraphNode)
 
void PreCompileGraphNode (UDialogueGraphNode *GraphNode)
 
void PruneIsolatedNodes ()
 
void SetEdgesCategorization ()
 
void SetNextAvailableIndexToNode (UDialogueGraphNode *GraphNode)
 

Private Attributes

UDlgDialogueDialogue = nullptr
 
TArray< UDialogueGraphNode * > DialogueGraphNodes
 
UDialogueGraphNode_RootGraphNodeRoot = nullptr
 
TMap< int32, int32 > IndicesHistory
 
FCompilerResultsLog & MessageLog
 
int32 NextAvailableIndex = INDEX_NONE
 
int32 NodeDepth = INDEX_NONE
 
int32 NodesNumberNextDepth = INDEX_NONE
 
int32 NodesNumberUntilDepthIncrease = INDEX_NONE
 
TMap< const UDialogueGraphNode *, const UDialogueGraphNode * > NodesPath
 
int32 NodeUnvisitedChildrenNum = INDEX_NONE
 
TQueue< UDialogueGraphNode * > Queue
 
TArray< UDlgNode * > ResultDialogueNodes
 
const UDlgSystemSettingsSettings = nullptr
 
friend UDlgDialogue
 
TSet< UDialogueGraphNode * > VisitedNodes
 

Detailed Description

Definition at line 14 of file DialogueCompiler.h.

Constructor & Destructor Documentation

◆ FDialogueCompilerContext()

FDialogueCompilerContext::FDialogueCompilerContext ( UDlgDialogue * InDialogue,
const UDlgSystemSettings * InSettings,
FCompilerResultsLog & InMessageLog )
inline

Definition at line 19 of file DialogueCompiler.h.

Member Function Documentation

◆ Compile()

void FDialogueCompilerContext::Compile ( )

Compile the Dialogue from its graph nodes

Definition at line 15 of file DialogueCompiler.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CompileGraph()

void FDialogueCompilerContext::CompileGraph ( )
private

Used for the step 2 and 4 of the compile phase, reassign/compile the whole graph queue.

Definition at line 160 of file DialogueCompiler.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CompileGraphNode()

void FDialogueCompilerContext::CompileGraphNode ( UDialogueGraphNode * GraphNode)
private

Compiles/reassign the children of a GraphNode and reassign it's indices.

Definition at line 108 of file DialogueCompiler.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FixBrokenOldIndicesAndUpdateGUID()

void FDialogueCompilerContext::FixBrokenOldIndicesAndUpdateGUID ( )
private

Fixes all references to the old indices that this compile most likely broke.

Definition at line 308 of file DialogueCompiler.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetPathToNode()

bool FDialogueCompilerContext::GetPathToNode ( const UDialogueGraphNode * SourceNode,
const UDialogueGraphNode * TargetNode,
TArray< const UDialogueGraphNode * > & OutPath )
private

Gets the Path from SourceNode to the TargetNode in the OutPath. Returns false if no path can be found.

Definition at line 180 of file DialogueCompiler.cpp.

◆ GetPathToNodeAsSet()

bool FDialogueCompilerContext::GetPathToNodeAsSet ( const UDialogueGraphNode * SourceNode,
const UDialogueGraphNode * TargetNode,
TSet< const UDialogueGraphNode * > & OutNodesInPath )
private

Same as above only return a set.

Definition at line 211 of file DialogueCompiler.cpp.

Here is the caller graph for this function:

◆ PostCompileGraphNode()

void FDialogueCompilerContext::PostCompileGraphNode ( UDialogueGraphNode * GraphNode)
private

Applies necessary steps after the main compile routine (CompileGraphNode) has finished on a node.

Definition at line 77 of file DialogueCompiler.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PreCompileGraphNode()

void FDialogueCompilerContext::PreCompileGraphNode ( UDialogueGraphNode * GraphNode)
private

Applies necessary steps before the main compile routine (CompileGraphNode) has compiled on a node.

Definition at line 68 of file DialogueCompiler.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PruneIsolatedNodes()

void FDialogueCompilerContext::PruneIsolatedNodes ( )
private

Compiles/handles all remaining isolated nodes of the graph.

Definition at line 266 of file DialogueCompiler.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetEdgesCategorization()

void FDialogueCompilerContext::SetEdgesCategorization ( )
private

Sets the Edge category of each edge.

Definition at line 236 of file DialogueCompiler.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetNextAvailableIndexToNode()

void FDialogueCompilerContext::SetNextAvailableIndexToNode ( UDialogueGraphNode * GraphNode)
private

Sets NextAvailableIndex on the provided nodes, also keeps track of history in IndicesHistory.

Definition at line 328 of file DialogueCompiler.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ Dialogue

UDlgDialogue* FDialogueCompilerContext::Dialogue = nullptr
private

The dialogue being compiled.

Definition at line 59 of file DialogueCompiler.h.

◆ DialogueGraphNodes

TArray<UDialogueGraphNode*> FDialogueCompilerContext::DialogueGraphNodes
private

All the graph nodes of the Dialogue

Definition at line 70 of file DialogueCompiler.h.

◆ GraphNodeRoot

UDialogueGraphNode_Root* FDialogueCompilerContext::GraphNodeRoot = nullptr
private

The root graph node.

Definition at line 89 of file DialogueCompiler.h.

◆ IndicesHistory

TMap<int32, int32> FDialogueCompilerContext::IndicesHistory
private

Used to keep track of how indices change. Key: Old index Value: New index

Definition at line 86 of file DialogueCompiler.h.

◆ MessageLog

FCompilerResultsLog& FDialogueCompilerContext::MessageLog
private

Compiler message log (errors, warnings, notes)

Definition at line 66 of file DialogueCompiler.h.

◆ NextAvailableIndex

int32 FDialogueCompilerContext::NextAvailableIndex = INDEX_NONE
private

Useful for keeping track of the next available index in the DialogueNodes.

Definition at line 99 of file DialogueCompiler.h.

◆ NodeDepth

int32 FDialogueCompilerContext::NodeDepth = INDEX_NONE
private

Indicates the current node depth the BFS is at. Root Node as depth 0.

Definition at line 102 of file DialogueCompiler.h.

◆ NodesNumberNextDepth

int32 FDialogueCompilerContext::NodesNumberNextDepth = INDEX_NONE
private

Keeps track of the nodes numbers at depth NodeDepth + 1. Useful because we are only looking at the current depth and Unreal Queue does not have Size() sigh. This could have been done with a bool only, because we know how many items there are at current level and when we take all of them out, we know that the size of the current Queue is the nodes number at the next depth.

Definition at line 119 of file DialogueCompiler.h.

◆ NodesNumberUntilDepthIncrease

int32 FDialogueCompilerContext::NodesNumberUntilDepthIncrease = INDEX_NONE
private

Keeps track of how many nodes we must process (take from the queue) until we reach the next depth. When it reaches 0 it means we have reached the next level.

Definition at line 111 of file DialogueCompiler.h.

◆ NodesPath

TMap<const UDialogueGraphNode*, const UDialogueGraphNode*> FDialogueCompilerContext::NodesPath
private

Keep track of paths. Use pointers as the indices change at compile time. Key: Node Value: Parent Node

Definition at line 96 of file DialogueCompiler.h.

◆ NodeUnvisitedChildrenNum

int32 FDialogueCompilerContext::NodeUnvisitedChildrenNum = INDEX_NONE
private

Tells us the number of unvisited children the current node has.

Definition at line 105 of file DialogueCompiler.h.

◆ Queue

TQueue<UDialogueGraphNode*> FDialogueCompilerContext::Queue
private

The queue for the BFS

Definition at line 79 of file DialogueCompiler.h.

◆ ResultDialogueNodes

TArray<UDlgNode*> FDialogueCompilerContext::ResultDialogueNodes
private

The result of the compile will be stored here. This represents the new Dialogue.Nodes Array.

Definition at line 73 of file DialogueCompiler.h.

◆ Settings

const UDlgSystemSettings* FDialogueCompilerContext::Settings = nullptr
private

Definition at line 62 of file DialogueCompiler.h.

◆ UDlgDialogue

friend FDialogueCompilerContext::UDlgDialogue
private

Definition at line 16 of file DialogueCompiler.h.

◆ VisitedNodes

TSet<UDialogueGraphNode*> FDialogueCompilerContext::VisitedNodes
private

All the visited graph nodes in the BFS.

Definition at line 76 of file DialogueCompiler.h.


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