Ejemplo n.º 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);
                }
            }
        }
Ejemplo n.º 3
0
 public void GenerateMeshData(List <Chunk> chunks)
 {
     m_BatchProcessor.Process(chunks, GenerateMeshData, true);
     chunks.Sort(ChunksComparedByDistanceFromMapCenter);
     m_ChunkProcessor.AddChunksToMeshCreationQueue(chunks);
 }
Ejemplo n.º 4
0
 public void GenerateMeshes(List <Chunk> chunks)
 {
     m_BatchProcessor.Process(1, chunks, GenerateMesh, false);
 }
Ejemplo n.º 5
0
 public void LightChunks(List <Chunk> chunks)
 {
     m_BatchProcessor.Process(chunks, LightChunk, true);
 }
Ejemplo n.º 6
0
 public void GenerateWorldDecorations(List <Chunk> chunks)
 {
     m_BatchProcessor.Process(chunks, GenerateDecorationsForChunk, true);
 }
Ejemplo n.º 7
0
 public void LightChunks(List <Chunk> chunks)
 {
     m_BatchProcessor.Process(chunks, LightChunk, true);
     //m_ChunkProcessor.AddChunksToMeshDataCreationQueue(chunks);
     //m_ChunkProcessor.ClearLightingQueue();
 }
Ejemplo n.º 8
0
 static async Task Main(string[] args)
 {
     var             serviceProvider = new Startup().GetServiceProvider();
     IBatchProcessor batchProcessor  = serviceProvider.GetService <IBatchProcessor>();
     await batchProcessor.Process();
 }
Ejemplo n.º 9
0
 public void GenerateChunkTerrain(List <Chunk> chunks)
 {
     m_BatchProcessor.Process(chunks, GenerateTerrain, true);
 }