|
Grail (C++)
1.4.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();
46 virtual void Finish(
AIEntity& owner,
const BehaviorStatus status)
override;
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 bool IsInterruptible() const override
IsInterruptible.
Definition: BehaviorSequence.cpp:62
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:22
virtual void Update(AIEntity &owner, float deltaTime) override
Definition: BehaviorSequence.cpp:22
void AddBehavior(ConstructorArguments &&... constructorArguments)
AddBehavior - method emplacing new behavior in the sequence.
Definition: BehaviorSequence.hh:37
virtual bool IsFinished(const AIEntity &owner) const override
Definition: BehaviorSequence.cpp:52
virtual void Start(AIEntity &owner) override
Definition: BehaviorSequence.cpp:15
virtual void Finish(AIEntity &owner, const BehaviorStatus status) override
Definition: BehaviorSequence.cpp:43
virtual bool IsLegal(const AIEntity &owner) const override
IsLegal.
Definition: BehaviorSequence.cpp:57