Beispiel #1
0
        /// <summary>
        /// Creates an instance of <see cref="EnvironmentInitializerFactory"/> class.
        /// </summary>
        /// <param name="metaContext">The Context to acces to the required services.</param>
        /// <param name="environmentScanControllerPrefab">The scan selector prefab used to control the environment reconstruction.</param>
        internal EnvironmentInitializerFactory(IMetaContextInternal metaContext, BaseEnvironmentScanController environmentScanControllerPrefab)
        {
            if (metaContext == null)
            {
                throw new ArgumentNullException("metaContext");
            }

            _metaContext = metaContext;
            _environmentScanControllerPrefab = environmentScanControllerPrefab;
            _metaLocalization             = _metaContext.Get <MetaLocalization>();
            _environmentProfileRepository = _metaContext.Get <IEnvironmentProfileRepository>();
            _slamLocalizer = GameObject.FindObjectOfType <SlamLocalizer>();
        }
Beispiel #2
0
        /// <summary>
        /// Creates an instance of <see cref="EnvironmentInitializer"/> class.
        /// </summary>
        /// <param name="environmentInitialization">The object to initialize an environment.</param>
        /// <param name="environmentReset">The object to reset the current environment.</param>
        /// <param name="metaLocalization">The object that handles the world localization.</param>
        public EnvironmentInitializer(IEnvironmentInitialization environmentInitialization, IEnvironmentReset environmentReset, MetaLocalization metaLocalization)
        {
            if (environmentInitialization == null)
            {
                throw new ArgumentNullException("environmentInitialization");
            }

            if (environmentReset == null)
            {
                throw new ArgumentNullException("environmentReset");
            }

            if (metaLocalization == null)
            {
                throw new ArgumentNullException("metaLocalization");
            }

            _environmentInitialization = environmentInitialization;
            _environmentReset          = environmentReset;
            metaLocalization.LocalizationReset.AddListener(Reset);
        }
        /// <summary>
        /// Creates an instance of <see cref="EnvironmentProfileInitializer"/> class.
        /// </summary>
        /// <param name="environmentProfileSelector">The object to select an environment profile.</param>
        /// <param name="environmentInitializationFactory">The factory to create an environment initialization object.</param>
        /// <param name="environmentReset">The object to reset the current environment.</param>
        /// <param name="metaLocalization">The object that handles the world localization.</param>
        public EnvironmentProfileInitializer(IEnvironmentProfileSelector environmentProfileSelector, IEnvironmentInitializationFactory environmentInitializationFactory, IEnvironmentReset environmentReset, MetaLocalization metaLocalization)
        {
            if (environmentProfileSelector == null)
            {
                throw new ArgumentNullException("environmentProfileSelector");
            }

            if (environmentInitializationFactory == null)
            {
                throw new ArgumentNullException("environmentInitializationFactory");
            }

            if (environmentReset == null)
            {
                throw new ArgumentNullException("environmentReset");
            }

            if (metaLocalization == null)
            {
                throw new ArgumentNullException("metaLocalization");
            }

            _environmentProfileSelector       = environmentProfileSelector;
            _environmentInitializationFactory = environmentInitializationFactory;
            _environmentReset = environmentReset;

            _environmentProfileSelector.EnvironmentSelected.AddListener(EnvironmentSelected);
            metaLocalization.LocalizationReset.AddListener(Reset);
        }