コード例 #1
0
ファイル: Program.cs プロジェクト: MarcoDorantes/spike
    static void to_file()
    {
      var packer =
      //new SingleLevelMapFormatter();
      new MultiLevelMapFormatter();

      var packets = new List<byte[]>();
      var x = new packmap(packer);
      x.start(packet => packets.Add(packet));
      using (var writer = System.IO.File.Create("map1.dat"))
      {
        var packet = packets[0];
        writer.Write(packet, 0, packet.Length);
      }
    }
コード例 #2
0
ファイル: Program.cs プロジェクト: MarcoDorantes/spike
    static void test_limit_count()
    {
      var packer =
      //new MapFormatter();//built_in
      //new SingleLevelMapPacker();//custom
      new MultiLevelMapFormatter();

      var packets = new List<byte[]>();
      var x = new packmap(packer);
      var watch = System.Diagnostics.Stopwatch.StartNew();
      x.start(packet => packets.Add(packet));
      watch.Stop();
      WriteLine($"Done:{packets.Count} in {watch.ElapsedMilliseconds}ms");
      x.otherend(packets);
      WriteLine($"Checked:{packets.Count}");
    }