Exemple #1
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);
        }
Exemple #2
0
        public TesGroup(TesFileReader fr, bool readRecord = true)
        {
            GRUP     = new TesString(fr);
            DataSize = new TesUInt32(fr);
            OutputItems.Add(GRUP);
            OutputItems.Add(DataSize);

            //グループタイプ別
            uint type = fr.GetUInt32(4, false);

            switch (type)
            {
            case 0:
                Signature = new TesString(fr);
                OutputItems.Add(Signature);
                break;

            case 1:
            case 6:
            case 8:
            case 9:
                FormID = new TesUInt32(fr);
                OutputItems.Add(FormID);
                break;

            case 2:
            case 3:
                Index = new TesUInt32(fr);
                OutputItems.Add(Index);
                break;

            case 4:
            case 5:
                Grid = new TesCellGrid(fr);
                OutputItems.Add(Grid);
                break;

            default:
                throw new Exception();
            }
            GroupType = new TesUInt32(fr);
            Other     = new TesBytes(fr.GetBytes(8));
            OutputItems.Add(GroupType);
            OutputItems.Add(Other);

            if (readRecord)
            {
                while (!fr.EOF)
                {
                    Records.Add(new TesRecord(fr.GetRecord()));
                }
            }
            OutputItems.Add(Records);
        }
Exemple #3
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();
 }
Exemple #4
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();
 }
Exemple #5
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);
                }
Exemple #6
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);
            }
Exemple #7
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);
        }
Exemple #8
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);
        }