NoJobEngine
2.0.7
Toggle main menu visibility
Loading...
Searching...
No Matches
BTNode.h
Go to the documentation of this file.
1
6
#pragma once
7
#include "
BTContext.h
"
8
#include <vector>
9
#include <string>
10
11
namespace
NoJob
{
13
enum class
BTStatus
{
Success
,
Failure
,
Running
};
15
class
BTNode
{
16
public
:
17
explicit
BTNode
(
BTNodeID
id
) : m_ID(id) {}
18
virtual
~BTNode
() =
default
;
19
BTNode
(
const
BTNode
&) =
delete
;
20
BTNode
&
operator=
(
const
BTNode
&) =
delete
;
21
BTNodeID
GetID
()
const
{
return
m_ID; }
22
virtual
std::string
DebugLabel
()
const
{
return
"Node"
; }
27
virtual
BTStatus
Tick
(
BTContext
& context,
float
deltaTime)
const
= 0;
28
virtual
void
Reset
(
BTContext
& context)
const
{ context.
CancelNode
(m_ID); context.
ResetNodeState
(m_ID); }
29
virtual
void
CollectChildren
(std::vector<const BTNode*>&)
const
{}
30
private
:
31
BTNodeID
m_ID;
32
};
33
}
BTContext.h
Per-agent behavior tree execution context.
NoJob::BTContext
Definition
BTContext.h:24
NoJob::BTContext::ResetNodeState
void ResetNodeState(BTNodeID id)
Definition
BTContext.h:49
NoJob::BTContext::CancelNode
void CancelNode(BTNodeID id)
Definition
BTContext.h:62
NoJob::BTNode::Reset
virtual void Reset(BTContext &context) const
Definition
BTNode.h:28
NoJob::BTNode::BTNode
BTNode(BTNodeID id)
Definition
BTNode.h:17
NoJob::BTNode::Tick
virtual BTStatus Tick(BTContext &context, float deltaTime) const =0
Evaluates this node for one update.
NoJob::BTNode::GetID
BTNodeID GetID() const
Definition
BTNode.h:21
NoJob::BTNode::DebugLabel
virtual std::string DebugLabel() const
Definition
BTNode.h:22
NoJob::BTNode::operator=
BTNode & operator=(const BTNode &)=delete
NoJob::BTNode::BTNode
BTNode(const BTNode &)=delete
NoJob::BTNode::CollectChildren
virtual void CollectChildren(std::vector< const BTNode * > &) const
Definition
BTNode.h:29
NoJob::BTNode::~BTNode
virtual ~BTNode()=default
NoJob
Definition
BTActionNode.h:13
NoJob::BTNodeID
std::uint64_t BTNodeID
Definition
BTContext.h:19
NoJob::BTStatus
BTStatus
Result of a behavior tree node tick.
Definition
BTNode.h:13
NoJob::BTStatus::Success
@ Success
Definition
BTNode.h:13
NoJob::BTStatus::Running
@ Running
Definition
BTNode.h:13
NoJob::BTStatus::Failure
@ Failure
Definition
BTNode.h:13
Engine
AI
BehaviorTree
BTNode.h
Generated by
1.18.0