SceneMetadata.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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 bool MMConverted { get; init; }
  9. public int MaidCount { 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 bool mmConverted, out int maidCount
  29. )
  30. {
  31. version = Version;
  32. environment = Environment;
  33. mmConverted = MMConverted;
  34. maidCount = MaidCount;
  35. }
  36. }
  37. }