{
    "Function": "_getSubComponents",
    "File": "registries/contracts/AgentRegistry.sol",
    "Parent Contracts": [
        "registries/contracts/UnitRegistry.sol",
        "registries/contracts/GenericRegistry.sol",
        "registries/lib/solmate/src/tokens/ERC721.sol",
        "registries/contracts/interfaces/IErrorsRegistries.sol"
    ],
    "High-Level Calls": [
        "IRegistry"
    ],
    "Internal Calls": [],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "function _getSubComponents(UnitType subcomponentsFromType, uint32 unitId) internal view virtual override\n        returns (uint32[] memory subComponentIds)\n    {\n        // Self contract (agent registry) can only call subcomponents calculation from the component level (0)\n        // Otherwise, the subcomponents are already written into the corresponding subcomponents map\n        if (subcomponentsFromType == UnitType.Component) {\n            (subComponentIds, ) = IRegistry(componentRegistry).getLocalSubComponents(uint256(unitId));\n        } else {\n            subComponentIds = mapSubComponents[uint256(unitId)];\n        }\n    }"
}