PoseInfoSerializer.cs 688 B

12345678910111213141516171819202122232425
  1. using System.IO;
  2. namespace COM3D2.MeidoPhotoStudio.Plugin
  3. {
  4. public class PoseInfoSerializer : SimpleSerializer<PoseInfo>
  5. {
  6. private const short version = 1;
  7. public override void Serialize(PoseInfo obj, BinaryWriter writer)
  8. {
  9. writer.WriteVersion(version);
  10. writer.Write(obj.PoseGroup);
  11. writer.Write(obj.Pose);
  12. writer.Write(obj.CustomPose);
  13. }
  14. public override PoseInfo Deserialize(BinaryReader reader, SceneMetadata metadata)
  15. {
  16. _ = reader.ReadVersion();
  17. return new PoseInfo(reader.ReadString(), reader.ReadString(), reader.ReadBoolean());
  18. }
  19. }
  20. }