2015-01-11 16:42:31 +00:00
|
|
|
/*
|
|
|
|
* Author: KoffeinFlummi, commy2
|
2016-02-06 10:42:35 +00:00
|
|
|
* Applies given code to every element in an array, LIKE SOMETHING SQF SHOULD HAVE BY DEFAULT. <- :kappa:
|
2015-01-11 16:42:31 +00:00
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Array to be thingied.
|
|
|
|
* 1: Code to be applied to every element.
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* Final array
|
|
|
|
*
|
2015-09-20 14:56:35 +00:00
|
|
|
* Public: Yes
|
2016-02-06 10:42:35 +00:00
|
|
|
*
|
|
|
|
* Deprecated
|
2015-01-11 16:42:31 +00:00
|
|
|
*/
|
2015-01-13 19:56:02 +00:00
|
|
|
#include "script_component.hpp"
|
2015-01-11 16:42:31 +00:00
|
|
|
|
2015-12-12 15:48:54 +00:00
|
|
|
params [["_array", [], [[]]], ["_code", {}, [{}]]];
|
2015-01-11 16:42:31 +00:00
|
|
|
|
2016-02-06 10:58:31 +00:00
|
|
|
ACE_DEPRECATED("ace_common_fnc_map","3.7.0","apply");
|
2016-02-06 10:42:35 +00:00
|
|
|
|
2015-09-18 19:46:21 +00:00
|
|
|
// copy array to not alter the original one
|
|
|
|
_array = + _array;
|
2015-01-11 16:42:31 +00:00
|
|
|
|
|
|
|
{
|
2015-05-14 18:06:06 +00:00
|
|
|
_array set [_forEachIndex, _x call _code];
|
2015-01-11 16:42:31 +00:00
|
|
|
} forEach _array;
|
2015-09-20 14:40:49 +00:00
|
|
|
|
2015-01-11 16:42:31 +00:00
|
|
|
_array
|