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

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

       public shad()
       {
           Fields.AddRange(new MetaNode[] {
           new TagReference("Shader_Template"),
           new StringID("Material Type"),
           new Reflexive("Runtime Properties", 80, new MetaNode[] { //80
               new TagReference("Diffuse Map"),
               new TagReference("Lightmap Emissive Map"),
               new Value("Lightmap Emissive Color: Red", typeof(float)),
               new Value("Lightmap Emissive Color: Blue", typeof(float)),
               new Value("Lightmap Emissive Color: Green", typeof(float)),
               new Value("Lightmap Emissive Color Power", typeof(float)),
               new Value("Lightmap Resoulution Scale", typeof(float)),
               new Value("Lightmap Half-Life", typeof(float)),
               new Value("Lightmap Diffuse Scale", typeof(float)),
               new TagReference("Alpha Test Map"),
               new TagReference("Translucent Map"),
               new Value("Lightmap Transparent Color: Red", typeof(float)),
               new Value("Lightmap Transparent Color: Blue", typeof(float)),
               new Value("Lightmap Transparent Color: Green", typeof(float)),
               new Value("Lightmap Transparent Alpha", typeof(float)),
               new Value("Lightmap Foliage Scale", typeof(float)),
           }),
           new Unused(2),
           new Bitmask("Flags", new string[] { "Water", "Sort First", "No Active Cammo" }, 16),
           new Unused(8),
           new Reflexive("Postprocess Definitions", 124, new MetaNode[] { //124
               new Ident("Template"),
               new Reflexive("Bitmaps", 12, new MetaNode[] { 
                   new Ident("Bitmap Group"),
                   new Value("Bitmap Index", typeof(int)),
                   new Value("Log Bitmap Dimension", typeof(float)),
               }),
               new Reflexive("Pixel Constants", 4, new MetaNode[] { 
                   new Value("Color A", typeof(byte)),
                   new Value("Color R", typeof(byte)),
                   new Value("Color G", typeof(byte)),
                   new Value("Color B", typeof(byte)),
               }),
               new Reflexive("Vertex Constants", 16, new MetaNode[] { 
                   new Value("X Scale", typeof(float)),
                   new Value("Y Scale", typeof(float)),
                   new Value("X Scale", typeof(float)),
                   new Value("W Scale", typeof(float)),
               }),
               new Reflexive("Levels Of Detail", 6, new MetaNode[] { //8
                   new Value("Available Layer Flags", typeof(int)),
                   new Value("Layers", typeof(short)),
               }),
               new Reflexive("Layers", 2, 4, new MetaNode[] { //4 fixed
                   new Value("Indice", typeof(short)),
               }),
               new Reflexive("Passes", 2, 4, new MetaNode[] { //4 fixed
                   new Value("Indice", typeof(short)),
               }),
               new Reflexive("Implementations", 10, 4, new MetaNode[] { //10 fixed
                   new Value("Bitmap Transform", typeof(short)),
                   new Value("Render State", typeof(short)),
                   new Value("Texture State", typeof(short)),
                   new Value("Pixel Constant", typeof(short)),
                   new Value("Vertex Constant", typeof(short)),
               }),
               new Reflexive("Overlays", 20, 4, new MetaNode[] { 
                   new StringID("Input Name"),
                   new StringID("Range Name"),
                   new Value("Time Period In Seconds", typeof(float)),
                   new Reflexive("Functions", 1, new MetaNode[] { 
                       new Value("Function", typeof(byte)),
                   }),
               }),
               new Reflexive("Overlay References", 4, new MetaNode[] { 
                   new Value("Overlay Index", typeof(short)),
                   new Value("Transform Index", typeof(short)),
               }),
               new Reflexive("Animated Parameters", 2, new MetaNode[] { // fixed
                   new Value("Overlay Reference", typeof(short)),
               }),
               new Reflexive("Animated Parameter References", 4, 4, new MetaNode[] {
                   new Value("Parameter Index", typeof(int)), // NEEDS to be 4!
               }),
               new Reflexive("Bitmap Properties", 4, new MetaNode[] { 
                   new Value("Bitmap Index", typeof(short)),
                   new Value("Animated Parameter Index", typeof(short)),
               }),
               new Reflexive("Color Properties: 1st chunk = colour of emitted light, second chunk = tint colour", 12, new MetaNode[] { 
                   new Value("R", typeof(float)),
                   new Value("G", typeof(float)),
                   new Value("B", typeof(float)),
               }),
               new Reflexive("Value Properties", 4, new MetaNode[] { 
                   new Value("Value", typeof(float)),
               }),
               new Unused(8),
           }),
           new Unused(4),
           new Reflexive("Predicted Resources", 8, 4, new MetaNode[] { 
               new HaloObjects.Enum("Type", new string[] { "Bitmap", "Sound", "Render Model Geometry", "Clustor Geometry", "Clustor Instanced Geometry", "Lightmap Geometry Object Buckets", "Lightmap Geometry Instance Buckets", "Lightmap Clustor Bitmaps" }, 16),
               new Value("Resource Index", typeof(short)),
               new Ident("Bitmap Used Ident"),
           }),
           new Ident("Unused Light Response"),
           new HaloObjects.Enum("Shader Load Bias", new string[] { "None", "4x Size", "2x Size", "1/2 Size", "1/4 Size", "Never" }, 16),
           new HaloObjects.Enum("Specular Type", new string[] { "None", "Default", "Dull" }, 16),
           new Value("Saturation", typeof(float)),
           new Value("Unknown", typeof(float)), // Another Enum is here
           new Value("Lightmap Specular Brightness", typeof(float)),
           new Value("Lightmap Ambient Bias", typeof(float)),
           new Unused(8),
           });
       }
    }
}
