public SimulationRecorder(IUniverse universe, float duration, float framesPerSecond) { Universe = universe; Duration = duration; FramesPerSecond = framesPerSecond; snapshots = new SerializedUniverse(universe.BodyCount, duration, framesPerSecond); }
private void OutputFrames(SerializedUniverse universe) { using (Stream stream = new FileStream("output.bin", FileMode.Create, FileAccess.Write, FileShare.None)) { byte[] data = universe.Serialize(); stream.Write(data, 0, data.Length); } }