Add BehaviorTreeKnowledgeBooleanDecorator

This commit is contained in:
Wojtek Figat
2024-03-05 12:45:40 +01:00
parent b506295b7b
commit d5f4254a73
2 changed files with 29 additions and 0 deletions

View File

@@ -706,6 +706,14 @@ bool BehaviorTreeKnowledgeValuesConditionalDecorator::CanUpdate(const BehaviorUp
return BehaviorKnowledge::CompareValues((float)ValueA.Get(context.Knowledge), (float)ValueB.Get(context.Knowledge), Comparison);
}
bool BehaviorTreeKnowledgeBooleanDecorator::CanUpdate(const BehaviorUpdateContext& context)
{
Variant value = Value.Get(context.Knowledge);
bool result = (bool)value;
result ^= Invert;
return result;
}
bool BehaviorTreeHasTagDecorator::CanUpdate(const BehaviorUpdateContext& context)
{
bool result = false;