Skip to main content

ActiveEat

A class in Root.Township, Alta.Intelligence.

Action where an agent eats its target: it interacts with it, waits Delay, then destroys it. With IsImmediate the target is destroyed at once.

Constructors​

MemberWhat it is
ActiveEat()Creates an ActiveEat with default values.

Fields​

1 private and internal field
MemberWhat it is
private Timeline.IEntry entryThe scheduled Consume call on the timeline, so it can be cancelled.

Methods​

MemberWhat it is
override void Update(bool hasTarget)Cancels if the target is lost.
protected override void OnStart()Destroys the target at once if immediate, else starts interacting and schedules Consume.
2 private and internal methods
MemberWhat it is
private void Cancel(Interactor interactor, Interactable interactable)Called when the interaction ends early; cancels the pending eat and the action.
private void Consume()Destroys the thing being eaten and finishes the action.