From 014e52da60cb2fdc0dfea4cd8db5140c70644517 Mon Sep 17 00:00:00 2001 From: Thad House Date: Sun, 21 Jan 2024 10:50:51 -0800 Subject: [PATCH] Didn't fully commit rotation2d --- src/wpimath/Geometry/Rotation2d.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/wpimath/Geometry/Rotation2d.cs b/src/wpimath/Geometry/Rotation2d.cs index 304cee83..afb9c11a 100644 --- a/src/wpimath/Geometry/Rotation2d.cs +++ b/src/wpimath/Geometry/Rotation2d.cs @@ -50,6 +50,12 @@ public Rotation2d Unpack(ref StructUnpacker buffer) } } +[JsonSourceGenerationOptions(WriteIndented = true)] +[JsonSerializable(typeof(Rotation2d))] +public partial class Rotation2dJsonContext : JsonSerializerContext +{ +} + public readonly struct Rotation2d : IStructSerializable, IProtobufSerializable, IAdditionOperators, @@ -90,16 +96,14 @@ public Rotation2d(double x, double y) } [JsonConstructor] -#pragma warning disable IDE0051 // Remove unused private members - private Rotation2d(double radians) : this(radians.Radians()) + internal Rotation2d(double radians) : this(radians.Radians()) { } [JsonInclude] [JsonPropertyName("radians")] - private readonly double Radians => Angle.Radians; -#pragma warning restore IDE0051 // Remove unused private members + internal readonly double Radians => Angle.Radians; [JsonIgnore(Condition = JsonIgnoreCondition.Always)] public Angle Angle { get; } = 0.Radians();