Skip to content
EvilEngine.Api.Agents

IAgents interface

public interface IAgents

Where a Plugin gives brains, through its context’s Agents. An agent record names a brain by its id, and a body that attaches the record, as an NPC class’s spawns do through NpcClass.Agent, thinks with it. With no Plugin registering the brain, the body stands idle.

context.Agents.Brain(ContentId.Parse("mymod:brain/wanderer"), agent => new Wanderer());
Assembly
EvilEngine.Api
Commit
4ff877b1

Members

Brain method

void Brain(ContentId id, Func<IAgent, IBrain> create)

Registers a brain while the Plugin loads: create makes one IBrain for each agent that attaches it. The later Plugin’s wins and the earlier’s comes back when it unloads. Registering after loading throws.