Add Has Goal decorator to BT

This commit is contained in:
Wojtek Figat
2023-08-29 17:31:35 +02:00
parent 57ee884397
commit b6c8a08b58
5 changed files with 83 additions and 20 deletions

View File

@@ -456,3 +456,9 @@ bool BehaviorTreeHasTagDecorator::CanUpdate(const BehaviorUpdateContext& context
result ^= Invert;
return result;
}
bool BehaviorTreeHasGoalDecorator::CanUpdate(const BehaviorUpdateContext& context)
{
Variant value; // TODO: use HasGoal in Knowledge to optimize this (goal struct is copied by selector accessor)
return Goal.TryGet(context.Knowledge, value);
}