Vixen
caa30e12
csharp
public sealed class InteractionNode

One node in the world: how much is left of it, and who is on it.

Read the guide page for this →

Remarks

⚠ A shared node is claimed for the duration of a channel, and that is the whole reason this type exists. Without a claim, two players who start mining the same rock at the same moment both finish and it yields twice — the interaction library's version of the duplication bug the container algebra exists to prevent. The claim is released on completion, on interruption and on the claimant walking away.

⚠ Per-player instancing means the uses are per player, not the node. One rock, one respawn timer, and everybody gets their own go at it — which is Guild Wars 2's answer to node-stealing and is a policy on the definition rather than a second kind of node.

⚠ Respawn counts from the completion that emptied it, not from the last attempt. A timer restarted by a failed channel is a node that can be kept out of the world by somebody standing next to it starting and cancelling.

Fields and properties (3)

  • public Interactable Interactable

    What it is.

  • public Channel? Claimant

    Who is on it, or null.

  • public bool IsClaimed

    Whether anybody is on it.

Methods (9)

  • public InteractionNode(Interactable interactable)

    Makes a node, full.

  • public int RemainingFor(PlayerId player)

    How many uses somebody has left of it.

  • public InteractionRefusal CanBegin(PlayerId player, float now, IRequirementContext? context = null)

    Whether somebody may start, and why not.

  • public InteractionRefusal Begin(PlayerId player, float now, IRequirementContext? context = null)

    Starts using it.

  • public bool Interrupt(PlayerId player = default(PlayerId))

    Stops a channel without finishing it. Nothing is consumed.

  • public bool Disturb(InterruptOn cause)

    Whether something that just happened stops the channel.

  • public InteractionRefusal Complete(PlayerId player, float now, out InteractionResult result, GameplayTagSet? grantTo = null)

    Finishes a channel, if it has run its course.

  • public bool Respawn(float now)

    Puts it back if its timer has run out, and drops a channel whose owner has gone.

  • public bool IsReady(float now)

    Advances a channel and reports whether it was finished by the clock alone.

Used by (1)

  • InteractionTestsVixen.Gameplay.Interaction.Tests