Table of Contents

Class HoverClaimArbiter

Namespace
LansMap.Core.Control

Frame-scoped arbitration so the cursor-nearest claimant wins the shared hover tooltip.

public sealed class HoverClaimArbiter
Inheritance
object
HoverClaimArbiter

Remarks

Within a frame the first claim stands until a strictly closer one arrives; a claim from an earlier frame never beats one from the current frame. The caller supplies the frame counter; this type is pure and has no Unity frame loop of its own.

Methods

Claim(long, object, double)

Claims this frame's hover for the given claimant if it is the first or closest claimant so far.

public void Claim(long frame, object claimant, double distanceSq)

Parameters

frame long

Caller-supplied frame counter.

claimant object

Claimant identity.

distanceSq double

Squared cursor distance; lower wins.

ReleaseStale(long, Func<object, bool>)

Drops the claim once its frame has passed or its claimant is gone.

public void ReleaseStale(long frame, Func<object, bool> isAlive)

Parameters

frame long

Caller-supplied frame counter.

isAlive Func<object, bool>

Tests whether a still-current claimant is alive; not called when there is no claim.

Reset()

Clears the claim so the next Claim starts a new frame.

public void Reset()

Winner(long)

This frame's claim, or null when nothing has claimed it yet.

public object Winner(long frame)

Parameters

frame long

Caller-supplied frame counter.

Returns

object