public Deserializer(TNL_File _tnl_File, string _saveLocation) { saveLocation = _saveLocation; tnl_File = _tnl_File; WriteFile(); File.WriteAllBytes(saveLocation, bytes.ToArray()); }
public Deserializer(string location) { saveLocation = String.Format("{0}/{1}", Path.GetDirectoryName(location), Path.GetFileNameWithoutExtension(location)); tnl_File = (TNL_File) new YAXSerializer(typeof(TNL_File)).DeserializeFromFile(location); WriteFile(); File.WriteAllBytes(saveLocation, bytes.ToArray()); }
public void Parse() { tnl_File = new TNL_File(); tnl_File.Characters = new List <TNL_Character>(); tnl_File.Teachers = new List <TNL_Teacher>(); tnl_File.Objects = new List <TNL_Object>(); tnl_File.Actions = new List <TNL_Action>(); //Offsets and counts int currentOffset = 0; int currentSection = 0; for (int i = 0; i < 4; i++) { if (currentOffset > 0) { currentOffset += 8; } currentSection = rawBytes[currentOffset]; currentOffset++; switch (currentSection) { case 1: currentOffset = ParseSection1(currentOffset); break; case 2: currentOffset = ParseSection2(currentOffset); break; case 3: currentOffset = ParseSection4(currentOffset); break; case 4: currentOffset = ParseSection3(currentOffset); break; } } }
public Deserializer(TNL_File _tnl_File) { tnl_File = _tnl_File; WriteFile(); }