Example #1
0
        public TesVMAD(List <Tuple <string, List <Tuple <string, uint> > > > list) : base("VMAD")
        {
            Version      = new TesUInt16(5);
            ObjectFormat = new TesUInt16(2);
            ScriptCount  = new TesUInt16((ushort)list.Count);

            foreach (var x in list)
            {
                Script script = new Script();
                script.ScriptNameDataSize.Value = (ushort)x.Item1.Length;
                script.ScriptName.Value         = x.Item1;
                script.PropertyCount.Value      = (ushort)x.Item2.Count;

                foreach (var x2 in x.Item2)
                {
                    Script.Property property = new Script.Property();
                    property.PropertyNameDataSize.Value = (ushort)x2.Item1.Length;
                    property.PropertyName.Value         = x2.Item1;
                    property.PropertyValue.AddRange(new TesBytes(x2.Item2));

                    script.Propertys.Add(property);
                }
                Scripts.Add(script);
            }

            OutputItems.Add(Version);
            OutputItems.Add(ObjectFormat);
            OutputItems.Add(ScriptCount);
            OutputItems.Add(Scripts);
        }
Example #2
0
        public TesVMAD(string scriptName, string propertyName, uint propertyValue) : base("VMAD")
        {
            Version      = new TesUInt16(5);
            ObjectFormat = new TesUInt16(2);
            ScriptCount  = new TesUInt16(1);

            Script script = new Script();

            script.ScriptNameDataSize.Value = (ushort)scriptName.Length;
            script.ScriptName.Value         = scriptName;
            script.PropertyCount.Value      = 1;

            Script.Property property = new Script.Property();
            property.PropertyNameDataSize.Value = (ushort)propertyName.Length;
            property.PropertyName.Value         = propertyName;
            property.PropertyValue.AddRange(new TesBytes(propertyValue));

            script.Propertys.Add(property);
            Scripts.Add(script);

            OutputItems.Add(Version);
            OutputItems.Add(ObjectFormat);
            OutputItems.Add(ScriptCount);
            OutputItems.Add(Scripts);
        }
Example #3
0
        public TesField(string signature, IEnumerable <ITesBase> collection)
        {
            Signature = new TesString(signature);
            DataSize  = new TesUInt16(0);
            OutputItems.Add(Signature);
            OutputItems.Add(DataSize);

            Values.AddRange(collection);
            OutputItems.Add(Values);
        }
Example #4
0
 public TesHeader(TesFileReader fr)
 {
     Signature           = new TesString(fr);
     DataSize            = new TesUInt32(fr);
     RecordFlags         = new TesUInt32(fr);
     FormID              = new TesUInt32(fr);
     VersionControlInfo1 = new TesUInt32(fr);
     FormVersion         = new TesUInt16(fr);
     VersionControlInfo2 = new TesUInt16(fr);
     Initialize();
 }
Example #5
0
 public TesHeader(string signature, uint formID)
 {
     Signature           = new TesString(signature);
     DataSize            = new TesUInt32(0);
     RecordFlags         = new TesUInt32(0);
     FormID              = new TesUInt32(formID);
     VersionControlInfo1 = new TesUInt32(0);
     FormVersion         = new TesUInt16(0x2c);
     VersionControlInfo2 = new TesUInt16(0);
     Initialize();
 }
Example #6
0
                public Property()
                {
                    PropertyNameDataSize = new TesUInt16(0);
                    PropertyName         = new TesString("");
                    Type          = new TesBytes(new byte[] { 0x01, 0x01, 0x00, 0x00, 0xff, 0xff });
                    PropertyValue = new TesBytes();

                    OutputItems.Add(PropertyNameDataSize);
                    OutputItems.Add(PropertyName);
                    OutputItems.Add(Type);
                    OutputItems.Add(PropertyValue);
                }
Example #7
0
            public Script()
            {
                ScriptNameDataSize = new TesUInt16(0);
                ScriptName         = new TesString("");
                Flags         = new TesBytes(new byte[] { 0x01 });
                PropertyCount = new TesUInt16(0);

                OutputItems.Add(ScriptNameDataSize);
                OutputItems.Add(ScriptName);
                OutputItems.Add(Flags);
                OutputItems.Add(PropertyCount);
                OutputItems.Add(Propertys);
            }
Example #8
0
        public TesField(TesFileReader fr, bool readValue = true)
        {
            Signature = new TesString(fr.GetString(4));
            DataSize  = new TesUInt16(fr);
            OutputItems.Add(Signature);
            OutputItems.Add(DataSize);

            if (readValue)
            {
                Values.Add(fr.GetBytes(DataSize.Value));
            }
            OutputItems.Add(Values);
        }
Example #9
0
        public TesField(string signature, ITesBase value = null)
        {
            Signature = new TesString(signature);
            if (value != null)
            {
                DataSize = new TesUInt16((ushort)value.ToBytes().Count());
            }
            else
            {
                DataSize = new TesUInt16(0);
            }

            OutputItems.Add(Signature);
            OutputItems.Add(DataSize);

            if (value != null)
            {
                Values.Add(value);
            }
            OutputItems.Add(Values);
        }