Пример #1
0
 public SimulationRecorder(IUniverse universe, float duration, float framesPerSecond)
 {
     Universe        = universe;
     Duration        = duration;
     FramesPerSecond = framesPerSecond;
     snapshots       = new SerializedUniverse(universe.BodyCount, duration, framesPerSecond);
 }
Пример #2
0
 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);
     }
 }