Пример #1
0
        private bool LoadFile(Stream stream, EndianUtils.Endianness endian, BitUtils.Bitness bits)
        {
            string magic = stream.ReadAscii(8);

            if (magic != "T8BTEMEG")
            {
                throw new Exception("Invalid magic.");
            }
            uint encounterGroupCount = stream.ReadUInt32().FromEndian(endian);
            uint refStringStart      = stream.ReadUInt32().FromEndian(endian);

            EncounterGroupList = new List <EncounterGroup>((int)encounterGroupCount);
            for (uint i = 0; i < encounterGroupCount; ++i)
            {
                EncounterGroup s = new EncounterGroup(stream, refStringStart, endian, bits);
                EncounterGroupList.Add(s);
            }

            EncounterGroupIdDict = new Dictionary <uint, EncounterGroup>(EncounterGroupList.Count);
            foreach (EncounterGroup e in EncounterGroupList)
            {
                EncounterGroupIdDict.Add(e.InGameID, e);
            }

            return(true);
        }
Пример #2
0
        private bool LoadFile( Stream stream )
        {
            string magic = stream.ReadAscii( 8 );
            uint encounterGroupCount = stream.ReadUInt32().SwapEndian();
            uint refStringStart = stream.ReadUInt32().SwapEndian();

            EncounterGroupList = new List<EncounterGroup>( (int)encounterGroupCount );
            for ( uint i = 0; i < encounterGroupCount; ++i ) {
                EncounterGroup s = new EncounterGroup( stream, refStringStart );
                EncounterGroupList.Add( s );
            }

            EncounterGroupIdDict = new Dictionary<uint, EncounterGroup>( EncounterGroupList.Count );
            foreach ( EncounterGroup e in EncounterGroupList ) {
                EncounterGroupIdDict.Add( e.InGameID, e );
            }

            return true;
        }
Пример #3
0
        private bool LoadFile(Stream stream)
        {
            string magic = stream.ReadAscii(8);
            uint   encounterGroupCount = stream.ReadUInt32().SwapEndian();
            uint   refStringStart      = stream.ReadUInt32().SwapEndian();

            EncounterGroupList = new List <EncounterGroup>((int)encounterGroupCount);
            for (uint i = 0; i < encounterGroupCount; ++i)
            {
                EncounterGroup s = new EncounterGroup(stream, refStringStart);
                EncounterGroupList.Add(s);
            }

            EncounterGroupIdDict = new Dictionary <uint, EncounterGroup>(EncounterGroupList.Count);
            foreach (EncounterGroup e in EncounterGroupList)
            {
                EncounterGroupIdDict.Add(e.InGameID, e);
            }

            return(true);
        }