2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2015-01-11 16:42:31 +00:00
|
|
|
/*
|
|
|
|
* Author: commy2
|
|
|
|
* Convert an array of booleans into a number.
|
|
|
|
*
|
2015-09-17 16:25:02 +00:00
|
|
|
* Arguments:
|
2023-04-30 21:03:35 +00:00
|
|
|
* 0: Boolean <BOOL>
|
|
|
|
* 1: Boolean <BOOL>
|
|
|
|
* 2: Boolean <BOOL>
|
|
|
|
* ...
|
2015-01-11 16:42:31 +00:00
|
|
|
*
|
2015-09-17 16:25:02 +00:00
|
|
|
* Return Value:
|
2015-09-19 22:55:58 +00:00
|
|
|
* Bitmask <NUMBER>
|
2015-09-17 16:25:02 +00:00
|
|
|
*
|
2017-06-08 13:31:51 +00:00
|
|
|
* Example:
|
|
|
|
* [[true, false]] call ace_common_fnc_toBitmask
|
|
|
|
*
|
2015-09-17 16:25:02 +00:00
|
|
|
* Public: Yes
|
2015-01-11 16:42:31 +00:00
|
|
|
*/
|
|
|
|
|
2015-12-14 12:08:19 +00:00
|
|
|
private _result = 0;
|
2015-09-19 22:55:58 +00:00
|
|
|
|
2015-01-11 16:42:31 +00:00
|
|
|
{
|
2015-05-14 18:06:06 +00:00
|
|
|
if (_x) then {_result = _result + 2 ^ _forEachIndex};
|
2015-09-20 13:52:40 +00:00
|
|
|
} forEach _this;
|
2015-01-11 16:42:31 +00:00
|
|
|
|
|
|
|
_result
|