private void Init(string Path) { info = new AnimationInfo(); zs = new ZipStreams(Path); if (!zs.Exist("desc.txt")) { throw new Exception("_notCorrectfile"); } string dest = Encoding.UTF8.GetString(zs["desc.txt"].Data); string[] LineSplit = System.Text.RegularExpressions.Regex.Split(dest, "\r\n"); if (LineSplit.Count() <= 1) { LineSplit = System.Text.RegularExpressions.Regex.Split(dest, "\n"); } if (LineSplit.Count() <= 1) { throw new Exception("_destFormat"); } string header = LineSplit[0]; string[] header_split = System.Text.RegularExpressions.Regex.Split(header, " "); info.HasAudio = zs.Exist("audio.wav"); info.Width = Convert.ToInt32(header_split[0]); info.Height = Convert.ToInt32(header_split[1]); info.fps = Convert.ToInt32(header_split[2]); Array.Copy(LineSplit, 1, LineSplit, 0, LineSplit.Count() - 1); info.parts = ProcessingAnimation(LineSplit); inited = true; }
private AnimationPart[] ProcessingAnimation(string[] partArray) { List <AnimationPart> list = new List <AnimationPart>(); foreach (string part in partArray) { if (part == "") { continue; } list.Add(ConvertPart(part)); } zs.Dispose(); zs = null; return(list.ToArray()); }