#include "..\script_component.hpp"

params [["_armory_data", [], [[]]], ["_garage_data", [], [[]]]];

if (count _armory_data isEqualTo [""]) then { _armory_data = [[],[],[],[]] };
if (count _garage_data isEqualTo [""]) then { _garage_data = [[],[],[],[],[],[]] };
if (GVAR(armory_type) == 0) then {
    {
        [GVAR(gear_box), _x, false, true, 1, _forEachIndex] call BFUNC(addVirtualItemCargo);
    } forEach _armory_data;
} else {
    {
        [GVAR(gear_box), _x] call AFUNC(arsenal,addVirtualItems);
    } forEach _armory_data;
};

GVAR(armory_unlocks) = _armory_data;
GVAR(garage_unlocks) = _garage_data;

GVAR(item_unlocks) = _armory_data select 0;
GVAR(weapon_unlocks) = _armory_data select 1;
GVAR(magazine_unlocks) = _armory_data select 2;
GVAR(backpack_unlocks) = _armory_data select 3;

GVAR(car_unlocks) = _garage_data select 0;
GVAR(armor_unlocks) = _garage_data select 1;
GVAR(heli_unlocks) = _garage_data select 2;
GVAR(plane_unlocks) = _garage_data select 3;
GVAR(naval_unlocks) = _garage_data select 4;
GVAR(static_unlocks) = _garage_data select 5;

{
    [_x] call FUNC(addVirtualVehicles);
} forEach GVAR(garage_unlocks);

TRACE_2("Arsenal System Initialized with defaults",count GVAR(armory_unlocks),count GVAR(garage_unlocks));