예제 #1
0
 public void GenerateTerrain(List <Chunk> chunks)
 {
     if (chunks.Count == 0)
     {
         return;
     }
     m_BatchProcessor.Process(chunks, GenerateTerrain, true);
 }
        public void ProcessBatch()
        {
            if (CanNextBatchBeProcessed(_dbContext.ProcessorLastExecution.LastRun, _dbContext.BatchConfiguration.LatencyInSeconds))
            {
                var nextBatch = GetNextNewBatchToProcess();

                if (nextBatch != null)
                {
                    var status = ProcessStatus.Completed;
                    try
                    {
                        _batchProcessor.Process(nextBatch);
                    }
                    catch (Exception ex)
                    {
                        status = ProcessStatus.Failed;
                        // log the exception
                    }
                    UpdateBatchStatus(nextBatch.Id, status);
                    UpdateLastRunBatchProcessorExecution(nextBatch.Id, DateTime.Now);
                }
            }
        }
예제 #3
0
 public void GenerateMeshData(List <Chunk> chunks)
 {
     m_BatchProcessor.Process(chunks, GenerateMeshData, true);
     chunks.Sort(ChunksComparedByDistanceFromMapCenter);
     m_ChunkProcessor.AddChunksToMeshCreationQueue(chunks);
 }
예제 #4
0
 public void GenerateMeshes(List <Chunk> chunks)
 {
     m_BatchProcessor.Process(1, chunks, GenerateMesh, false);
 }
예제 #5
0
 public void LightChunks(List <Chunk> chunks)
 {
     m_BatchProcessor.Process(chunks, LightChunk, true);
 }
예제 #6
0
 public void GenerateWorldDecorations(List <Chunk> chunks)
 {
     m_BatchProcessor.Process(chunks, GenerateDecorationsForChunk, true);
 }
예제 #7
0
 public void LightChunks(List <Chunk> chunks)
 {
     m_BatchProcessor.Process(chunks, LightChunk, true);
     //m_ChunkProcessor.AddChunksToMeshDataCreationQueue(chunks);
     //m_ChunkProcessor.ClearLightingQueue();
 }
예제 #8
0
 static async Task Main(string[] args)
 {
     var             serviceProvider = new Startup().GetServiceProvider();
     IBatchProcessor batchProcessor  = serviceProvider.GetService <IBatchProcessor>();
     await batchProcessor.Process();
 }
예제 #9
0
 public void GenerateChunkTerrain(List <Chunk> chunks)
 {
     m_BatchProcessor.Process(chunks, GenerateTerrain, true);
 }