예제 #1
0
        private async Task FinishOutput(BuildState buildState, JobCompletedEventArgs jobCompletedEventArgs)
        {
            if (buildOutputStream != null)
            {
                await buildOutputStream.FlushAsync();

                buildOutputStream.Flush(flushToDisk: true);
                await buildOutputStream.DisposeAsync();
            }

            int extraChars = outputDecoder.GetCharCount(Array.Empty <byte>(), 0, 0, flush: true);

            if (extraChars > 0)
            {
                var decoded = new char[extraChars];
                outputDecoder.GetChars(Array.Empty <byte>(), 0, 0, decoded, 0, flush: true);
                AppendLineChars(decoded);
            }

            await FileUtil.WriteAllTextToDiskAsync(
                Path.Combine(buildDir, "result.json"),
                JsonConvert.SerializeObject(new JobBuildResult {
                State = buildState,
            }),
                Encoding.UTF8,
                CancellationToken.None
                );

            outputLines.Add(currentLine.ToString());
            OutputLinesChanged?.Invoke(this, new OutputLinesChangedEventArgs(outputLines));

            state = buildState;
            complete.TrySetResult(null);
            JobCompleted?.Invoke(this, jobCompletedEventArgs);
        }
예제 #2
0
 public int AddRectangle(PhysicsRectangle a)
 {
     if (a.Hit == null)
     {
         a.Hit = new object[4];
     }
     return(PhysicsRectangles.Add(a));
 }
예제 #3
0
        public ECSEntityHandle GetNewEntity()
        {
            ECSEntityHandle newEntity = new ECSEntityHandle(0);
            int             EntityID  = entitys.Add(newEntity);

            newEntity.SetID(EntityID);
            return(newEntity);
        }
예제 #4
0
        private async Task WriteOutput(string s)
        {
            if (outputStreamWriter == null)
            {
                outputStreamWriter = new StreamWriter(new FileStream(Path.Combine(buildDir, "output.log"), FileMode.Create, FileAccess.Write, FileShare.Read, 4096, FileOptions.Asynchronous | FileOptions.SequentialScan));
            }

            await outputStreamWriter.WriteLineAsync(s);

            outputLines.Add(s);
            OutputLinesChanged?.Invoke(this, new OutputLinesChangedEventArgs(outputLines));
        }
예제 #5
0
 public int RegisterNewComponentPool <T>() where T : IBaseECSComponent
 {
     if (valuePairs.ContainsKey(typeof(T)))
     {
         throw new Exception("ComponentType:" + typeof(T) + " Already Exists in component pools");
     }
     else
     {
         int newID = EcsComponentPools.Add(new ECSComponentPool(typeof(T), this));
         valuePairs.Add(typeof(T), newID);
         return(newID);
     }
 }
예제 #6
0
        public void AddToEntity(object Component, ECSEntityHandle entity)
        {
            int Index = Components.Add(Tuple.Create(Component, entity));

            entity.Components.Add(new Tuple <Type, int>(ComponentType, Index));
        }
예제 #7
0
 public int AddSystem(BaseECSSystem system)
 {
     return(systems.Add(system));
 }