Beispiel #1
0
        private NDB0Tree DeserializeMapNames(BinaryStream bs)
        {
            uint unk       = bs.ReadUInt32(); // 100
            uint nameCount = bs.ReadUInt32();

            bs.Position += 8; // Skip 5E 5E 5E 5E 5E 5E 5E 5E

            int basePos = (int)bs.Position;

            NDB0Tree entries = new NDB0Tree();

            for (int i = 0; i < nameCount; i++)
            {
                bs.Position = basePos + (i * 0x10);

                var entry = new NDB0Entry();
                entry.SpecDBID       = bs.ReadUInt32();
                entry.AlphabeticalID = bs.ReadUInt32();
                uint nameOffset = bs.ReadUInt32();

                int temp = (int)bs.Position;
                bs.Position = (int)nameOffset;
                entry.Name  = bs.ReadString(StringCoding.ZeroTerminated);
                bs.Position = temp;

                for (int j = 0; j < 4; j++)
                {
                    int prefixIndex = bs.ReadByte();
                    if (prefixIndex != byte.MaxValue)
                    {
                        entry.Prefixes.Add(Prefixes[prefixIndex].Name);
                    }
                }

                entry.FullName = entry.ToString();
                entries.Entries.Add(entry);
            }

            return(entries);
        }
Beispiel #2
0
 public void Add(NDB0Entry entry)
 {
     entry.FullName = entry.ToString();
     Entries.Add(entry);
     Resort();
 }