Dict - FireDragon91245/Lua-Linq GitHub Wiki
Creates or clones a dictionary-style collection. A dict stores key/value pairs and inherits the full enumerable pipeline API.
linq.dict(): dict<any, any>
linq.dict<K, V>(table: { [K]: V }): dict<K, V>
linq.dict<K, V>(existing_dict: dict<K, V>): dict<K, V>
linq.dict<K, V>(enumerable: enumerable<K, V>): dict<K, V>
linq.dict<K, V>(iter: iter<K, V>): dict<K, V>
linq.dict(table: table): dict<any, any>dict inherits all enumerable methods such as distinct, where, select, collect, any, max, min, fork, spread, first, last, iter, and tolist. The pages in this section only cover dict-specific behavior.
-
dict:keys()returns an enumerable of keys. -
dict:values()returns an enumerable of values. -
dict:enumerate()returns the key/value enumerable wrapper. -
dict:iter()returns a direct key/value iterator.
local resources = linq.dict({ iron = 30, copper = 45 })local from_iter = linq.dict(linq.dict({ iron = 4, copper = 7 }):iter())