# IBrain interface

> What thinks for one agent. The engine calls it at the agent record's think interval, 0.1 s unless the record says otherwise, in the session's think phase on the server's thread, and spreads agents on the same interval over its ticks.

Namespace `EvilEngine.Api.Agents`, assembly `EvilEngine.Api`. Engine commit 4ff877b1.

```csharp
public interface IBrain
```

What thinks for one [agent](/docs/api/iagent). The engine calls it at the agent record's `think` interval, 0.1 s unless the record says otherwise, in the session's think phase on the server's thread, and spreads agents on the same interval over its ticks.

```csharp
sealed class Wanderer : IBrain
{
    public void Think(IAgent agent)
    {
        if (agent.Motion != AgentMotion.Moving)
            agent.MoveTo(agent.Feet with { X = agent.Feet.X + 5 });
    }
}
```

## Members

### Think (method)

```csharp
void Think(IAgent agent)
```

Reads the agent and sets what it wants: a goal with [MoveTo](/docs/api/iagent#moveto), a facing with [Face](/docs/api/iagent#face), or a raw [command](/docs/api/iagent#command). Locomotion turns that into the body's movement every tick between thinks. A brain that throws is dropped, with a note, and its body stands idle.
