Botcraft 1.21.4
Loading...
Searching...
No Matches
Botcraft::Repeater< Context > Class Template Referencefinal

A Decorator that ticks its child n times (repeat until first success if n == 0). More...

#include <BehaviourTree.hpp>

Inheritance diagram for Botcraft::Repeater< Context >:
Botcraft::Decorator< Context > Botcraft::Node< Context > Botcraft::BaseNode

Public Member Functions

 Repeater (const std::string &s, const size_t n_)
 
- Public Member Functions inherited from Botcraft::Decorator< Context >
virtual ~Decorator ()
 
void SetChild (std::shared_ptr< Node< Context > > child_)
 
virtual BehaviourNodeType GetNodeType () const override
 
virtual size_t GetNumChildren () const override
 
virtual const BaseNodeGetChild (const size_t index) const override
 
- Public Member Functions inherited from Botcraft::Node< Context >
virtual ~Node ()
 
Status Tick (Context &context) const
 
- Public Member Functions inherited from Botcraft::BaseNode
 BaseNode (const std::string &name_)
 
virtual ~BaseNode ()
 
std::string GetFullDescriptor () const
 
const std::string & GetName () const
 
std::string GetClassName () const
 

Protected Member Functions

virtual Status TickImpl (Context &context) const override
 
- Protected Member Functions inherited from Botcraft::Decorator< Context >
Status TickChild (Context &context) const
 

Private Attributes

size_t n
 

Additional Inherited Members

- Protected Attributes inherited from Botcraft::BaseNode
const std::string name
 

Detailed Description

template<typename Context>
class Botcraft::Repeater< Context >

A Decorator that ticks its child n times (repeat until first success if n == 0).

Always returns success.

Template Parameters
ContextThe tree context type

Definition at line 365 of file BehaviourTree.hpp.

Constructor & Destructor Documentation

◆ Repeater()

template<typename Context >
Botcraft::Repeater< Context >::Repeater ( const std::string &  s,
const size_t  n_ 
)
inline

Definition at line 368 of file BehaviourTree.hpp.

Member Function Documentation

◆ TickImpl()

template<typename Context >
virtual Status Botcraft::Repeater< Context >::TickImpl ( Context &  context) const
inlineoverrideprotectedvirtual

Member Data Documentation

◆ n

template<typename Context >
size_t Botcraft::Repeater< Context >::n
private

Definition at line 384 of file BehaviourTree.hpp.

Referenced by Botcraft::Repeater< Context >::TickImpl().


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