> For the complete documentation index, see [llms.txt](https://renownedgames.gitbook.io/ai-tree/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://renownedgames.gitbook.io/ai-tree/api/runtime/condition-decorator.md).

# Condition Decorator

Type description and basic instructions.

### Description

Condition Decorator is base abstract class for all decorator nodes that are supposed to check ccertain condition when executed.

To create a custom condition decorator you should inherit from Condition Decorator class and implement logic that is described below.

### CalculateResult

When inheriting from Condition Decorator you have to override CalculateResult method.

```csharp
public class ExampleConditionDecorator : ConditionDecorator
{
    public override bool CalculateResult()
    {
        throw new NotImplementedException();
    }
}
```

* CalculateResult calculates result of the condition.
* CalculateResult gets called every tick during node execution.

{% hint style="info" %}
Condition Decorator inherits from [Decorator Node](/ai-tree/api/runtime/decorator-node.md)
{% endhint %}

{% hint style="info" %}
To create custom decorator nodes in editor you should add [Node Content](/ai-tree/api/runtime/nodecontentattribute.md) attribute to your custom decorator node class.
{% endhint %}
