 |
Grail (C++)
1.1.1
A multi-platform, modular, universal engine for embedding advanced AI in games.
|
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<
38 BehaviorType>(std::forward<ConstructorArguments>(constructorArguments)...));
39 currentBehavior = sequence.begin();
43 virtual void Update(
AIEntity& owner,
float deltaTime)
override final;
44 virtual void Finish(
AIEntity& owner,
const BehaviorStatus status)
override final;
62 std::vector<std::unique_ptr<Behavior>> sequence{};
63 std::vector<std::unique_ptr<Behavior>>::iterator currentBehavior{};
67 #endif // GRAIL_BEHAVIOR_SEQUENCE_H
The AIEntity class - Defines a basic object which can execute behaviors.
Definition: AIEntity.hh:39
virtual void Update(AIEntity &owner, float deltaTime) override final
Definition: BehaviorSequence.cpp:19
virtual bool IsInterruptible() const override
IsInterruptible.
Definition: BehaviorSequence.cpp:58
The BehaviorSequence class - specialized Behavior executing sequence of provided subbehaviors one by ...
Definition: BehaviorSequence.hh:14
A high-level abstraction of actions in the game.
Definition: Behavior.hh:19
virtual bool IsFinished(const AIEntity &owner) const override final
Definition: BehaviorSequence.cpp:48
virtual void Finish(AIEntity &owner, const BehaviorStatus status) override final
Definition: BehaviorSequence.cpp:39
void AddBehavior(ConstructorArguments &&... constructorArguments)
AddBehavior - method emplacing new behavior in the sequence.
Definition: BehaviorSequence.hh:35
virtual void Start(AIEntity &owner) override final
Definition: BehaviorSequence.cpp:13
virtual bool IsLegal(const AIEntity &owner) const override
IsLegal.
Definition: BehaviorSequence.cpp:53