SceneMetadata.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using System.IO;
  2. namespace COM3D2.MeidoPhotoStudio.Plugin
  3. {
  4. public class SceneMetadata
  5. {
  6. public short Version { get; init; }
  7. public bool Environment { get; init; }
  8. public int MaidCount { get; init; }
  9. public bool MMConverted { get; init; }
  10. public void WriteMetadata(BinaryWriter writer)
  11. {
  12. writer.Write(Version);
  13. writer.Write(Environment);
  14. writer.Write(MaidCount);
  15. writer.Write(MMConverted);
  16. }
  17. public static SceneMetadata ReadMetadata(BinaryReader reader)
  18. {
  19. return new()
  20. {
  21. Version = reader.ReadVersion(),
  22. Environment = reader.ReadBoolean(),
  23. MaidCount = reader.ReadInt32(),
  24. MMConverted = reader.ReadBoolean()
  25. };
  26. }
  27. public void Deconstruct(
  28. out short version, out bool environment, out int maidCount, out bool mmConverted
  29. )
  30. {
  31. version = Version;
  32. environment = Environment;
  33. mmConverted = MMConverted;
  34. maidCount = MaidCount;
  35. }
  36. }
  37. }