#include "..\script_component.hpp"

/*
 * Author: IDSolutions
 * Ensures the organization store is initialized and returns the store object
 *
 * Arguments:
 * None
 *
 * Return Value:
 * Organization Store <OBJECT> - The organization store interface object
 *
 * Example:
 * private _orgStore = call forge_client_org_fnc_verifyOrgStore
 *
 * Public: No
 */

// Attempt to retrieve the existing organization store from the global variable
private _store = GETMVAR(FORGE_ORG_STORE_REG,nil);

// If the store doesn't exist yet, initialize it
if (isNil "_store") then { 
    // Create a new organization store
    _store = call FUNC(initOrgStore); 
    
    // Log the initialization for debugging
    diag_log text "[FORGE Organization] Organization store initialized";
};

// Return the organization store interface
_store