#include "script_component.hpp"

if (isNil QGVAR(BankClass)) then { call FUNC(initBankClass); };

[QGVAR(initBank), {
    GVAR(BankClass) call ["init", []];
}] call CFUNC(addEventHandler);

[QGVAR(responseInitBank), {
    params [["_data", createHashMap, [createHashMap]]];

    GVAR(BankClass) call ["sync", [_data, true]];
}] call CFUNC(addEventHandler);

[QGVAR(responseSyncBank), {
    params [["_data", createHashMap, [createHashMap]], ["_jip", false, [false]]];

    GVAR(BankClass) call ["sync", [_data, _jip]];
}] call CFUNC(addEventHandler);

[{
    EGVAR(org,OrgClass) get "isLoaded";
}, {
    [QGVAR(initBank), []] call CFUNC(localEvent);
}] call CFUNC(waitUntilAndExecute);
