Ejemplo n.º 1
0
        public static string CompressLevel(string str)
        {
            string[] parts = str.Split('`');
            if (parts[0][0] == 'm')
            {
                LevelCompressor.m3 = int.Parse(parts[0].Substring(1));
            }
            else
            {
                LevelCompressor.m3 = 0;
                Array.Resize(ref parts, parts.Length + 1);
                Array.Copy(parts, 0, parts, 1, parts.Length - 1);
            }
            parts[0] = "m3";
            int[] ArtIDs = { 6, 7, 8, 12, 13 };
            if (parts.Length < 11)
            {
                ArtIDs = new int[] { 6, 7, 8 }
            }
            ;

            parts[2] = CompressBlocks(parts[2]);

            for (int i = 0; i < ArtIDs.Length; i++)
            {
                parts[ArtIDs[i]] = LevelCompressor.CompressArt(parts[ArtIDs[i]]);
            }

            return(string.Join("`", parts));
        }
    }