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

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

       public jmad()
       {
           Fields.AddRange(new MetaNode[] {
           new TagReference("Parent_Animation"),
           new Bitmask("Inheritance flags", new string[] { "Inherit_Root_Trans_Scale_Only", "Inherit_for_use_on_player" }, 8),
           new Bitmask("Private FLags", new string[] { "Prepared_for_cahce", "unused", "Imported_with_codec_compressor", "unused_smelly_flag", "Written_to_Cache", "Animation_Data_Recorded" }, 8),
           new Value("Codec", typeof(short)),
           new Reflexive("Skeleton Nodes", 32, new MetaNode[] { 
               new StringID("Name"),
               new Value("Next Sibling Node Index", typeof(short)),
               new Value("First Child Node Index", typeof(short)),
               new Value("Parent Node Index", typeof(short)),
               new Bitmask("Model Flags", new string[] { "Primary_Model", "Secondary_Model", "Local_Root", "Left_Hand", "Right_Hand", "Left_Arm_Member" }, 8),
               new Bitmask("Node Joint Flags", new string[] { "Ball_Socket", "Hinge", "No_Movement" }, 8),
               new Value("Base Vector I", typeof(float)),
               new Value("Base Vector J", typeof(float)),
               new Value("Base Vector K", typeof(float)),
               new Value("Vector Range", typeof(float)),
               new Value("z_pos", typeof(float)),
           }),
           new Reflexive("Sounds", 12, new MetaNode[] { 
               new TagReference("Sound"),
               new Bitmask("FLags", new string[] { "Allow_On_Player", "Left_Arm_Only", "Right_Arm_Only", "First_Person_Only", "Foward_Only", "Reverse_Only" }, 32),
           }),
           new Reflexive("Effects", 12, new MetaNode[] { 
               new TagReference("Effect"),
               new Bitmask("FLags", new string[] { "Allow_On_Player", "Left_Arm_Only", "Right_Arm_Only", "First_Person_Only", "Foward_Only", "Reverse_Only" }, 32),
           }),
           new Reflexive("Blend Screens", 28, new MetaNode[] { 
               new StringID("label"),
               new Value("Right yaw per frame", typeof(float)),
               new Value("Left yaw per frame", typeof(float)),
               new Value("Right frame count", typeof(short)),
               new Value("Left frame count", typeof(short)),
               new Value("Down pitch per frame", typeof(float)),
               new Value("Up pitch per frame", typeof(float)),
               new Value("Down pitch frame count", typeof(short)),
               new Value("Up pitch frame count", typeof(short)),
           }),
           new Reflexive("Animations", 108, new MetaNode[] { 
               new StringID("Name"),
               new Value("Node List Checksum", typeof(int)),
               new Value("Production Checksum", typeof(int)),
               new Value("Import Checksum", typeof(int)),
               new HaloObjects.Enum("Type Index", new string[] { "Base" }, 8),
               new HaloObjects.Enum("Frame Info Type Index", new string[] { "None" }, 8),
               new Value("Blend Screen Index", typeof(byte)),
               new Value("Node Count", typeof(byte)),
               new Value("Frame Count", typeof(short)),
               new Bitmask("Internal Flags", new string[] { "Unused", "World_Relative", "Unused", "Unused", "Unused", "Compression_Disabled", "Old_Production_Checksum", "Valid_Production_Checksum" }, 16),
               new Bitmask("Production Flags", new string[] { "Do_not_monitor_changes", "Verify_Sound_Events", "Do_not_inherit_for_Player_Graphs" }, 16),
               new Bitmask("Playback FLags", new string[] { "Disable_Interpolation_In", "Disable_Interpolation_Out", "Disable_Mode_ik", "Disable_Weapon_ik", "Disable_Weapon_Aim/1st_Person", "Disable_Look_Screen", "Disable_Transition_Adjustment" }, 16),
               new Value("Unknown", typeof(float)),
               new Unused(4),
               new Value("Raw Chunk #", typeof(int)),
               new Value("Offset in raw", typeof(short)),
               new Value("Unused", typeof(int)),
               new Bitmask("Doesn't Repeat", new string[] { "Doesn't_Repeat" }, 16),
               new Value("Unknown", typeof(short)),
               new Value("Unknown", typeof(short)),
               new Unused(8),
               new Value("Unknown", typeof(byte)),
               new Value("Unknown", typeof(byte)),
               new Value("Unknown", typeof(byte)),
               new Value("Unknown", typeof(byte)),
               new Value("Unknown", typeof(short)),
               new Value("Animation Raw Something", typeof(short)),
               new Value("Unknown", typeof(float)),
               new Value("Unknown", typeof(byte)),
               new Value("Unknown", typeof(byte)),
               new Value("Loop Frame Index", typeof(short)),
               new Reflexive("Frame Events", 4, new MetaNode[] { 
                   new HaloObjects.Enum("Type", new string[] {  }, 16),
                   new Value("Frame", typeof(short)),
               }),
               new Reflexive("Sounds", 8, new MetaNode[] { 
                   new Value("Sound Index", typeof(short)),
                   new Value("Frame", typeof(short)),
                   new StringID("Marker Name"),
               }),
               new Reflexive("Effects", 4, new MetaNode[] { 
                   new Value("Effect Index", typeof(short)),
                   new Value("Frame", typeof(short)),
               }),
               new Reflexive("Object-Space Parent Nodes", 28, new MetaNode[] { 
                   new Value("Node Index", typeof(short)),
                   new Bitmask("Component Flags", new string[] { "Rotation", "Translation", "Scale" }, 16),
                   new Value("Rotation X", typeof(short)),
                   new Value("Rotation Y", typeof(short)),
                   new Value("Rotation Z", typeof(short)),
                   new Value("Rotation W", typeof(short)),
                   new Value("Default Translation X", typeof(float)),
                   new Value("Default Translation Y", typeof(float)),
                   new Value("Default Translation Z", typeof(float)),
                   new Value("Default Scale", typeof(float)),
               }),
           }),
           new Reflexive("Modes", 20, new MetaNode[] { 
               new StringID("Label"),
               new Reflexive("Weapon Class", 20, new MetaNode[] { 
                   new StringID("Label"),
                   new Reflexive("Weapon Type", 52, new MetaNode[] { 
                       new StringID("Label"),
                       new Reflexive("Actions", 8, new MetaNode[] { 
                           new StringID("Label"),
                           new Value("Graph Index", typeof(short)),
                           new Value("Animation", typeof(short)),
                       }),
                       new Reflexive("Overlays", 8, new MetaNode[] { 
                           new StringID("Label"),
                           new Value("Graph Index", typeof(short)),
                           new Value("Animation", typeof(short)),
                       }),
                       new Reflexive("Death and Damage", 12, new MetaNode[] { 
                           new StringID("Label"),
                           new Reflexive("Directions", 8, new MetaNode[] { 
                               new Reflexive("Regions", 4, new MetaNode[] { 
                                   new Value("Graph Index", typeof(short)),
                                   new Value("Animation Index", typeof(short)),
                               }),
                           }),
                       }),
                       new Reflexive("Transitions", 20, new MetaNode[] { 
                           new StringID("Full Name"),
                           new StringID("State Name"),
                           new Value("Index A", typeof(short)),
                           new Value("Index B", typeof(short)),
                           new Reflexive("Destinations", 20, new MetaNode[] { 
                               new StringID("Full Name"),
                               new StringID("mode"),
                               new StringID("State Name"),
                               new Value("Index A", typeof(short)),
                               new Value("Index B", typeof(short)),
                               new Value("Graph Index", typeof(short)),
                               new Value("Animation Index", typeof(short)),
                           }),
                       }),
                       new Reflexive("High PreCache", 4, new MetaNode[] { 
                           new Value("Cache Block Index", typeof(int)),
                       }),
                       new Reflexive("Low PreCache", 4, new MetaNode[] { 
                           new Value("Cahce Block Index", typeof(int)),
                       }),
                   }),
                   new Reflexive("Weapon ik", 8, new MetaNode[] { 
                       new StringID("Marker"),
                       new StringID("Attach to Marker"),
                   }),
               }),
               new Reflexive("Mode ik", 8, new MetaNode[] { 
                   new StringID("Marker"),
                   new StringID("Attach to Marker"),
               }),
           }),
           new Reflexive("Vehicle Suspension", 40, new MetaNode[] { 
               new StringID("Label"),
               new Value("Graph Index", typeof(short)),
               new Value("ANimation Index", typeof(short)),
               new StringID("Marker Name"),
               new Value("Mass Point Offset (maybe int)", typeof(float)),
               new Value("Full Extension Ground Depth (maybe int)", typeof(float)),
               new Value("Full COmpresion Ground Depth (maybe int)", typeof(float)),
               new StringID("Region Name"),
               new Value("Destroyed Mass Point Offset(maybe int)", typeof(float)),
               new Value("Destroyed Full Extension Ground Depth (maybe int)", typeof(float)),
               new Value("Destroyed Full COmpression Ground Depth (maybe int)", typeof(float)),
           }),
           new Reflexive("Object Overlays", 20, new MetaNode[] { 
               new StringID("Label"),
               new Value("Graph Index", typeof(short)),
               new Value("Animation Index", typeof(short)),
               new HaloObjects.Enum("Function COntrols", new string[] {  }, 16),
               new Unused(2),
               new StringID("Function"),
               new Unused(4),
           }),
           new Reflexive("Inheritence List", 32, new MetaNode[] { 
               new TagReference("Inherited_Graph"),
               new Reflexive("Node Map", 2, new MetaNode[] { 
                   new Value("Local Node", typeof(short)),
               }),
               new Reflexive("Node Map Flags", 4, new MetaNode[] { 
                   new Value("Local Node Flags", typeof(int)),
               }),
               new Value("Root Z Offset", typeof(float)),
               new Value("Inheritence Flags", typeof(float)),
           }),
           new Reflexive("Weapon List", 8, new MetaNode[] { 
               new StringID("Name"),
               new StringID("Class"),
           }),
           new Value("Unknown", typeof(int)),
           new Value("Unknown", typeof(int)),
           new Unused(24),
           new Value("Unknown", typeof(int)),
           new Value("Unknown", typeof(int)),
           new Value("Unknown", typeof(int)),
           new Unused(36),
           new Reflexive("Raw Blocks", 20, new MetaNode[] { 
               new Ident("Class ID"),
               new Value("Raw Size", typeof(int)),
               new Value("Raw Offset", typeof(int)),
               new Value("Unknown", typeof(int)),
               new Value("Unknown", typeof(int)),
           }),
           new Reflexive("Additional Node Data", 24, new MetaNode[] { 
               new Value("Unknown", typeof(float)),
               new Value("Unknown", typeof(float)),
               new Value("Unknown", typeof(float)),
               new Value("Unknown", typeof(float)),
               new Value("Unknown", typeof(float)),
               new Value("Default Scale", typeof(float)),
           }),
           });
       }
    }
}
