コード例 #1
0
        /// <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);
        }
コード例 #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);
        }