示例#1
0
        public void TestVmfFormatLoading()
        {
            var format = new HammerVmfFormat();

            foreach (var file in Directory.GetFiles(@"D:\Downloads\formats\vmf"))
            {
                using (var r = File.OpenRead(file))
                {
                    try
                    {
                        format.Read(r);
                    }
                    catch (Exception ex)
                    {
                        Assert.Fail($"Unable to read file: {Path.GetFileName(file)}. {ex.Message}");
                    }
                }
            }
        }
        public void TestVmfFormatLoading()
        {
            HammerVmfFormat format = new HammerVmfFormat();

            foreach (string file in Directory.GetFiles(@"D:\Documents\GModDcomps"))
            {
                using FileStream r = File.OpenRead(file);
                try
                {
                    Console.WriteLine($"Reading {file}");
                    MapFile file_data = format.Read(r);
                    Console.WriteLine(file_data.Worldspawn.Children[10]);
                }
                catch (Exception ex)
                {
                    if (file.ToLower().Contains(".map"))
                    {
                        Assert.Fail($"Unable to read file: {Path.GetFileName(file)}. {ex.Message}");
                    }
                }
            }
        }