 |
Grail (C++)
1.2.0
A multi-platform, modular, universal engine for embedding advanced AI in games.
|
3 #ifndef GRAIL_BEHAVIOR_SEQUENCE_H
4 #define GRAIL_BEHAVIOR_SEQUENCE_H
32 template <
typename BehaviorType,
typename... ConstructorArguments>
37 void AddBehavior(ConstructorArguments&&... constructorArguments)
39 sequence.push_back(std::make_unique<
40 BehaviorType>(std::forward<ConstructorArguments>(constructorArguments)...));
41 currentBehavior = sequence.begin();
45 virtual void Update(
AIEntity& owner,
float deltaTime)
override final;
46 virtual void Finish(
AIEntity& owner,
const BehaviorStatus status)
override final;
64 std::vector<std::unique_ptr<Behavior>> sequence{};
65 std::vector<std::unique_ptr<Behavior>>::iterator currentBehavior{};
69 #endif // GRAIL_BEHAVIOR_SEQUENCE_H
The AIEntity class - Defines a basic object which can execute behaviors.
Definition: AIEntity.hh:50
virtual void Update(AIEntity &owner, float deltaTime) override final
Definition: BehaviorSequence.cpp:21
virtual bool IsInterruptible() const override
IsInterruptible.
Definition: BehaviorSequence.cpp:60
The BehaviorSequence class - specialized Behavior executing sequence of provided subbehaviors one by ...
Definition: BehaviorSequence.hh:16
A high-level abstraction of actions in the game.
Definition: Behavior.hh:21
virtual bool IsFinished(const AIEntity &owner) const override final
Definition: BehaviorSequence.cpp:50
virtual void Finish(AIEntity &owner, const BehaviorStatus status) override final
Definition: BehaviorSequence.cpp:41
void AddBehavior(ConstructorArguments &&... constructorArguments)
AddBehavior - method emplacing new behavior in the sequence.
Definition: BehaviorSequence.hh:37
virtual void Start(AIEntity &owner) override final
Definition: BehaviorSequence.cpp:15
virtual bool IsLegal(const AIEntity &owner) const override
IsLegal.
Definition: BehaviorSequence.cpp:55