public static TerrainShapeDb CreateTerrainShapeDb(TerrainDetailProvider terrainDetailProvider, CommonExecutorUTProxy commonExecutorUtProxy,
                                                          TerrainDetailAlignmentCalculator terrainDetailAlignmentCalculator, bool mergingEnabled, bool saveTexturesToFile, bool loadTexturesFromFile,
                                                          TerrainDetailFileManager fileManager)
        {
            var cachingConfiguration = new CachingConfiguration()
            {
                SaveAssetsToFile = saveTexturesToFile,
                UseFileCaching   = loadTexturesFromFile
            };

            Func <IAssetsCache <InternalTerrainDetailElementToken, TextureWithSize> > terrainCacheGenerator =
                () => new InMemoryAssetsCache <InternalTerrainDetailElementToken, TextureWithSize>(
                    CreateLevel2AssetsCache <InternalTerrainDetailElementToken, TextureWithSize>(
                        cachingConfiguration,
                        new InMemoryCacheConfiguration(),
                        new TextureWithSizeActionsPerformer(commonExecutorUtProxy),
                        new CachingTerrainDetailFileManager(fileManager)));

            var cachedTerrainDetailProvider = new CachedTerrainDetailProvider(
                terrainDetailProvider,
                terrainCacheGenerator, mergingEnabled);

            cachedTerrainDetailProvider.Initialize().Wait();
            var terrainShapeDb = new TerrainShapeDb(cachedTerrainDetailProvider, terrainDetailAlignmentCalculator);

            return(terrainShapeDb);
        }
 public TerrainDetailCornerMerger(LateAssignFactory <BaseTerrainDetailProvider> terrainDetailProviderFactory,
                                  TerrainDetailAlignmentCalculator alignmentCalculator, UTTextureRendererProxy renderer, TextureConcieverUTProxy textureConciever,
                                  CommonExecutorUTProxy commonExecutor, TerrainDetailCornerMergerConfiguration configuration)
 {
     _terrainDetailProviderFactory = terrainDetailProviderFactory;
     _alignmentCalculator          = alignmentCalculator;
     _renderer            = renderer;
     _textureConciever    = textureConciever;
     this._commonExecutor = commonExecutor;
     _configuration       = configuration;
 }