2
0
mirror of https://github.com/9ParsonsB/Pulsar.git synced 2025-07-03 01:03:41 -04:00

Initial Commit

This commit is contained in:
2024-04-13 15:54:59 +10:00
parent 8e178cbb7b
commit 63ed43f4af
459 changed files with 8039 additions and 20504 deletions

View File

@ -1,20 +1,17 @@
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;
public class IntBoolConverter : JsonConverter<bool>
{
public class IntBoolConverter : JsonConverter<bool>
public override bool Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
public override bool Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
return reader.GetInt16() == 1;
}
public override void Write(Utf8JsonWriter writer, bool value, JsonSerializerOptions options)
{
writer.WriteNumberValue(value ? 1 : 0);
}
return reader.GetInt16() == 1;
}
}
public override void Write(Utf8JsonWriter writer, bool value, JsonSerializerOptions options)
{
writer.WriteNumberValue(value ? 1 : 0);
}
}