mirror of
https://github.com/9ParsonsB/Pulsar.git
synced 2025-07-03 01:03:41 -04:00
Initial Commit
This commit is contained in:
@ -1,24 +1,22 @@
|
||||
using System;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Observatory.Framework.Files.Converters
|
||||
namespace Observatory.Framework.Files.Converters;
|
||||
|
||||
/// <summary>
|
||||
/// Converting the ordered array of coordinates from the journal to a named tuple for clarity.
|
||||
/// </summary>
|
||||
public class StarPosConverter : JsonConverter<(double x, double y, double z)>
|
||||
{
|
||||
/// <summary>
|
||||
/// Converting the ordered array of coordinates from the journal to a named tuple for clarity.
|
||||
/// </summary>
|
||||
public class StarPosConverter : JsonConverter<(double x, double y, double z)>
|
||||
public override (double x, double y, double z) Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
||||
{
|
||||
public override (double x, double y, double z) Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
||||
{
|
||||
double[] values = (double[])JsonSerializer.Deserialize(ref reader, typeof(double[]));
|
||||
var values = (double[])JsonSerializer.Deserialize(ref reader, typeof(double[]));
|
||||
|
||||
return (x: values[0], y: values[1], z: values[2]);
|
||||
}
|
||||
|
||||
public override void Write(Utf8JsonWriter writer, (double x, double y, double z) value, JsonSerializerOptions options)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
return (x: values[0], y: values[1], z: values[2]);
|
||||
}
|
||||
}
|
||||
|
||||
public override void Write(Utf8JsonWriter writer, (double x, double y, double z) value, JsonSerializerOptions options)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user