Ejemplo n.º 1
0
        public void Dump(StreamWriter sw, int level)
        {
            var ident = new String(' ', 2 * level);

            sw.WriteLine($"{ident}Ehdr >");
            Ehdr.Dump(sw, level + 1);
            sw.WriteLine($"{ident}ComponentCount={ComponentCount}");
            sw.WriteLine($"{ident}Dummy1={Dummy1}");
            sw.WriteLine($"{ident}RMatrix >");
            RMatrix.Dump(sw, level + 1);
            sw.WriteLine($"{ident}ViewportGlobalRect >");
            ViewportGlobalRect.Dump(sw, level + 1);
            sw.WriteLine($"{ident}Origin >");
            Origin.Dump(sw, level + 1);
            sw.WriteLine($"{ident}Delta >");
            Delta.Dump(sw, level + 1);
            for (int i = 0; i < 5; i++)
            {
                sw.WriteLine($"{ident}Y[{i}]={Y[i]}");
            }
            sw.WriteLine($"{ident}ActiveZ={ActiveZ}");
            sw.WriteLine($"{ident}PixelRect >");
            PixelRect.Dump(sw, level + 1);
            sw.WriteLine($"{ident}Flags >");
            Flags.Dump(sw, level + 1);
            sw.WriteLine($"{ident}Dummy4={Dummy4}");
            sw.WriteLine($"{ident}ViewNumber={ViewNumber}");
            sw.WriteLine($"{ident}ModelId={ModelId}");
            for (int i = 0; i < 8; i++)
            {
                sw.WriteLine($"{ident}Z[{i}]={Z[i]}");
            }
            if (!string.IsNullOrEmpty(Name))
            {
                sw.WriteLine($"{ident}Name={Name}");
            }
            if (!string.IsNullOrEmpty(Name))
            {
                sw.WriteLine($"{ident}Description={Description}");
            }
            if (Linkages.Length > 0)
            {
                sw.WriteLine($"{ident}Attribute Linkages > ({Linkages.Length} items)");
                for (int i = 0; i < Linkages.Length; i++)
                {
                    Linkages[i].Dump(sw, level + 1);
                }
            }
            if (V8FileLoader.Xattributes.ContainsKey(Ehdr.UniqueId))
            {
                var xattributes = V8FileLoader.Xattributes[Ehdr.UniqueId];
                if (xattributes != null)
                {
                    sw.WriteLine($"{ident}XAttribute Linkages > ({xattributes.Count} items)");
                    foreach (var xattribute in xattributes)
                    {
                        xattribute.Dump(sw, level + 1);
                    }
                }
            }
        }