SimpleMap63

Description

sealed class Tinman.Terrain.Util.SimpleMap63

The SimpleMap63 is a specialized dictionary container that maps 63-bit integer keys to values that are stored in a compact array.

Public / Constructors

SimpleMap63


public constructor SimpleMap63 → (1)

initialCapacity opt : int32 = 0

[>=0]
The initial capacity, in key/value pairs.

Creates a new instance of SimpleMap63.

Public / Methods

Clear


public method Clear → ()

Removes all key/value pairs.

Copy


public method Copy → (1)

other in : SimpleMap63

[not-null]
The map to copy from.

Copies all key/value pairs in the given map into this one, overwriting any existing key/value pairs.

Get


[Pure]
public method Get → (2)

key in : int64

The 63-bit integer key.

defaultValue opt : int32 = 0

The default value to return in case no mapping exists.

returns → int32

The mapped mesh sector value.

Returns a mapped value.

GetIndex


[Pure]
public method GetIndex → (1)

key in : int64

The 63-bit integer key.

returns → int32

The value index in the Values array or -1 if no mapping exists.

Returns the index of a mapped value.

Put


public method Put → (2)

key in : int64

The 63-bit integer key.

value in : int32

The value to map.

returns → int32

The value index in the Values array.

Maps the given value to the specified key.

PutIndex


public method PutIndex → (2)

key in : int64

The 63-bit integer key.

defaultValue opt : int32 = 0

The default value to use for adding a new mapping.

returns → int32

The value index in the Values array.

Returns the value index of the given key, adding a new mapping using the given default value, if necessary.

Public / Attributes

Count


public attribute Count → (get)

value : int32

[>=0]
The number of key/value pairs.

The number of key/value pairs.

The mapped values are stored in Values in the index range [0..Count[.

Keys


public attribute Keys → (int64 [ ])

The mapped keys, plus one (zero marks an empty entry).

Values


public attribute Values → (int32 [ ])

The mapped values.