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

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

       public PRTM()
       {
           Fields.AddRange(new MetaNode[] {
           new Bitmask("Flags", new string[] { "Spins", "Random_U_Mirror", "Random_V_Mirror", "Frame_Animation_One_Shot", "Select_Random_Sequence", "Disable_Frame_Blending", "Can_Animate_Backwards", "Receive_Lightmap_Lighting", "Tint_From_Diffuse_Texture", "Dies_At_Rest", "Dies_On_Structure_Collision", "Dies_In_Media", "Dies_In_Air", "Bitmap_Authored_Vertically", "Has_Sweetener" }, 32),
           new HaloObjects.Enum("Orientation", new string[] { "Screen_Facing", "Parallel_To_Direction", "Perpendicular_To_Direction", "Vertical", "Horizontal" }, 32),
           new Unused(16),
           new TagReference("Shader"),
           new HaloObjects.Enum("Output Modifier", new string[] { "", "Plus", "Times" }, 32),
           new HaloObjects.Enum("Output Modifier", new string[] { "Particle_Age", "Particle_Emit_Time", "Particle_Random_1", "Particle_Random_2", "Emitter_Age", "Emitter_Random_1", "Emitter_Random_2", "System_LOD", "Game_Time", "Effect_A_Scale", "Effect_B_Scale", "Particle_Rotation", "Explosion_Animation", "Explosion_Rotation", "Particle_Random_3", "Particle_Random_4", "Location_Random" }, 32),
           new Reflexive("Scale X", 1, new MetaNode[] { 
               new Value("Data", typeof(byte)),
           }),
           new HaloObjects.Enum("Output Modifier", new string[] { "", "Plus", "Times" }, 32),
           new HaloObjects.Enum("Output Modifier", new string[] { "Particle_Age", "Particle_Emit_Time", "Particle_Random_1", "Particle_Random_2", "Emitter_Age", "Emitter_Random_1", "Emitter_Random_2", "System_LOD", "Game_Time", "Effect_A_Scale", "Effect_B_Scale", "Particle_Rotation", "Explosion_Animation", "Explosion_Rotation", "Particle_Random_3", "Particle_Random_4", "Location_Random" }, 32),
           new Reflexive("Scale Y", 1, new MetaNode[] { 
               new Value("Data", typeof(byte)),
           }),
           new HaloObjects.Enum("Output Modifier", new string[] { "", "Plus", "Times" }, 32),
           new HaloObjects.Enum("Output Modifier", new string[] { "Particle_Age", "Particle_Emit_Time", "Particle_Random_1", "Particle_Random_2", "Emitter_Age", "Emitter_Random_1", "Emitter_Random_2", "System_LOD", "Game_Time", "Effect_A_Scale", "Effect_B_Scale", "Particle_Rotation", "Explosion_Animation", "Explosion_Rotation", "Particle_Random_3", "Particle_Random_4", "Location_Random" }, 32),
           new Reflexive("Scale Z", 1, new MetaNode[] { 
               new Value("Data", typeof(byte)),
           }),
           new HaloObjects.Enum("Output Modifier", new string[] { "", "Plus", "Times" }, 32),
           new HaloObjects.Enum("Output Modifier", new string[] { "Particle_Age", "Particle_Emit_Time", "Particle_Random_1", "Particle_Random_2", "Emitter_Age", "Emitter_Random_1", "Emitter_Random_2", "System_LOD", "Game_Time", "Effect_A_Scale", "Effect_B_Scale", "Particle_Rotation", "Explosion_Animation", "Explosion_Rotation", "Particle_Random_3", "Particle_Random_4", "Location_Random" }, 32),
           new Reflexive("Rotation", 1, new MetaNode[] { 
               new Value("Data", typeof(byte)),
           }),
           new TagReference("Collision_Effect"),
           new TagReference("Death_Effect"),
           new Reflexive("Locations", 4, new MetaNode[] { 
               new StringID("Marker Name"),
           }),
           new Reflexive("Attached Particle System", 56, new MetaNode[] { 
               new TagReference("Particle"),
               new Unused(8),
               new Value("Location #", typeof(short)),
               new HaloObjects.Enum("Coordinate System", new string[] { "World", "Local", "Parent" }, 16),
               new HaloObjects.Enum("Environment", new string[] { "Any", "Air_Only", "Water_Only", "Space_Only" }, 16),
               new HaloObjects.Enum("Disposition", new string[] { "Either_Mode", "Violent_Mode", "Non-Violent_Mode" }, 16),
               new HaloObjects.Enum("Camera Mode", new string[] { "Independent_Of_Camera_Mode", "Only_In_First_Person", "Only_In_Third_Person", "Both_First_And_Third" }, 16),
               new Value("Sort Bias", typeof(short)),
               new Bitmask("Flags", new string[] { "Glow", "Cinematics", "Loop_Particle", "Disabled_For_Debugging", "Inherit_Effect_Velocity", "Render_When_Zoomed", "Spread_Between_Ticks", "persistent_Particle", "Expensive_Visibility" }, 32),
               new Value("LOD In Distance", typeof(float)),
               new Value("LOD Feather In Delta", typeof(float)),
               new Value("LOD Out Distance", typeof(float)),
               new Value("LOD Feather Out Delta", typeof(float)),
               new Reflexive("Emitters", 184, new MetaNode[] { 
                   new TagReference("Particle_Physics"),
                   new HaloObjects.Enum("Output Modifier", new string[] { "", "Plus", "Times" }, 32),
                   new HaloObjects.Enum("Output Modifier", new string[] { "Particle_Age", "Particle_Emit_Time", "Particle_Random_1", "Particle_Random_2", "Emitter_Age", "Emitter_Random_1", "Emitter_Random_2", "System_LOD", "Game_Time", "Effect_A_Scale", "Effect_B_Scale", "Particle_Rotation", "Explosion_Animation", "Explosion_Rotation", "Particle_Random_3", "Particle_Random_4", "Location_Random" }, 32),
                   new Reflexive("Particle Emission Rate", 1, new MetaNode[] { 
                       new Value("Data", typeof(byte)),
                   }),
                   new HaloObjects.Enum("Output Modifier", new string[] { "", "Plus", "Times" }, 32),
                   new HaloObjects.Enum("Output Modifier", new string[] { "Particle_Age", "Particle_Emit_Time", "Particle_Random_1", "Particle_Random_2", "Emitter_Age", "Emitter_Random_1", "Emitter_Random_2", "System_LOD", "Game_Time", "Effect_A_Scale", "Effect_B_Scale", "Particle_Rotation", "Explosion_Animation", "Explosion_Rotation", "Particle_Random_3", "Particle_Random_4", "Location_Random" }, 32),
                   new Reflexive("Particle Lifespan (sec)", 1, new MetaNode[] { 
                       new Value("Data", typeof(byte)),
                   }),
                   new HaloObjects.Enum("Output Modifier", new string[] { "", "Plus", "Times" }, 32),
                   new HaloObjects.Enum("Output Modifier", new string[] { "Particle_Age", "Particle_Emit_Time", "Particle_Random_1", "Particle_Random_2", "Emitter_Age", "Emitter_Random_1", "Emitter_Random_2", "System_LOD", "Game_Time", "Effect_A_Scale", "Effect_B_Scale", "Particle_Rotation", "Explosion_Animation", "Explosion_Rotation", "Particle_Random_3", "Particle_Random_4", "Location_Random" }, 32),
                   new Reflexive("Particle Velocity (World Units Per Sec)", 1, new MetaNode[] { 
                       new Value("Data", typeof(byte)),
                   }),
                   new HaloObjects.Enum("Output Modifier", new string[] { "", "Plus", "Times" }, 32),
                   new HaloObjects.Enum("Output Modifier", new string[] { "Particle_Age", "Particle_Emit_Time", "Particle_Random_1", "Particle_Random_2", "Emitter_Age", "Emitter_Random_1", "Emitter_Random_2", "System_LOD", "Game_Time", "Effect_A_Scale", "Effect_B_Scale", "Particle_Rotation", "Explosion_Animation", "Explosion_Rotation", "Particle_Random_3", "Particle_Random_4", "Location_Random" }, 32),
                   new Reflexive("Particle Angular Velocity (Degrees Per Sec)", 1, new MetaNode[] { 
                       new Value("Data", typeof(byte)),
                   }),
                   new HaloObjects.Enum("Output Modifier", new string[] { "", "Plus", "Times" }, 32),
                   new HaloObjects.Enum("Output Modifier", new string[] { "Particle_Age", "Particle_Emit_Time", "Particle_Random_1", "Particle_Random_2", "Emitter_Age", "Emitter_Random_1", "Emitter_Random_2", "System_LOD", "Game_Time", "Effect_A_Scale", "Effect_B_Scale", "Particle_Rotation", "Explosion_Animation", "Explosion_Rotation", "Particle_Random_3", "Particle_Random_4", "Location_Random" }, 32),
                   new Reflexive("Particle Size (World Units)", 1, new MetaNode[] { 
                       new Value("Data", typeof(byte)),
                   }),
                   new HaloObjects.Enum("Output Modifier", new string[] { "", "Plus", "Times" }, 32),
                   new HaloObjects.Enum("Output Modifier", new string[] { "Particle_Age", "Particle_Emit_Time", "Particle_Random_1", "Particle_Random_2", "Emitter_Age", "Emitter_Random_1", "Emitter_Random_2", "System_LOD", "Game_Time", "Effect_A_Scale", "Effect_B_Scale", "Particle_Rotation", "Explosion_Animation", "Explosion_Rotation", "Particle_Random_3", "Particle_Random_4", "Location_Random" }, 32),
                   new Reflexive("Particle Tint", 1, new MetaNode[] { 
                       new Value("Data", typeof(byte)),
                   }),
                   new HaloObjects.Enum("Output Modifier", new string[] { "", "Plus", "Times" }, 32),
                   new HaloObjects.Enum("Output Modifier", new string[] { "Particle_Age", "Particle_Emit_Time", "Particle_Random_1", "Particle_Random_2", "Emitter_Age", "Emitter_Random_1", "Emitter_Random_2", "System_LOD", "Game_Time", "Effect_A_Scale", "Effect_B_Scale", "Particle_Rotation", "Explosion_Animation", "Explosion_Rotation", "Particle_Random_3", "Particle_Random_4", "Location_Random" }, 32),
                   new Reflexive("Particle Alpha", 1, new MetaNode[] { 
                       new Value("Data", typeof(byte)),
                   }),
                   new HaloObjects.Enum("Emission Shape", new string[] { "Sprayer", "Disc", "Globe", "Implode", "Tube", "Halo", "Impact_Contour", "Impact_Area", "Debris", "Line" }, 32),
                   new HaloObjects.Enum("Output Modifier", new string[] { "", "Plus", "Times" }, 32),
                   new HaloObjects.Enum("Output Modifier", new string[] { "Particle_Age", "Particle_Emit_Time", "Particle_Random_1", "Particle_Random_2", "Emitter_Age", "Emitter_Random_1", "Emitter_Random_2", "System_LOD", "Game_Time", "Effect_A_Scale", "Effect_B_Scale", "Particle_Rotation", "Explosion_Animation", "Explosion_Rotation", "Particle_Random_3", "Particle_Random_4", "Location_Random" }, 32),
                   new Reflexive("Emission Radius (World Units)", 1, new MetaNode[] { 
                       new Value("Data", typeof(byte)),
                   }),
                   new HaloObjects.Enum("Output Modifier", new string[] { "", "Plus", "Times" }, 32),
                   new HaloObjects.Enum("Output Modifier", new string[] { "Particle_Age", "Particle_Emit_Time", "Particle_Random_1", "Particle_Random_2", "Emitter_Age", "Emitter_Random_1", "Emitter_Random_2", "System_LOD", "Game_Time", "Effect_A_Scale", "Effect_B_Scale", "Particle_Rotation", "Explosion_Animation", "Explosion_Rotation", "Particle_Random_3", "Particle_Random_4", "Location_Random" }, 32),
                   new Reflexive("Emission Angle (Degrees)", 1, new MetaNode[] { 
                       new Value("Data", typeof(byte)),
                   }),
                   new Value("Translation Offset X", typeof(float)),
                   new Value("Translation Offset Y", typeof(float)),
                   new Value("Translation Offset Z", typeof(float)),
                   new Value("Relative Direction Yaw", typeof(float)),
                   new Value("Relative Direction Pitch", typeof(float)),
                   new Unused(8),
               }),
           }),
           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("Pos X", typeof(float)),
               new Value("Pos Y", typeof(float)),
               new Value("Pos 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("Texture Coord X", typeof(float)),
               new Value("Texture Coord Y", typeof(float)),
           }),
           new Reflexive("Indices", 2, new MetaNode[] { 
               new Value("Index", typeof(short)),
           }),
           new Reflexive("Cached Data", 0, new MetaNode[] { 
           }),
           new Value("Raw Offset", typeof(int)), // uint
           new Value("Raw Size", typeof(int)), // uint
           new Value("Raw Header Size", typeof(uint)),
           new Value("Raw Data Size", typeof(uint)),
           new Reflexive("Resources", 16, new MetaNode[] { 
               new HaloObjects.Enum("Type", new string[] {  }, 32),
               new Value("Primary Location", typeof(short)),
               new Value("Secondary Location", typeof(short)),
               new Value("Raw Data Size", typeof(uint)),
               new Value("Raw Data Offset", typeof(uint)),
           }),
           new Ident("Owner Tag Section Offset"),
           new Value("Unused", typeof(int)),
           new Value("Unused", typeof(int)),
           new Unused(24),
           });
       }
    }
}
