/// <summary>
 /// Constructs a <c>XREnvironmentProbeSubsystemDescriptor</c> based on the given parameters.
 /// </summary>
 /// <param name='environmentProbeSubsystemCinfo'>The parameters required to initialize the descriptor.</param>
 XREnvironmentProbeSubsystemDescriptor(XREnvironmentProbeSubsystemCinfo environmentProbeSubsystemCinfo)
 {
     id = environmentProbeSubsystemCinfo.id;
     subsystemImplementationType   = environmentProbeSubsystemCinfo.implementationType;
     supportsManualPlacement       = environmentProbeSubsystemCinfo.supportsManualPlacement;
     supportsRemovalOfManual       = environmentProbeSubsystemCinfo.supportsRemovalOfManual;
     supportsAutomaticPlacement    = environmentProbeSubsystemCinfo.supportsAutomaticPlacement;
     supportsRemovalOfAutomatic    = environmentProbeSubsystemCinfo.supportsRemovalOfAutomatic;
     supportsEnvironmentTexture    = environmentProbeSubsystemCinfo.supportsEnvironmentTexture;
     supportsEnvironmentTextureHDR = environmentProbeSubsystemCinfo.supportsEnvironmentTextureHDR;
 }
 /// <summary>
 /// Constructs a <c>XREnvironmentProbeSubsystemDescriptor</c> based on the given parameters.
 /// </summary>
 /// <param name='environmentProbeSubsystemCinfo'>The parameters required to initialize the descriptor.</param>
 XREnvironmentProbeSubsystemDescriptor(XREnvironmentProbeSubsystemCinfo environmentProbeSubsystemCinfo)
 {
     id                            = environmentProbeSubsystemCinfo.id;
     providerType                  = environmentProbeSubsystemCinfo.providerType;
     subsystemTypeOverride         = environmentProbeSubsystemCinfo.subsystemTypeOverride;
     supportsManualPlacement       = environmentProbeSubsystemCinfo.supportsManualPlacement;
     supportsRemovalOfManual       = environmentProbeSubsystemCinfo.supportsRemovalOfManual;
     supportsAutomaticPlacement    = environmentProbeSubsystemCinfo.supportsAutomaticPlacement;
     supportsRemovalOfAutomatic    = environmentProbeSubsystemCinfo.supportsRemovalOfAutomatic;
     supportsEnvironmentTexture    = environmentProbeSubsystemCinfo.supportsEnvironmentTexture;
     supportsEnvironmentTextureHDR = environmentProbeSubsystemCinfo.supportsEnvironmentTextureHDR;
 }
        /// <summary>
        /// Constructs a <c>XREnvironmentProbeSubsystemDescriptor</c> based on the given parameters.
        /// </summary>
        /// <param name='environmentProbeSubsystemCinfo'>The parameters required to initialize the descriptor.</param>
        XREnvironmentProbeSubsystemDescriptor(XREnvironmentProbeSubsystemCinfo environmentProbeSubsystemCinfo)
        {
            id = environmentProbeSubsystemCinfo.id;
#if UNITY_2020_2_OR_NEWER
            providerType          = environmentProbeSubsystemCinfo.providerType;
            subsystemTypeOverride = environmentProbeSubsystemCinfo.subsystemTypeOverride;
#else
            subsystemImplementationType = environmentProbeSubsystemCinfo.implementationType;
#endif
            supportsManualPlacement       = environmentProbeSubsystemCinfo.supportsManualPlacement;
            supportsRemovalOfManual       = environmentProbeSubsystemCinfo.supportsRemovalOfManual;
            supportsAutomaticPlacement    = environmentProbeSubsystemCinfo.supportsAutomaticPlacement;
            supportsRemovalOfAutomatic    = environmentProbeSubsystemCinfo.supportsRemovalOfAutomatic;
            supportsEnvironmentTexture    = environmentProbeSubsystemCinfo.supportsEnvironmentTexture;
            supportsEnvironmentTextureHDR = environmentProbeSubsystemCinfo.supportsEnvironmentTextureHDR;
        }
        /// <summary>
        /// Creates a <c>XREnvironmentProbeSubsystemDescriptor</c> based on the given parameters validating that the
        /// <c>id</c> and <c>implentationType</c> properties are specified.
        /// </summary>
        /// <param name='environmentProbeSubsystemCinfo'>The parameters required to initialize the descriptor.</param>
        /// <returns>
        /// The created <c>XREnvironmentProbeSubsystemDescriptor</c>.
        /// </returns>
        /// <exception cref="ArgumentException">Thrown when the values specified in the
        /// <paramref name="environmentProbeSubsystemCinfo"/> parameter are invalid. Typically, this will occur
        /// <list type="bullet">
        /// <item>
        /// <description>if <see cref="XREnvironmentProbeSubsystemCinfo.id"/> is <c>null</c> or empty</description>
        /// </item>
        /// <item>
        /// <description>if <see cref="XREnvironmentProbeSubsystemCinfo.implementationType"/> is <c>null</c>
        /// </description>
        /// </item>
        /// <item>
        /// <description>if <see cref="XREnvironmentProbeSubsystemCinfo.implementationType"/> does not derive from the
        /// <c>XREnvironmentProbeSubsystem</c> class
        /// </description>
        /// </item>
        /// </list>
        /// </exception>
        internal static XREnvironmentProbeSubsystemDescriptor Create(XREnvironmentProbeSubsystemCinfo environmentProbeSubsystemCinfo)
        {
            if (String.IsNullOrEmpty(environmentProbeSubsystemCinfo.id))
            {
                throw new ArgumentException("Cannot create environment probe subsystem descriptor because id is invalid",
                                            "environmentProbeSubsystemCinfo");
            }

            if ((environmentProbeSubsystemCinfo.implementationType == null) ||
                !environmentProbeSubsystemCinfo.implementationType.IsSubclassOf(typeof(XREnvironmentProbeSubsystem)))
            {
                throw new ArgumentException("Cannot create environment probe subsystem descriptor because implementationType is invalid",
                                            "environmentProbeSubsystemCinfo");
            }

            return(new XREnvironmentProbeSubsystemDescriptor(environmentProbeSubsystemCinfo));
        }
        /// <summary>
        /// Registers a subsystem implementation based on the given subystem parameters.
        /// </summary>
        /// <param name='environmentProbeSubsystemCinfo'>The parameters defining the environment probe functionality
        /// implemented by the subsystem provider.</param>
        /// <returns>
        /// <c>true</c> if the subsystem implementation is registered. Otherwise, <c>false</c>.
        /// </returns>
        /// <exception cref="ArgumentException">Thrown when the values specified in the
        /// <paramref name="environmentProbeSubsystemCinfo"/> parameter are invalid. Typically, this will occur
        /// <list type="bullet">
        /// <item>
        /// <description>if <see cref="XREnvironmentProbeSubsystemCinfo.id"/> is <c>null</c> or empty</description>
        /// </item>
        /// <item>
        /// <description>if <see cref="XREnvironmentProbeSubsystemCinfo.implementationType"/> is <c>null</c>
        /// </description>
        /// </item>
        /// <item>
        /// <description>if <see cref="XREnvironmentProbeSubsystemCinfo.implementationType"/> does not derive from the
        /// <c>XREnvironmentProbeSubsystem</c> class
        /// </description>
        /// </item>
        /// </list>
        /// </exception>
        public static bool Register(XREnvironmentProbeSubsystemCinfo environmentProbeSubsystemCinfo)
        {
            XREnvironmentProbeSubsystemDescriptor environmentProbeSubsystemDescriptor = XREnvironmentProbeSubsystemDescriptor.Create(environmentProbeSubsystemCinfo);

            return(SubsystemRegistration.CreateDescriptor(environmentProbeSubsystemDescriptor));
        }