1 #ifndef GRAIL_BEHAVIOR_SEQUENCE_H
2 #define GRAIL_BEHAVIOR_SEQUENCE_H
30 template<
typename BehaviorType,
typename... ConstructorArguments>
35 void AddBehavior(ConstructorArguments&&... constructorArguments)
37 sequence.push_back(std::make_unique<BehaviorType>(std::forward<ConstructorArguments>(constructorArguments)...));
38 currentBehavior = sequence.begin();
43 void Finish(
AIEntity &owner,
const BehaviorStatus status)
override final;
61 std::vector<std::unique_ptr<Behavior>> sequence{};
62 std::vector<std::unique_ptr<Behavior>>::iterator currentBehavior;
The AIEntity class - Defines a basic object which can execute behaviors.
Definition: AIEntity.hh:39
A high-level abstraction of actions in the game.
Definition: Behavior.hh:20
The BehaviorSequence class - specialized Behavior executing sequence of provided subbehaviors one by ...
Definition: BehaviorSequence.hh:15
void Update(AIEntity &owner, float deltaTime) override final
Definition: BehaviorSequence.cpp:20
virtual bool IsLegal(const AIEntity &owner) const override
IsLegal.
Definition: BehaviorSequence.cpp:54
bool IsFinished(const AIEntity &owner) const override final
Definition: BehaviorSequence.cpp:49
void AddBehavior(ConstructorArguments &&... constructorArguments)
AddBehavior - method emplacing new behavior in the sequence.
Definition: BehaviorSequence.hh:35
virtual bool IsInterruptible() const override
IsInterruptible.
Definition: BehaviorSequence.cpp:59
void Start(AIEntity &owner) override final
Definition: BehaviorSequence.cpp:14
void Finish(AIEntity &owner, const BehaviorStatus status) override final
Definition: BehaviorSequence.cpp:40