EvolvingBehavior  0.2.0
 
Loading...
Searching...
No Matches

A class containing utility functions related to Unreal Engine Behavior Trees. More...

#include <BehaviorTreeUtils.h>

Inheritance diagram for UBehaviorTreeUtils:

Static Public Member Functions

static void PrintBehaviorTree (UBehaviorTree *behaviorTree, AActor *owner=NULL)
 Print a behavior tree to the log. More...
 
static void MapBehaviorTree (UNodeMapper *mapper, UBehaviorTree *behaviorTree)
 Map all nodes in a given behavior tree using a UNodeMapper. More...
 
static FString CompositeToString (int indentLevel, UBTCompositeNodeGene *node)
 Converts the given CompositeNodeGene to a string. More...
 
static void CompositeToLog (int indentLevel, UBTCompositeNodeGene *node)
 
static FString ServicesToString (int indentLevel, const UBTCompositeNodeGene *node)
 Converts the given CompositeNodeGene's Services to a string. More...
 
static void ServicesToLog (int indentLevel, const UBTCompositeNodeGene *node)
 
static FString ServicesToString (int indentLevel, const UBTTaskNodeGene *node)
 Converts the given TaskNodeGene's Services to a string. More...
 
static void ServicesToLog (int indentLevel, const UBTTaskNodeGene *node)
 
static FString DecoratorsToString (int indentLevel, const TArray< UBTDecoratorGene * > &decorators)
 Converts an array of decorators into a string. More...
 
static void DecoratorsToLog (int indentLevel, const TArray< UBTDecoratorGene * > &decorators)
 
static FString ServicesToString (int indentLevel, const TArray< UBTServiceGene * > &services)
 
static void ServicesToLog (int indentLevel, const TArray< UBTServiceGene * > &services)
 
static bool AssertEquals (UBehaviorTree *left, UBehaviorTree *right)
 Checks that the given behavior trees are exactly alike. More...
 

Static Protected Member Functions

static FString DecoratorsToString (int indentLevel, const UBTChildContainerGene *compositeChild)
 
static void DecoratorsToLog (int indentLevel, const UBTChildContainerGene *compositeChild)
 
static bool AssertBaseDataEquals (UBTNode *left, UBTNode *right)
 
static bool AssertEquals (UBTCompositeNode *left, UBTCompositeNode *right)
 
static bool AssertEquals (FBTCompositeChild &left, FBTCompositeChild &right)
 
static bool AssertEquals (TArray< UBTDecorator * > &left, TArray< UBTDecorator * > &right)
 
static bool AssertEquals (TArray< UBTService * > &left, TArray< UBTService * > &right)
 

Detailed Description

A class containing utility functions related to Unreal Engine Behavior Trees.

Author
npc
Date
12/01/17

Member Function Documentation

◆ AssertEquals()

bool UBehaviorTreeUtils::AssertEquals ( UBehaviorTree *  left,
UBehaviorTree *  right 
)
static

Checks that the given behavior trees are exactly alike.

Parameters
leftThe left behavior tree.
rightThe right behavior tree.
Returns
True if the trees are the same, false otherwise.

◆ CompositeToString()

FString UBehaviorTreeUtils::CompositeToString ( int  indentLevel,
UBTCompositeNodeGene node 
)
static

Converts the given CompositeNodeGene to a string.

Parameters
indentLevelThe indent level at which to indent each line.
nodeThe CompositeNodeGene to convert.
Returns
The string.

◆ DecoratorsToString()

FString UBehaviorTreeUtils::DecoratorsToString ( int  indentLevel,
const TArray< UBTDecoratorGene * > &  decorators 
)
static

Converts an array of decorators into a string.

Parameters
indentLevelThe indent level at which to indent each line.
decoratorsThe array of decorators.
Returns
The resulting string.

◆ MapBehaviorTree()

void UBehaviorTreeUtils::MapBehaviorTree ( UNodeMapper mapper,
UBehaviorTree *  behaviorTree 
)
static

Map all nodes in a given behavior tree using a UNodeMapper.

Parameters
mapperThe mapper to use.
behaviorTreeThe Behavior Tree to map.

◆ PrintBehaviorTree()

void UBehaviorTreeUtils::PrintBehaviorTree ( UBehaviorTree *  behaviorTree,
AActor *  owner = NULL 
)
static

Print a behavior tree to the log.

Parameters
behaviorTreeThe Behavior Tree to print.
ownerThe Actor that owns this tree - may be null.

If an Actor is provided as the owner, will use the Visual log.

◆ ServicesToString() [1/2]

FString UBehaviorTreeUtils::ServicesToString ( int  indentLevel,
const UBTCompositeNodeGene node 
)
static

Converts the given CompositeNodeGene's Services to a string.

Parameters
indentLevelThe indent level at which to indent each line.
nodeThe CompositeNodeGene who's services to convert.
Returns
The string.

◆ ServicesToString() [2/2]

FString UBehaviorTreeUtils::ServicesToString ( int  indentLevel,
const UBTTaskNodeGene node 
)
static

Converts the given TaskNodeGene's Services to a string.

Parameters
indentLevelThe indent level at which to indent each line.
nodeThe TaskNodeGene who's services to convert.
Returns
The string.

The documentation for this class was generated from the following files:
  • Source/EvolvingBehavior/Public/BehaviorTreeUtils.h
  • Source/EvolvingBehavior/Private/BehaviorTreeUtils.cpp