Exemplo n.º 1
0
        private bool LoadFile(Stream stream, EndianUtils.Endianness endian, BitUtils.Bitness bits)
        {
            string magic = stream.ReadAscii(8);

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

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

            EnemyGroupIdDict = new Dictionary <uint, EnemyGroup>(EnemyGroupList.Count);
            foreach (EnemyGroup e in EnemyGroupList)
            {
                EnemyGroupIdDict.Add(e.InGameID, e);
            }

            return(true);
        }
Exemplo n.º 2
0
        private bool LoadFile(Stream stream)
        {
            string magic           = stream.ReadAscii(8);
            uint   enemyGroupCount = stream.ReadUInt32().SwapEndian();
            uint   refStringStart  = stream.ReadUInt32().SwapEndian();

            EnemyGroupList = new List <EnemyGroup>((int)enemyGroupCount);
            for (uint i = 0; i < enemyGroupCount; ++i)
            {
                EnemyGroup s = new EnemyGroup(stream, refStringStart);
                EnemyGroupList.Add(s);
            }

            EnemyGroupIdDict = new Dictionary <uint, EnemyGroup>(EnemyGroupList.Count);
            foreach (EnemyGroup e in EnemyGroupList)
            {
                EnemyGroupIdDict.Add(e.InGameID, e);
            }

            return(true);
        }