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

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

       public DECR()
       {
           Fields.AddRange(new MetaNode[] {
           new Reflexive("Shaders", 8, new MetaNode[] { 
               new TagReference("Shader"),
           }),
           new Value("Lighting Min Scale", typeof(float)),
           new Value("Lighting Max Scale", typeof(float)),
           new Reflexive("Classes", 20, new MetaNode[] { 
               new StringID("Name"),
               new HaloObjects.Enum("Type", new string[] { "Model", "Floating_Decal", "Projected_Decal", "Screen_Facing_Quad", "Axis_Rotating_Quad", "Cross_Quad" }, 32),
               new Value("Scale", typeof(float)),
               new Reflexive("Permutations", 40, new MetaNode[] { 
                   new StringID("Name"),
                   new Value("Shader #", typeof(short)),
                   new Bitmask("Flags", new string[] { "Align_To_Normal", "Only_On_Ground", "Upright" }, 8),
                   new HaloObjects.Enum("Fade Distance", new string[] { "Close", "Medium", "Far" }, 8),
                   new Value("Index", typeof(short)),
                   new Value("Distribution Weight", typeof(short)),
                   new Value("Scale", typeof(float)),
                   new Value("...To", typeof(float)),
                   new Value("Tint 1 R", typeof(byte)),
                   new Value("Tint 1 G", typeof(byte)),
                   new Value("Tint 1 B", typeof(byte)),
                   new Unused(1),
                   new Value("Tint 2 R", typeof(byte)),
                   new Value("Tint 2 G", typeof(byte)),
                   new Value("Tint 2 B", typeof(byte)),
                   new Unused(1),
                   new Value("Base Map Tint Percentage", typeof(float)),
                   new Value("Lightmap Tint Percentage", typeof(float)),
                   new Value("Wind Scale", typeof(float)),
               }),
           }),
           new Reflexive("Models", 8, new MetaNode[] { 
               new StringID("Model Name"),
               new Value("Index Start", typeof(short)),
               new Value("Index Count", typeof(short)),
           }),
           new Reflexive("Raw Vertices", 56, new MetaNode[] { 
               new Value("X", typeof(float)),
               new Value("Y", typeof(float)),
               new Value("Z", typeof(float)),
               new Value("Normal i", typeof(float)),
               new Value("Normal j", typeof(float)),
               new Value("Normal k", typeof(float)),
               new Value("Tangent i", typeof(float)),
               new Value("Tangent j", typeof(float)),
               new Value("Tangent k", typeof(float)),
               new Value("Binormal i", typeof(float)),
               new Value("Binormal j", typeof(float)),
               new Value("Binormal k", typeof(float)),
               new Value("U", typeof(float)),
               new Value("V", typeof(float)),
           }),
           new Reflexive("Indices", 2, new MetaNode[] { 
               new Value("Index", typeof(short)),
           }),
           new Reflexive("Cached Data", 0, new MetaNode[] { 
           }),
           new Value("Offset", typeof(int)),
           new Value("Size", typeof(int)),
           new Value("Header Size", typeof(int)),
           new Value("Data Size", typeof(int)),
           new Reflexive("Resources", 16, new MetaNode[] { 
               new HaloObjects.Enum("Type", new string[] {  }, 32),
               new Value("Primary Locator", typeof(short)),
               new Value("Secondary Locator", typeof(short)),
               new Value("Data Size", typeof(int)),
               new Value("Data Offset", typeof(int)),
           }),
           new Ident("Owner Tag Section Offset"),
           new Value("Unused", typeof(int)),
           new Unused(18),
           });
       }
    }
}
