Table of Contents

Struct MarkerRef

Namespace
LansMap.Core.Markers

A name for one marker that works for both tiers: bulk GPU instances and prefab GameObjects. It is not a base class and not a store.

public readonly struct MarkerRef : IEquatable<MarkerRef>
Implements

Remarks

Bulk Handle values are MarkerStore ids. Prefab handles come from WorldMarkerManager (TabletopContentView.Spawn forwards there). The same integer in two tiers is two different markers; compare the whole ref, never the handle alone.

Properties

Handle

Per-tier id. Negative means None. Do not pass a prefab handle to MarkerStore or a bulk handle to WorldMarkerManager.

public int Handle { get; }

Property Value

int

IsNone

True when this does not name a marker.

public bool IsNone { get; }

Property Value

bool

None

No marker. Handle is negative. default(MarkerRef) is not this: it is bulk handle 0, a live first-slot id. Use this property, not default.

public static MarkerRef None { get; }

Property Value

MarkerRef

Tier

Which store this handle is from.

public MarkerTier Tier { get; }

Property Value

MarkerTier

Methods

Bulk(int)

Names a bulk-tier marker. A negative handle becomes None.

public static MarkerRef Bulk(int handle)

Parameters

handle int

Returns

MarkerRef

Equals(MarkerRef)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(MarkerRef other)

Parameters

other MarkerRef

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and this instance are the same type and represent the same value; otherwise, false.

GetHashCode()

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int

A 32-bit signed integer that is the hash code for this instance.

Prefab(int)

Names a GameObject marker from WorldMarkerManager (TabletopContentView.Spawn forwards there). A negative handle becomes None.

public static MarkerRef Prefab(int handle)

Parameters

handle int

Returns

MarkerRef

ToString()

Returns the fully qualified type name of this instance.

public override string ToString()

Returns

string

The fully qualified type name.

WorldBulk(int)

Names a floating tabletop bulk marker whose store is not Map.Markers. A negative handle becomes None. Shared-store tables keep Bulk(int).

public static MarkerRef WorldBulk(int handle)

Parameters

handle int

Returns

MarkerRef

Operators

operator ==(MarkerRef, MarkerRef)

public static bool operator ==(MarkerRef a, MarkerRef b)

Parameters

a MarkerRef
b MarkerRef

Returns

bool

operator !=(MarkerRef, MarkerRef)

public static bool operator !=(MarkerRef a, MarkerRef b)

Parameters

a MarkerRef
b MarkerRef

Returns

bool