(C++)  1.0.0
A multi-platform, modular, universal engine for embedding advanced AI in games.
grail::BehaviorSequence Class Reference

The BehaviorSequence class - specialized Behavior executing sequence of provided subbehaviors one by one. More...

#include <BehaviorSequence.hh>

Inheritance diagram for grail::BehaviorSequence:
Collaboration diagram for grail::BehaviorSequence:

Public Member Functions

 BehaviorSequence (std::size_t expectedSequenceSize=3)
 BehaviorSequence. More...
 
 BehaviorSequence (const BehaviorSequence &other)=delete
 
 BehaviorSequence (BehaviorSequence &&other)=default
 
BehaviorSequenceoperator= (const BehaviorSequence &other)=delete
 
BehaviorSequenceoperator= (BehaviorSequence &&other)=delete
 
template<typename BehaviorType , typename... ConstructorArguments>
void AddBehavior (ConstructorArguments &&... constructorArguments)
 AddBehavior - method emplacing new behavior in the sequence. More...
 
void Start (AIEntity &owner) override final
 
void Update (AIEntity &owner, float deltaTime) override final
 
void Finish (AIEntity &owner, const BehaviorStatus status) override final
 
bool IsFinished (const AIEntity &owner) const override final
 
virtual bool IsLegal (const AIEntity &owner) const override
 IsLegal. More...
 
virtual bool IsInterruptible () const override
 IsInterruptible. More...
 
- Public Member Functions inherited from grail::Behavior
 Behavior (const Behavior &)=default
 
 Behavior (Behavior &&)=default
 
Behavioroperator= (const Behavior &)=delete
 
Behavioroperator= (Behavior &&)=delete
 
BehaviorStatus GetStatus () const
 GetStatus. More...
 
virtual std::string GetName () const
 

Detailed Description

The BehaviorSequence class - specialized Behavior executing sequence of provided subbehaviors one by one.

Constructor & Destructor Documentation

◆ BehaviorSequence()

grail::BehaviorSequence::BehaviorSequence ( std::size_t  expectedSequenceSize = 3)

BehaviorSequence.

Parameters
expectedSequenceSize- required to preallocate memory in container, by default 3

Member Function Documentation

◆ AddBehavior()

template<typename BehaviorType , typename... ConstructorArguments>
void grail::BehaviorSequence::AddBehavior ( ConstructorArguments &&...  constructorArguments)
inline

AddBehavior - method emplacing new behavior in the sequence.

Parameters
constructorArguments- forwarded BehaviorType constructor arguments

◆ Finish()

void grail::BehaviorSequence::Finish ( AIEntity owner,
const BehaviorStatus  status 
)
finaloverridevirtual

Invoked after the behavior is finished or interrupted

Parameters
owner- the entity executing this behavior

Reimplemented from grail::Behavior.

◆ IsFinished()

bool grail::BehaviorSequence::IsFinished ( const AIEntity owner) const
finaloverridevirtual
Parameters
owner- the entity executing this behavior

Reimplemented from grail::Behavior.

◆ IsInterruptible()

bool grail::BehaviorSequence::IsInterruptible ( ) const
overridevirtual

IsInterruptible.

Returns
true if current subbehavior is interruptible, false otherwise

Reimplemented from grail::Behavior.

◆ IsLegal()

bool grail::BehaviorSequence::IsLegal ( const AIEntity owner) const
overridevirtual

IsLegal.

Parameters
owner
Returns
true if current subbehavior is legal, false otherwise

Reimplemented from grail::Behavior.

◆ Start()

void grail::BehaviorSequence::Start ( AIEntity owner)
finaloverridevirtual

Invoked after the behavior is assigned to AIEntity

Parameters
owner- the entity executing this behavior

Reimplemented from grail::Behavior.

◆ Update()

void grail::BehaviorSequence::Update ( AIEntity owner,
float  deltaTime 
)
finaloverridevirtual

Invoked on each AIManager update

Parameters
owner- the entity executing this behavior

Implements grail::Behavior.


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