using System;
using System.Collections.Generic;
using System.Text;
using Halo3Map.Data;

namespace Halo3Map.Tags.Layouts
{
    [Tag("shade45", "scnr", 0.2)]
    public class scnr : H3Tag
    {
        public int Unknown;
        public int Unknown4;
        public int Unknown8;
        public int Unknown12;
        public int Unknown16;

        public H3Reflexive<Unknown20> unknown20;
        [Size(108)]
        public class Unknown20 : Chunk
        {
            public TagReference Sbsp;
            public TagReference Sddt;
            public TagReference Stli;
            public int Unknown48;
            public int Unknown52;
            public int Unknown56;
            public int Unknown60;
            public int Unknown64;
            public int Unknown68;
            public TagReference Bitm;
            public TagReference Wind;
            public int Unknown104;
        }

        [Size(40)]
        public byte[] Unknown28;

        public H3Reflexive<Unknown72> unknown72;
        [Size(100)]
        public class Unknown72 : Chunk
        {
            public int Unknown;
            public int Unknown4;
            public int Unknown8;
            public int Unknown12;
            [Size(84)]
            public byte[] Unknown16;
            //There are 5 reflexives here, will map them later
        }


        public H3Reflexive<Unknown84> unknown84;
        [Size(36)]
        public class Unknown84 : Chunk
        {
            public int Unknown;
            public int Unknown4;
            public int Unknown8;
            public int Unknown12;
            public int Unknown16;
            public int Unknown20;
            public int Unknown24;
            public int Unknown28;
            public int Unknown32;
        }

        [Size(80)]
        public byte[] Unknown92;

        public H3Reflexive<ScriptObjects> scriptObjects;
        [Size(36)]
        public class ScriptObjects : Chunk
        {
            [String(32)]
            public string Name;

            public enum Type : short
            {
                Biped = 0,
                Vehicle = 1,
                Weapon = 2,
                Scenery = 6,
                Machine = 7,
                Control = 8,
                SoundScenery = 10,
                Obstacle = 11
            }

            public Type type;
            public short PlacementIndex;
        }


        public H3Reflexive<SceneryPlacement> sceneryPlacement;
        [Size(180)]
        public class SceneryPlacement : Chunk
        {
            public int Unknown;
            public int Unknown4;
            public float PosX;
            public float PosY;
            public float PosZ;
            public float Yaw;
            public float Pitch;
            public float Roll;
            [Size(24)]
            public byte[] Unknown32;
            public int Unknown56;
            public int Unknown60;
            public int Unknown64;
            public int Unknown68;
            [Size(8)]
            public byte[] Unknown72;
            public int Unknown80;
            [Size(40)]
            public byte[] Unknown84;
            public short PalleteIndex;
            public short Unknown126;
            [Size(4)]
            public byte[] Unknown128;
            public int Unknown132;
            [Size(12)]
            public byte[] Unknown136;
            public int Unknown148;
            [Size(28)]
            public byte[] Unknown152;
        }


        public H3Reflexive<SceneryPallete> sceneryPallete;
        [Size(48)]
        public class SceneryPallete : Chunk
        {
            public TagReference scen;
            [Size(32)]
            public byte[] Unknown16;

        }

        [Size(24)]
        public byte[] Unknown212;

        /*public H3Reflexive<SceneryPlacement> sceneryPlacement;
        [Size(168)]
        public class SceneryPlacement : Chunk
        {
 
        }
        */
        [Size(744)]
        public byte[] Unknown248;

        public int SciptTableSize;

        [Size(4)]
        public byte[] Unknown996;

        public H3Reflexive<ScriptTable> scriptTable;
        [Size(1)]
        public class ScriptTable : Chunk
        {
            public char character;
        }
    }
}
