Mapping2D

Description

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

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

Public / Constructors

Mapping2​D


public constructor Mapping2D → (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 Mapping2D.

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 → (2)

firstX in : int32

X-component of the first value.

firstY in : int32

Y-component of the first value.

returns → T

The second value or the default value if not mapped.

Returns the forward mapping from the given firstX in/ firstY in value to the second value.

Set


public method Set → (3)

firstX in : int32

[>=0]
X-component of the first value to map.

firstY in : int32

[>=0]
Y-component of the first value to map.

second in : T

The second value to map.

Establishes a mapping between the given firstX in/ firstY in and second in values.

Public / Attributes

Count​X


public attribute CountX → (get)

value : int32

[>=0]
The number of mapped values along the X-axis.

The number of mapped values along the X-axis.

Count​Y


public attribute CountY → (get)

value : int32

[>=0]
The number of mapped values along the Y-axis.

The number of mapped values along the Y-axis.