diff --git a/SightKeeper.Data/Binary/Model/DataSets/Assets/KeyPoint2D.cs b/SightKeeper.Data/Binary/Model/DataSets/Assets/KeyPoint2D.cs deleted file mode 100644 index 9e1ec9d4..00000000 --- a/SightKeeper.Data/Binary/Model/DataSets/Assets/KeyPoint2D.cs +++ /dev/null @@ -1,13 +0,0 @@ -using SightKeeper.Domain.Model; - -namespace SightKeeper.Data.Binary.Model.DataSets.Assets; - -internal sealed class KeyPoint2D -{ - public Vector2 Position { get; } - - public KeyPoint2D(Vector2 position) - { - Position = position; - } -} \ No newline at end of file diff --git a/SightKeeper.Data/Binary/Model/DataSets/Assets/PackableKeyPoint2D.cs b/SightKeeper.Data/Binary/Model/DataSets/Assets/PackableKeyPoint2D.cs new file mode 100644 index 00000000..dfae5b64 --- /dev/null +++ b/SightKeeper.Data/Binary/Model/DataSets/Assets/PackableKeyPoint2D.cs @@ -0,0 +1,19 @@ +using MemoryPack; +using SightKeeper.Domain.Model; + +namespace SightKeeper.Data.Binary.Model.DataSets.Assets; + +// TODO ISSUE KeyPoint2D actually doesn't exist right now +/// +/// MemoryPackable version of +/// +[MemoryPackable] +internal sealed partial class PackableKeyPoint2D +{ + public Vector2 Position { get; } + + public PackableKeyPoint2D(Vector2 position) + { + Position = position; + } +} \ No newline at end of file diff --git a/SightKeeper.Data/Binary/Model/DataSets/Assets/PackableKeyPoint3D.cs b/SightKeeper.Data/Binary/Model/DataSets/Assets/PackableKeyPoint3D.cs new file mode 100644 index 00000000..7c4dc07b --- /dev/null +++ b/SightKeeper.Data/Binary/Model/DataSets/Assets/PackableKeyPoint3D.cs @@ -0,0 +1,21 @@ +using MemoryPack; +using SightKeeper.Domain.Model; +using SightKeeper.Domain.Model.DataSets.Poser3D; + +namespace SightKeeper.Data.Binary.Model.DataSets.Assets; + +/// +/// MemoryPackable version of +/// +[MemoryPackable] +internal sealed partial class PackableKeyPoint3D +{ + public Vector2 Position { get; } + public bool IsVisible { get; } + + public PackableKeyPoint3D(Vector2 position, bool isVisible) + { + Position = position; + IsVisible = isVisible; + } +} \ No newline at end of file diff --git a/SightKeeper.Data/Binary/Model/DataSets/Assets/PackablePoser2DItem.cs b/SightKeeper.Data/Binary/Model/DataSets/Assets/PackablePoser2DItem.cs index 0443ea45..a38d7c53 100644 --- a/SightKeeper.Data/Binary/Model/DataSets/Assets/PackablePoser2DItem.cs +++ b/SightKeeper.Data/Binary/Model/DataSets/Assets/PackablePoser2DItem.cs @@ -13,9 +13,9 @@ internal sealed partial class PackablePoser2DItem { public byte TagId { get; } public Bounding Bounding { get; } - public ImmutableArray KeyPoints { get; } + public ImmutableArray KeyPoints { get; } - public PackablePoser2DItem(byte tagId, Bounding bounding, ImmutableArray keyPoints) + public PackablePoser2DItem(byte tagId, Bounding bounding, ImmutableArray keyPoints) { TagId = tagId; Bounding = bounding; diff --git a/SightKeeper.Data/Binary/Model/DataSets/Assets/PackablePoser3DItem.cs b/SightKeeper.Data/Binary/Model/DataSets/Assets/PackablePoser3DItem.cs new file mode 100644 index 00000000..48e0d240 --- /dev/null +++ b/SightKeeper.Data/Binary/Model/DataSets/Assets/PackablePoser3DItem.cs @@ -0,0 +1,22 @@ +using System.Collections.Immutable; +using SightKeeper.Domain.Model.DataSets.Assets; +using SightKeeper.Domain.Model.DataSets.Poser3D; + +namespace SightKeeper.Data.Binary.Model.DataSets.Assets; + +/// +/// MemoryPackable version of +/// +internal sealed class PackablePoser3DItem +{ + public byte TagId { get; } + public Bounding Bounding { get; } + public ImmutableArray KeyPoints { get; } + + public PackablePoser3DItem(byte tagId, Bounding bounding, ImmutableArray keyPoints) + { + TagId = tagId; + Bounding = bounding; + KeyPoints = keyPoints; + } +} \ No newline at end of file diff --git a/SightKeeper.Data/Binary/Model/DataSets/PackableDataSet.cs b/SightKeeper.Data/Binary/Model/DataSets/PackableDataSet.cs index a0da7557..4affff57 100644 --- a/SightKeeper.Data/Binary/Model/DataSets/PackableDataSet.cs +++ b/SightKeeper.Data/Binary/Model/DataSets/PackableDataSet.cs @@ -15,6 +15,7 @@ namespace SightKeeper.Data.Binary.Model.DataSets; [MemoryPackUnion(0, typeof(PackableDataSet))] [MemoryPackUnion(1, typeof(PackableDataSet, PackablePlainWeights>))] [MemoryPackUnion(2, typeof(PackableDataSet, PackablePoserWeights>))] +[MemoryPackUnion(3, typeof(PackableDataSet, PackablePoserWeights>))] internal abstract partial class PackableDataSet { public string Name { get; } diff --git a/SightKeeper.Data/Binary/Model/DataSets/Tags/PackablePoser2DTag.cs b/SightKeeper.Data/Binary/Model/DataSets/Tags/PackablePoser2DTag.cs index 6b8dd170..145b469c 100644 --- a/SightKeeper.Data/Binary/Model/DataSets/Tags/PackablePoser2DTag.cs +++ b/SightKeeper.Data/Binary/Model/DataSets/Tags/PackablePoser2DTag.cs @@ -8,17 +8,14 @@ namespace SightKeeper.Data.Binary.Model.DataSets.Tags; /// MemoryPackable version of /// [MemoryPackable] -internal sealed partial class PackablePoser2DTag : PackableTag +internal sealed partial class PackablePoser2DTag : PackablePoserTag { - public ImmutableArray KeyPointTags { get; } - public PackablePoser2DTag( byte id, string name, uint color, ImmutableArray keyPointTags) - : base(id, name, color) + : base(id, name, color, keyPointTags) { - KeyPointTags = keyPointTags; } } \ No newline at end of file diff --git a/SightKeeper.Data/Binary/Model/DataSets/Tags/PackablePoser3DTag.cs b/SightKeeper.Data/Binary/Model/DataSets/Tags/PackablePoser3DTag.cs new file mode 100644 index 00000000..8118d134 --- /dev/null +++ b/SightKeeper.Data/Binary/Model/DataSets/Tags/PackablePoser3DTag.cs @@ -0,0 +1,21 @@ +using System.Collections.Immutable; +using MemoryPack; +using SightKeeper.Domain.Model.DataSets.Poser3D; + +namespace SightKeeper.Data.Binary.Model.DataSets.Tags; + +/// +/// MemoryPackable version of +/// +[MemoryPackable] +internal sealed partial class PackablePoser3DTag : PackablePoserTag +{ + public PackablePoser3DTag( + byte id, + string name, + uint color, + ImmutableArray keyPointTags) + : base(id, name, color, keyPointTags) + { + } +} \ No newline at end of file diff --git a/SightKeeper.Data/Binary/Model/DataSets/Tags/PackablePoserTag.cs b/SightKeeper.Data/Binary/Model/DataSets/Tags/PackablePoserTag.cs new file mode 100644 index 00000000..ba8efec9 --- /dev/null +++ b/SightKeeper.Data/Binary/Model/DataSets/Tags/PackablePoserTag.cs @@ -0,0 +1,17 @@ +using System.Collections.Immutable; +using SightKeeper.Domain.Model.DataSets.Poser; + +namespace SightKeeper.Data.Binary.Model.DataSets.Tags; + +/// +/// MemoryPackable version of +/// +internal abstract partial class PackablePoserTag : PackableTag +{ + public ImmutableArray KeyPointTags { get; } + + protected PackablePoserTag(byte id, string name, uint color, ImmutableArray keyPointTags) : base(id, name, color) + { + KeyPointTags = keyPointTags; + } +} \ No newline at end of file