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); }
public int AddRectangle(PhysicsRectangle a) { if (a.Hit == null) { a.Hit = new object[4]; } return(PhysicsRectangles.Add(a)); }
public ECSEntityHandle GetNewEntity() { ECSEntityHandle newEntity = new ECSEntityHandle(0); int EntityID = entitys.Add(newEntity); newEntity.SetID(EntityID); return(newEntity); }
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)); }
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); } }
public void AddToEntity(object Component, ECSEntityHandle entity) { int Index = Components.Add(Tuple.Create(Component, entity)); entity.Components.Add(new Tuple <Type, int>(ComponentType, Index)); }
public int AddSystem(BaseECSSystem system) { return(systems.Add(system)); }