using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using HaloObjects;

namespace HaloPlugins.Xbox
{
    public class coll
    {
       public List<MetaNode> Fields = new List<MetaNode>();

       public coll()
       {
           Fields.AddRange(new MetaNode[] {
           new Unused(20),
           new Reflexive("Materials", 4, new MetaNode[] { 
               new StringID("Name"),
           }),
           new Reflexive("Regions", 12, new MetaNode[] { 
               new StringID("Name"),
               new Reflexive("Premutations", 20, new MetaNode[] { 
                   new StringID("Name"),
                   new Reflexive("BSP", 68, new MetaNode[] { 
                       new Value("Root Node Index", typeof(int)),
                       new Reflexive("3D Nodes", 8, 8, new MetaNode[] { 
                           new Value("Plane", typeof(short)),
                           new Value("First Child", typeof(short)),
                           new Value("Unknown", typeof(byte)),
                           new Value("Second Child", typeof(short)),
                           new Value("Unknown", typeof(byte)),
                       }),
                       new Reflexive("Planes", 16, 16, new MetaNode[] { 
                           new Value("i", typeof(float)),
                           new Value("I", typeof(float)),
                           new Value("k", typeof(float)),
                           new Value("d", typeof(float)),
                       }),
                       new Reflexive("Leaves", 4, 16, new MetaNode[] { 
                           new Bitmask("Flags", new string[] { "Contains_Double_Sided_Surfaces" }, 8),
                           new Value("2D Reference COunt", typeof(byte)),
                           new Value("First 2D Reference", typeof(short)),
                       }),
                       new Reflexive("2D Refrences", 4, new MetaNode[] { 
                           new Value("Plane", typeof(short)),
                           new Value("Node", typeof(short)),
                       }),
                       new Reflexive("2D Nodes", 16, 16, new MetaNode[] { 
                           new Value("Plane i", typeof(float)),
                           new Value("Plane j", typeof(float)),
                           new Value("Plane k", typeof(float)),
                           new Value("Left Child", typeof(short)),
                           new Value("Right Child", typeof(short)),
                       }),
                       new Reflexive("Surfaces", 8, 8, new MetaNode[] { 
                           new Value("Plane", typeof(short)),
                           new Value("First Edge", typeof(short)),
                           new Bitmask("Flags", new string[] { "Two-Sided", "Invisible", "Climbable", "Breakable", "Invalid", "Conveyor" }, 8),
                           new Value("Breakable Surface", typeof(byte)),
                           new Value("Material", typeof(short)),
                       }),
                       new Reflexive("Edges", 12, 12, new MetaNode[] { 
                           new Value("Start Vertex", typeof(short)),
                           new Value("End Vertex", typeof(short)),
                           new Value("Forward Edge", typeof(short)),
                           new Value("Reverse Edge", typeof(short)),
                           new Value("Left Surface", typeof(short)),
                           new Value("Right Surface", typeof(short)),
                       }),
                       new Reflexive("Vertices", 16, 16, new MetaNode[] { 
                           new Value("x", typeof(float)),
                           new Value("y", typeof(float)),
                           new Value("z", typeof(float)),
                           new Value("First Edge", typeof(int)),
                       }),
                   }),
                   new Reflexive("BSP Physics", 112, new MetaNode[] { 
                       new Value("Unknown", typeof(short)),
                       new Value("Unknown", typeof(short)),
                       new Value("Unknown", typeof(short)),
                       new Value("Unknown", typeof(short)),
                       new Unused(4),
                       new Value("Unknown", typeof(byte)),
                       new Value("Unknown", typeof(byte)),
                       new Value("Unknown", typeof(short)),
                       new Value("Unknown", typeof(int)),
                       new Value("Unknown", typeof(int)),
                       new Value("Unknown", typeof(int)),
                       new Unused(4),
                       new Value("Unknown", typeof(int)),
                       new Value("Unknown", typeof(int)),
                       new Value("Unknown", typeof(int)),
                       new Unused(4),
                       new Ident("Object_Properties"),
                       new Unused(12),
                       new Value("Unknown", typeof(short)),
                       new Value("Unknown", typeof(short)),
                       new Value("Unknown", typeof(short)),
                       new Value("Unknown", typeof(short)),
                       new Unused(4),
                       new Value("Unknown", typeof(short)),
                       new Value("Unknown", typeof(short)),
                       new Value("Unknown", typeof(short)),
                       new Value("Unknown", typeof(short)),
                       new Value("Unknown", typeof(short)),
                       new Value("Unknown", typeof(short)),
                       new Unused(4),
                       new Value("Unknown", typeof(short)),
                       new Value("Unknown", typeof(short)),
                       new Value("Unknown", typeof(byte)),
                       new Value("Unknown", typeof(byte)),
                       new Value("Unknown", typeof(short)),
                       new Reflexive("MOPP Code", 1, 16, new MetaNode[] { 
                           new Value("Data", typeof(byte)),
                       }),
                       new Unused(4),
                   }),
               }),
           }),
           new Reflexive("Path Finding Spheres", 20, new MetaNode[] { 
               new Value("Node Index", typeof(short)),
               new Bitmask("Flags", new string[] { "Remains_When_Open", "Vehicle_Only", "With_Sectors" }, 16),
               new Value("Center Point X", typeof(float)),
               new Value("Center Point Y", typeof(float)),
               new Value("Center Point Z", typeof(float)),
               new Value("Radius", typeof(float)),
           }),
           new Reflexive("Nodes", 12, new MetaNode[] { 
               new StringID("Name"),
               new Value("Parent", typeof(short)),
               new Value("Child", typeof(short)),
               new Value("Next Sibling", typeof(short)),
               new Value("First Child Node", typeof(short)),
           }),
           });
       }
    }
}
