예제 #1
0
 public TesField this[string signature, int index = 0]
 {
     get
     {
         TesField result = Fields[signature][index];
         return(result);
     }
 }
예제 #2
0
        public void AddField(TesField field)
        {
            OutputItems.Add(field);
            if (!Fields.ContainsKey(field.Signature))
            {
                Fields.Add(field.Signature, new TesList <TesField>());
            }

            Fields[field.Signature].Add(field);
        }
예제 #3
0
        public override TesField ReadField(TesFileReader fr)
        {
            TesField result = base.ReadField(fr);

            if (result == null)
            {
                string id = fr.GetTypeID();
                switch (id)
                {
                case "HEDR":
                    HEDR   = new TES4_HEDR(fr.GetField());
                    result = HEDR;
                    break;
                }
            }

            return(result);
        }
예제 #4
0
        public virtual TesField ReadField(TesFileReader fr)
        {
            TesField result = null;

            string id = fr.GetTypeID();

            switch (id)
            {
            //ワールドデータ内にある"OFST"で、1箇所DataSizeが0になっており、以降のデータが書き出されている場所がある
            case "OFST":
                if (fr.GetInt16(4, false) == 0)
                {
                    result = new TesField(fr, false);
                    result.Values.Add(new TesBytes(fr.GetBytes(fr.Length - fr.Position)));
                }
                break;
            }
            return(result);
        }
예제 #5
0
        public TesRecord(TesFileReader fr, bool readFiled = true)
        {
            Header = new TesHeader(fr);
            OutputItems.Add(Header);

            if (readFiled)
            {
                if (Header.Signature == "NAVM" || Header.Signature == "LAND")
                {
                    OutputItems.Add(new TesBytes(fr.GetBytes(Header.DataSize)));
                }
                else
                {
                    while (!fr.EOF)
                    {
                        TesField field = ReadField(fr) ?? new TesField(fr.GetField());
                        AddField(field);
                    }
                }
            }
        }