Mapping1D

Description

sealed class Tinman.Engine.Rendering.Util.Mapping1D<T>

Derived from

EnumerableBase<T> abstract

Helper class for creating a one-dimensional uni-directional mapping between 32-bit integer values.

Public / Constructors

Mapping1​D


public constructor Mapping1D → (2)

equals opt : EqualsDelegate<T> = null

The equality delegate for mapped values.

defaultValue opt : T = default(T)

The default value for non-existent entries.

Creates a new instance of Mapping1D.

Public / Methods

Any


[Pure]
public method Any → (1)

second in : T

The second value.

returns → bool

true if at least one first value is mapped to second in,
false if there are none.

Checks if there is a mapping from any first value to the given second in value.

Get


[Pure]
public method Get → (1)

first in : int32

The first value.

returns → T

The second value or the default value if not mapped.

Returns the forward mapping from the given first in value to the second value.

Set


public method Set → (2)

first in : int32

[>=0]
The first value to map.

second in : T

The second value to map.

Establishes a mapping between the given first in and second in values.

Public / Attributes

Count


public attribute Count → (get)

value : int32

[>=0]
The number of mapped values.

The number of mapped values.