Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- span class="re5"> mapGet =
- {
- private _map = param [0, [], [[]], 2];
- private _key = param [1, "", [""]];
- private _find = (_map select 0) find _key;
- if (_find isEqualTo -1) exitWith
- {
- // nil;
- };
- (_map select 1) select _find;
- };
- mapSet =
- {
- private _map = param [0, [], [[]], 2];
- private _key = param [1, "", [""]];
- private _value = param [2];
- private _find = (_map select 0) find _key;
- if (_find isEqualTo -1) exitWith
- {
- (_map select 0) pushBack _key;
- (_map select 1) pushBack _value;
- false;
- };
- (_map select 1) set [_find, _value];
- true;
- };
- mapRemove =
- {
- private _map = param [0, [], [[]], 2];
- private _key = param [1, "", [""]];
- private _find = (_map select 0) find _key;
- if (_find isEqualTo -1) exitWith
- {
- false;
- };
- (_map select 0) deleteAt _find;
- (_map select 1) deleteAt _find;
- true;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement