Beispiel #1
0
        private void ReadHeaders(WarResource res)
        {
            // 54 (0x36) bytes header
            Magic         = ReadBytes(0, 4, res.data);
            levelInfoType = DetermineType(Magic);
            Header        = ReadBytes(4, 50, res.data);

            // 4 bytes FF FF FF FF
            // 32 (0x20) bytes follow
            SubHeader = new ushort[16];
            int offset = 0x3A;

            for (int i = 0; i < SubHeader.Length; i++)
            {
                SubHeader[i] = (ushort)(res.data[offset] + (res.data[offset + 1] << 8));
                offset      += 2;
            }
            // 2 bytes FF FF
        }
        public LevelInfoData(LevelInfoType levelInfoType, int level)
        {
            this.level = level;
            switch (levelInfoType)
            {
            case LevelInfoType.Start:
                _type = EventTypes.LevelStart;
                break;

            case LevelInfoType.Win:
                _type = EventTypes.Win;
                break;

            case LevelInfoType.Lose:
                _type = EventTypes.Lose;
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(levelInfoType), levelInfoType, null);
            }
        }