Example #1
0
    static void to_file()
    {
      var packer =
      //new SingleLevelMapPacker();
      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);
      }
    }
Example #2
0
    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}");
    }