Esempio n. 1
0
 public Parser(byte[] _rawBytes)
 {
     rawBytes = _rawBytes;
     bytes    = rawBytes.ToList();
     eanFile  = new EAN_File();
     Parse();
 }
Esempio n. 2
0
        public Deserializer(EAN_File _eanFile)
        {
            writeXmlMode = false;
            eanFile      = _eanFile;
            eanFile.ValidateAnimationIndexes();
            eanFile.SortEntries();
            nonHierarchalBones = eanFile.Skeleton.GetNonHierarchalBoneList();

            ValidateAnimationBones();

            Write();
        }
Esempio n. 3
0
 public Deserializer(EAN_File _eanFile, string location)
 {
     writeXmlMode = false;
     saveLocation = location;
     eanFile      = _eanFile;
     eanFile.ValidateAnimationIndexes();
     eanFile.SortEntries();
     nonHierarchalBones = eanFile.Skeleton.GetNonHierarchalBoneList();
     ValidateAnimationBones();
     Write();
     File.WriteAllBytes(saveLocation, bytes.ToArray());
 }
Esempio n. 4
0
        public Deserializer(string location)
        {
            writeXmlMode = true;
            saveLocation = String.Format("{0}/{1}", Path.GetDirectoryName(location), Path.GetFileNameWithoutExtension(location));
            YAXSerializer serializer = new YAXSerializer(typeof(EAN_File), YAXSerializationOptions.DontSerializeNullObjects);

            eanFile = (EAN_File)serializer.DeserializeFromFile(location);
            eanFile.ValidateAnimationIndexes();
            eanFile.SortEntries();
            nonHierarchalBones = eanFile.Skeleton.GetNonHierarchalBoneList();
            ValidateAnimationBones();
            Write();
            File.WriteAllBytes(saveLocation, bytes.ToArray());
        }
Esempio n. 5
0
        public Parser(string location, bool writeXml = false)
        {
            saveLocation = location;
            rawBytes     = File.ReadAllBytes(saveLocation);
            bytes        = rawBytes.ToList();
            eanFile      = new EAN_File();
            Parse();

            if (writeXml)
            {
                YAXSerializer serializer = new YAXSerializer(typeof(EAN_File));
                serializer.SerializeToFile(eanFile, saveLocation + ".xml");
            }
        }
Esempio n. 6
0
        private void Uninstall_EAN(string path, _File file)
        {
            try
            {
                EAN_File binaryFile = (EAN_File)GetParsedFile <EAN_File>(path, false);
                EAN_File cpkBinFile = (EAN_File)GetParsedFile <EAN_File>(path, true);

                Section section = file.GetSection(Sections.EAN_Entries);

                if (section != null)
                {
                    UninstallEntries(binaryFile.Animations, (cpkBinFile != null) ? cpkBinFile.Animations : null, section.IDs);
                }
            }
            catch (Exception ex)
            {
                string error = string.Format("Failed at {0} uninstall phase ({1}).", ErrorCode.EAN, path);
                throw new Exception(error, ex);
            }
        }