Exemplo n.º 1
0
        /// <summary>
        /// Generates a <see cref="NMGenParams"/> based on the the object
        /// values.
        /// </summary>
        /// <returns>A configuration based on the object values.</returns>
        public NMGenParams GetConfig()
        {
            NMGenParams result = mRoot.Clone();

            ApplyLocalsTo(result);

            return(result);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Sets the configuration to match the provided configuration.
        /// </summary>
        /// <remarks>
        /// <para>
        /// The <paramref name="config"/> parameter will be cleaned during this operation.
        /// </para>
        /// </remarks>
        /// <param name="config">The configuration to match.</param>
        public void SetConfig(NMGenParams config)
        {
            if (config == null)
            {
                return;
            }

            mRoot = config.Clone();
            mRoot.Clean();
            UpdateLocalsFrom(mRoot);
        }
Exemplo n.º 3
0
 private TileSetDefinition(int width, int depth
                           , Vector3 boundsMin, Vector3 boundsMax
                           , NMGenParams config
                           , InputGeometry geom)
 {
     // Note: The constructor is private, which is why
     // the references are being stored.
     mBaseConfig = config.Clone();
     mGeometry   = geom;
     mWidth      = width;
     mDepth      = depth;
     mBoundsMin  = boundsMin;
     mBoundsMax  = boundsMax;
 }
        private IncrementalBuilder(NMGenTileParams tileConfig
                                   , NMGenParams config
                                   , NMGenAssetFlag resultOptions
                                   , InputGeometry source
                                   , ProcessorSet processors)
        {
            mConfig     = config;
            mTileConfig = tileConfig;

            mGeometry      = source;
            mProcessors    = processors;
            mResultOptions = resultOptions;

            mBuildContext = new NMGenContext(tileConfig.TileX, tileConfig.TileZ, mConfig.Clone());

            mTileText = string.Format("({0},{1})", tileConfig.TileX, tileConfig.TileZ);

            mState = NMGenState.Initialized;
        }
Exemplo n.º 5
0
 /// <summary>
 /// Gets a copy of the shared NMGen configuration.
 /// </summary>
 /// <returns>A copy of the shared NMGen configuration.</returns>
 public NMGenParams GetBaseConfig()
 {
     return(mBaseConfig.Clone());
 }