You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
570 B
22 lines
570 B
extends Reference
|
|
|
|
|
|
var _keys: Array = []
|
|
var _values: Array = []
|
|
|
|
var parameters: Dictionary = {}
|
|
#parameters([["a", "b", "expected"], [2, 2, 4], [5, 5, 10], [7, 7, 14]])
|
|
func parameters(list: Array) -> bool:
|
|
if _keys.empty() or _values.empty():
|
|
# Keys aren't empty, so we'll be updating this implicilty every time a call is made instead
|
|
_keys = list.pop_front()
|
|
_values = list
|
|
return _update()
|
|
|
|
func _update() -> bool:
|
|
parameters.clear()
|
|
var values = _values.pop_front()
|
|
for i in _keys.size():
|
|
parameters[_keys[i]] = values[i]
|
|
return not _values.empty()
|