toGdxMap

inline fun <Key, Value> Iterable<Value>.toGdxMap(initialCapacity: Int = defaultMapSize, loadFactor: Float = defaultLoadFactor, keyProvider: (Value) -> Key): GdxMap<Key, Value>

Return

values copied from this iterable stored in a libGDX map, mapped to the keys returned by the provider.

Parameters

initialCapacity

initial capacity of the map. Will be resized if necessary.

loadFactor

decides how many elements the map might contain in relation to its total capacity before it is resized.

keyProvider

will consume each value in this iterable. The results will be treated as map keys for the values.


inline fun <Type, Key, Value> Iterable<Type>.toGdxMap(initialCapacity: Int = defaultMapSize, loadFactor: Float = defaultLoadFactor, valueProvider: (Type) -> Value, keyProvider: (Type) -> Key): GdxMap<Key, Value>

Return

values converted from this iterable stored in a libGDX map, mapped to the keys returned by the provider.

Parameters

initialCapacity

initial capacity of the map. Will be resized if necessary.

loadFactor

decides how many elements the map might contain in relation to its total capacity before it is resized.

valueProvider

will consume each value in this iterable. The results will be treated as map values.

keyProvider

will consume each value in this iterable. The results will be treated as map keys for the values.


inline fun <Key, Value> Array<Value>.toGdxMap(initialCapacity: Int = defaultMapSize, loadFactor: Float = defaultLoadFactor, keyProvider: (Value) -> Key): GdxMap<Key, Value>

Return

values copied from this array stored in a libGDX map, mapped to the keys returned by the provider.

Parameters

initialCapacity

initial capacity of the map. Will be resized if necessary.

loadFactor

decides how many elements the map might contain in relation to its total capacity before it is resized.

keyProvider

will consume each value in this iterable. The results will be treated as map keys for the values.


inline fun <Type, Key, Value> Array<Type>.toGdxMap(initialCapacity: Int = defaultMapSize, loadFactor: Float = defaultLoadFactor, valueProvider: (Type) -> Value, keyProvider: (Type) -> Key): GdxMap<Key, Value>

Return

values converted from this array stored in a libGDX map, mapped to the keys returned by the provider.

Parameters

initialCapacity

initial capacity of the map. Will be resized if necessary.

loadFactor

decides how many elements the map might contain in relation to its total capacity before it is resized.

valueProvider

will consume each value in this iterable. The results will be treated as map values.

keyProvider

will consume each value in this iterable. The results will be treated as map keys for the values.