Skip to content

Commit

Permalink
Didn't fully commit rotation2d
Browse files Browse the repository at this point in the history
  • Loading branch information
ThadHouse committed Jan 21, 2024
1 parent 4b15e88 commit 014e52d
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/wpimath/Geometry/Rotation2d.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Rotation2d>,
IProtobufSerializable<Rotation2d, ProtobufRotation2d>,
IAdditionOperators<Rotation2d, Rotation2d, Rotation2d>,
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 014e52d

Please sign in to comment.