Vixen
c7401864
csharp
public sealed class Leash

One mob's leash: how far it has been pulled and for how long.

Read the guide page for this →

Remarks

⚠ It is handed a distance rather than two positions. Working out how far apart two things are needs the scene, and an AI library that owned that would be a second spatial query — the same boundary PvpMatch.Occupy and InteractionNode sit on.

Fields and properties (4)

  • public LeashDefinition Definition

    How far and what happens.

  • public LeashState State

    Where it is.

  • public float Tether

    How far it will follow before it starts to give up.

  • public float Break

    How far before it does, never inside the tether.

Methods (4)

  • public Leash(LeashDefinition definition)

    Makes one, held.

  • public float StretchedFor(float now)

    How long it has been stretched, or zero.

  • public LeashVerdict Check(float distance, float now)

    Says how far it has been pulled and asks what to do.

  • public void Release()

    Puts it back to held. What finishing a reset does.

Used by (1)

  • LeashTestsVixen.Gameplay.Ai.Tests