From 7841e39c73fce213e109e271b7387a870340dd44 Mon Sep 17 00:00:00 2001 From: OndrejNepozitek Date: Sun, 14 Jan 2024 18:26:09 +0100 Subject: [PATCH] Native AOT experiments --- Edgar.NativeAot/Edgar.NativeAot.csproj | 17 + Edgar.NativeAot/Program.cs | 83 +++++ Edgar.NativeAotHelpers/Class1.cs | 9 + .../Edgar.NativeAotHelpers.csproj | 11 + Edgar.NativeAotLib/Edgar.NativeAotLib.csproj | 31 ++ Edgar.NativeAotLib/EntryPoint.cs | 83 +++++ .../LayoutContext.Boolean.g.cs | 34 ++ .../LayoutContext.Direction.g.cs | 34 ++ .../LayoutContext.DoorGrid2D.g.cs | 194 +++++++++++ .../LayoutContext.DoorLineGrid2D.g.cs | 187 +++++++++++ .../LayoutContext.DoorType.g.cs | 34 ++ .../LayoutContext.GetJsonTypeInfo.g.cs | 141 ++++++++ .../LayoutContext.IDoorModeGrid2D.g.cs | 51 +++ .../LayoutContext.IDoorSocket.g.cs | 67 ++++ .../LayoutContext.Int32.g.cs | 34 ++ .../LayoutContext.LayoutDoorGrid2DInt32.g.cs | 222 +++++++++++++ .../LayoutContext.LayoutGrid2DInt32.g.cs | 104 ++++++ .../LayoutContext.LayoutRoomGrid2DInt32.g.cs | 301 ++++++++++++++++++ .../LayoutContext.ListDoorGrid2D.g.cs | 61 ++++ .../LayoutContext.ListDoorLineGrid2D.g.cs | 61 ++++ ...youtContext.ListLayoutDoorGrid2DInt32.g.cs | 61 ++++ ...youtContext.ListLayoutRoomGrid2DInt32.g.cs | 61 ++++ .../LayoutContext.ListRoomTemplateGrid2D.g.cs | 61 ++++ ...ayoutContext.ListTransformationGrid2D.g.cs | 61 ++++ .../LayoutContext.ListVector2Int.g.cs | 61 ++++ .../LayoutContext.ManualDoorModeGrid2D.g.cs | 109 +++++++ ...ontext.NullableRoomTemplateRepeatMode.g.cs | 35 ++ .../LayoutContext.OrthogonalLineGrid2D.g.cs | 172 ++++++++++ .../LayoutContext.PolygonGrid2D.g.cs | 105 ++++++ .../LayoutContext.PropertyNames.g.cs | 39 +++ .../LayoutContext.RectangleGrid2D.g.cs | 205 ++++++++++++ .../LayoutContext.RoomDescriptionGrid2D.g.cs | 108 +++++++ .../LayoutContext.RoomTemplateGrid2D.g.cs | 171 ++++++++++ .../LayoutContext.RoomTemplateRepeatMode.g.cs | 34 ++ .../LayoutContext.SimpleDoorModeGrid2D.g.cs | 162 ++++++++++ .../LayoutContext.String.g.cs | 34 ++ .../LayoutContext.TransformationGrid2D.g.cs | 34 ++ .../LayoutContext.Vector2Int.g.cs | 124 ++++++++ .../LayoutContext.g.cs | 85 +++++ .../LevelDescriptionContext.Boolean.g.cs | 34 ++ ....DictionaryInt32RoomDescriptionGrid2D.g.cs | 41 +++ .../LevelDescriptionContext.Direction.g.cs | 34 ++ .../LevelDescriptionContext.DoorGrid2D.g.cs | 194 +++++++++++ ...evelDescriptionContext.DoorLineGrid2D.g.cs | 187 +++++++++++ .../LevelDescriptionContext.DoorType.g.cs | 34 ++ ...velDescriptionContext.GetJsonTypeInfo.g.cs | 153 +++++++++ ...velDescriptionContext.IDoorModeGrid2D.g.cs | 51 +++ .../LevelDescriptionContext.IDoorSocket.g.cs | 67 ++++ ...ntext.IGeneratorConstraintGrid2DInt32.g.cs | 67 ++++ .../LevelDescriptionContext.Int32.g.cs | 34 ++ ...onContext.LevelDescriptionGrid2DInt32.g.cs | 229 +++++++++++++ ...evelDescriptionContext.ListDoorGrid2D.g.cs | 61 ++++ ...DescriptionContext.ListDoorLineGrid2D.g.cs | 61 ++++ ...t.ListIGeneratorConstraintGrid2DInt32.g.cs | 61 ++++ .../LevelDescriptionContext.ListInt32.g.cs | 61 ++++ ...LevelDescriptionContext.ListListInt32.g.cs | 61 ++++ ...ListPassageInt32RoomDescriptionGrid2D.g.cs | 61 ++++ ...riptionContext.ListRoomTemplateGrid2D.g.cs | 61 ++++ ...ptionContext.ListTransformationGrid2D.g.cs | 61 ++++ ...evelDescriptionContext.ListVector2Int.g.cs | 61 ++++ ...scriptionContext.ManualDoorModeGrid2D.g.cs | 109 +++++++ ...ontext.NullableRoomTemplateRepeatMode.g.cs | 35 ++ ...scriptionContext.OrthogonalLineGrid2D.g.cs | 172 ++++++++++ ...ext.PassageInt32RoomDescriptionGrid2D.g.cs | 132 ++++++++ ...LevelDescriptionContext.PolygonGrid2D.g.cs | 105 ++++++ ...LevelDescriptionContext.PropertyNames.g.cs | 38 +++ ...velDescriptionContext.RectangleGrid2D.g.cs | 205 ++++++++++++ ...criptionContext.RoomDescriptionGrid2D.g.cs | 108 +++++++ ...DescriptionContext.RoomTemplateGrid2D.g.cs | 171 ++++++++++ ...riptionContext.RoomTemplateRepeatMode.g.cs | 34 ++ ...scriptionContext.SimpleDoorModeGrid2D.g.cs | 162 ++++++++++ .../LevelDescriptionContext.String.g.cs | 34 ++ ...scriptionContext.TransformationGrid2D.g.cs | 34 ++ .../LevelDescriptionContext.Vector2Int.g.cs | 124 ++++++++ .../LevelDescriptionContext.g.cs | 85 +++++ Edgar.NativeAotLib/SystemTextJsonUtils.cs | 67 ++++ EdgarDotNet.sln | 50 ++- src/Edgar.Tests/AotTests.cs | 46 +++ src/Edgar.Tests/Edgar.Tests.csproj | 2 +- src/Edgar.UnityBuild/Program.cs | 4 +- src/Edgar/Edgar.csproj | 1 + src/Edgar/Geometry/OrthogonalLineGrid2D.cs | 8 +- src/Edgar/Geometry/PolygonGrid2D.cs | 15 +- src/Edgar/Geometry/RectangleGrid2D.cs | 2 + src/Edgar/Geometry/Vector2Int.cs | 2 + .../Common/LevelDescriptionBase.cs | 15 +- .../Grid2D/Doors/DoorLineGrid2D.cs | 5 +- .../Grid2D/Doors/IDoorModeGrid2D.cs | 3 + .../Grid2D/Doors/ManualDoorModeGrid2D.cs | 20 +- .../Grid2D/LayoutRoomGrid2D.cs | 2 + .../Grid2D/RoomDescriptionGrid2D.cs | 12 +- .../Grid2D/RoomTemplateGrid2D.cs | 18 +- src/Edgar/Utils/JsonUtils2.cs | 44 +++ 93 files changed, 6994 insertions(+), 25 deletions(-) create mode 100644 Edgar.NativeAot/Edgar.NativeAot.csproj create mode 100644 Edgar.NativeAot/Program.cs create mode 100644 Edgar.NativeAotHelpers/Class1.cs create mode 100644 Edgar.NativeAotHelpers/Edgar.NativeAotHelpers.csproj create mode 100644 Edgar.NativeAotLib/Edgar.NativeAotLib.csproj create mode 100644 Edgar.NativeAotLib/EntryPoint.cs create mode 100644 Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.Boolean.g.cs create mode 100644 Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.Direction.g.cs create mode 100644 Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.DoorGrid2D.g.cs create mode 100644 Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.DoorLineGrid2D.g.cs create mode 100644 Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.DoorType.g.cs create mode 100644 Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.GetJsonTypeInfo.g.cs create mode 100644 Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.IDoorModeGrid2D.g.cs create mode 100644 Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.IDoorSocket.g.cs create mode 100644 Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.Int32.g.cs create mode 100644 Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.LayoutDoorGrid2DInt32.g.cs create mode 100644 Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.LayoutGrid2DInt32.g.cs create mode 100644 Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.LayoutRoomGrid2DInt32.g.cs create mode 100644 Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.ListDoorGrid2D.g.cs create mode 100644 Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.ListDoorLineGrid2D.g.cs create mode 100644 Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.ListLayoutDoorGrid2DInt32.g.cs create mode 100644 Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.ListLayoutRoomGrid2DInt32.g.cs create mode 100644 Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.ListRoomTemplateGrid2D.g.cs create mode 100644 Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.ListTransformationGrid2D.g.cs create mode 100644 Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.ListVector2Int.g.cs create mode 100644 Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.ManualDoorModeGrid2D.g.cs create mode 100644 Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.NullableRoomTemplateRepeatMode.g.cs create mode 100644 Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.OrthogonalLineGrid2D.g.cs create mode 100644 Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.PolygonGrid2D.g.cs create mode 100644 Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.PropertyNames.g.cs create mode 100644 Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.RectangleGrid2D.g.cs create mode 100644 Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.RoomDescriptionGrid2D.g.cs create mode 100644 Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.RoomTemplateGrid2D.g.cs create mode 100644 Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.RoomTemplateRepeatMode.g.cs create mode 100644 Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.SimpleDoorModeGrid2D.g.cs create mode 100644 Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.String.g.cs create mode 100644 Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.TransformationGrid2D.g.cs create mode 100644 Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.Vector2Int.g.cs create mode 100644 Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.g.cs create mode 100644 Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.Boolean.g.cs create mode 100644 Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.DictionaryInt32RoomDescriptionGrid2D.g.cs create mode 100644 Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.Direction.g.cs create mode 100644 Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.DoorGrid2D.g.cs create mode 100644 Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.DoorLineGrid2D.g.cs create mode 100644 Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.DoorType.g.cs create mode 100644 Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.GetJsonTypeInfo.g.cs create mode 100644 Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.IDoorModeGrid2D.g.cs create mode 100644 Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.IDoorSocket.g.cs create mode 100644 Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.IGeneratorConstraintGrid2DInt32.g.cs create mode 100644 Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.Int32.g.cs create mode 100644 Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.LevelDescriptionGrid2DInt32.g.cs create mode 100644 Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.ListDoorGrid2D.g.cs create mode 100644 Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.ListDoorLineGrid2D.g.cs create mode 100644 Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.ListIGeneratorConstraintGrid2DInt32.g.cs create mode 100644 Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.ListInt32.g.cs create mode 100644 Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.ListListInt32.g.cs create mode 100644 Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.ListPassageInt32RoomDescriptionGrid2D.g.cs create mode 100644 Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.ListRoomTemplateGrid2D.g.cs create mode 100644 Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.ListTransformationGrid2D.g.cs create mode 100644 Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.ListVector2Int.g.cs create mode 100644 Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.ManualDoorModeGrid2D.g.cs create mode 100644 Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.NullableRoomTemplateRepeatMode.g.cs create mode 100644 Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.OrthogonalLineGrid2D.g.cs create mode 100644 Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.PassageInt32RoomDescriptionGrid2D.g.cs create mode 100644 Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.PolygonGrid2D.g.cs create mode 100644 Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.PropertyNames.g.cs create mode 100644 Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.RectangleGrid2D.g.cs create mode 100644 Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.RoomDescriptionGrid2D.g.cs create mode 100644 Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.RoomTemplateGrid2D.g.cs create mode 100644 Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.RoomTemplateRepeatMode.g.cs create mode 100644 Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.SimpleDoorModeGrid2D.g.cs create mode 100644 Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.String.g.cs create mode 100644 Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.TransformationGrid2D.g.cs create mode 100644 Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.Vector2Int.g.cs create mode 100644 Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.g.cs create mode 100644 Edgar.NativeAotLib/SystemTextJsonUtils.cs create mode 100644 src/Edgar.Tests/AotTests.cs create mode 100644 src/Edgar/Utils/JsonUtils2.cs diff --git a/Edgar.NativeAot/Edgar.NativeAot.csproj b/Edgar.NativeAot/Edgar.NativeAot.csproj new file mode 100644 index 00000000..961c2989 --- /dev/null +++ b/Edgar.NativeAot/Edgar.NativeAot.csproj @@ -0,0 +1,17 @@ + + + + Exe + net8.0 + enable + enable + true + true + + + + + + + + diff --git a/Edgar.NativeAot/Program.cs b/Edgar.NativeAot/Program.cs new file mode 100644 index 00000000..777c1b2a --- /dev/null +++ b/Edgar.NativeAot/Program.cs @@ -0,0 +1,83 @@ +using Edgar.Geometry; +using Edgar.GraphBasedGenerator.Common; +using Edgar.GraphBasedGenerator.Grid2D; +using Edgar.Legacy.Utils; +using Edgar.NativeAotLib; +using Edgar.Utils; +using System.Diagnostics; +using File = System.IO.File; + +namespace Edgar.NativeAot +{ + internal class Program + { + static void Main(string[] args) + { + GenerateFromUnity(); + return; + + Console.WriteLine("Running..."); + Console.WriteLine(DateTime.Now); + + var graph = GraphsDatabase.GetExample4(); + var roomTemplates = new List() + { + new RoomTemplateGrid2D(PolygonGrid2D.GetSquare(10), new SimpleDoorModeGrid2D(1, 1)), + }; + + var levelDescription = new LevelDescriptionGrid2D(); + foreach (var graphVertex in graph.Vertices) + { + levelDescription.AddRoom(graphVertex, new RoomDescriptionGrid2D(false, roomTemplates)); + } + + foreach (var graphEdge in graph.Edges) + { + levelDescription.AddConnection(graphEdge.From, graphEdge.To); + } + + var levelDescriptionJson = SystemTextJsonUtils.SerializeToJson(levelDescription); + File.WriteAllText("levelDescription.json", levelDescriptionJson); + var deserializedLevelDescription = SystemTextJsonUtils.DeserializeFromJson(levelDescriptionJson); + var levelDescriptionJson2 = SystemTextJsonUtils.SerializeToJson(deserializedLevelDescription); + File.WriteAllText("levelDescriptionRe.json", levelDescriptionJson2); + + if (levelDescriptionJson != levelDescriptionJson2) + { + throw new InvalidOperationException(); + } + + var random = new Random(0); + var generator = new GraphBasedGeneratorGrid2D(levelDescription); + generator.InjectRandomGenerator(random); + + var layout = generator.GenerateLayout(); + + var layoutJson = SystemTextJsonUtils.SerializeToJson(layout); + File.WriteAllText("layout.json", layoutJson); + + Console.WriteLine(DateTime.Now); + } + + private static void GenerateFromUnity() + { + var json = File.ReadAllText("levelDescriptionUnity.json"); + var levelDescription = SystemTextJsonUtils.DeserializeFromJson(json); + + var sw = new Stopwatch(); + sw.Start(); + + var random = new Random(1198642031); + var generator = new GraphBasedGeneratorGrid2D(levelDescription); + generator.InjectRandomGenerator(random); + + var layout = generator.GenerateLayout(); + var layoutJson = SystemTextJsonUtils.SerializeToJson(layout); + + Console.WriteLine($"Layout generated in {sw.ElapsedMilliseconds / 1000f:F} seconds"); + Console.WriteLine($"Iterations: {generator.IterationsCount}, time: {generator.TimeTotal}"); + + File.WriteAllText("layoutUnity.json", layoutJson); + } + } +} \ No newline at end of file diff --git a/Edgar.NativeAotHelpers/Class1.cs b/Edgar.NativeAotHelpers/Class1.cs new file mode 100644 index 00000000..1cd8cbdf --- /dev/null +++ b/Edgar.NativeAotHelpers/Class1.cs @@ -0,0 +1,9 @@ +using System; + +namespace Edgar.NativeAotHelpers +{ + public class Class1 + { + + } +} diff --git a/Edgar.NativeAotHelpers/Edgar.NativeAotHelpers.csproj b/Edgar.NativeAotHelpers/Edgar.NativeAotHelpers.csproj new file mode 100644 index 00000000..dbbd17e2 --- /dev/null +++ b/Edgar.NativeAotHelpers/Edgar.NativeAotHelpers.csproj @@ -0,0 +1,11 @@ + + + + netstandard2.0 + + + + + + + diff --git a/Edgar.NativeAotLib/Edgar.NativeAotLib.csproj b/Edgar.NativeAotLib/Edgar.NativeAotLib.csproj new file mode 100644 index 00000000..4d176f39 --- /dev/null +++ b/Edgar.NativeAotLib/Edgar.NativeAotLib.csproj @@ -0,0 +1,31 @@ + + + + net8.0 + enable + enable + true + + + + + + + + + true + + GeneratedFiles + + + + + + + + + + + + + diff --git a/Edgar.NativeAotLib/EntryPoint.cs b/Edgar.NativeAotLib/EntryPoint.cs new file mode 100644 index 00000000..5cf91593 --- /dev/null +++ b/Edgar.NativeAotLib/EntryPoint.cs @@ -0,0 +1,83 @@ +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using Edgar.Geometry; +using Edgar.GraphBasedGenerator.Grid2D; +using Edgar.Legacy.Utils; + +namespace Edgar.NativeAotLib { + public static class EntryPoint + { + [UnmanagedCallersOnly(EntryPoint = "GenerateLevel", CallConvs = new[] { typeof(CallConvCdecl) })] + public static IntPtr GenerateLevel(IntPtr levelDescriptionJsonPtr, int seed) + { + try + { + var levelDescriptionJson = Marshal.PtrToStringAnsi(levelDescriptionJsonPtr) ?? string.Empty; + var levelDescription = SystemTextJsonUtils.DeserializeFromJson(levelDescriptionJson)!; + + var random = new Random(seed); + var generator = new GraphBasedGeneratorGrid2D(levelDescription); + generator.InjectRandomGenerator(random); + + var layout = generator.GenerateLayout(); + var layoutJson = SystemTextJsonUtils.SerializeToJson(layout); + + var result = Marshal.StringToHGlobalAnsi(layoutJson); + + return result; + } + catch + { + return IntPtr.Zero; + } + } + + [UnmanagedCallersOnly(EntryPoint = "GenerateLevelDummy")] + public static IntPtr GenerateLevelDummy(IntPtr levelDescriptionJsonPtr, int seed) + { + var levelDescriptionJson = Marshal.PtrToStringAnsi(levelDescriptionJsonPtr) ?? string.Empty; + var result = Marshal.StringToHGlobalAnsi(levelDescriptionJson); + + return result; + } + + [UnmanagedCallersOnly(EntryPoint = "RunNativeEdgar")] + public static int RunNativeEdgar(int count) + { + var graph = GraphsDatabase.GetExample4(); + var roomTemplates = new List() + { + new RoomTemplateGrid2D(PolygonGrid2D.GetSquare(10), new SimpleDoorModeGrid2D(1, 1)), + }; + + var levelDescription = new LevelDescriptionGrid2D(); + foreach (var graphVertex in graph.Vertices) + { + levelDescription.AddRoom(graphVertex, new RoomDescriptionGrid2D(false, roomTemplates)); + } + + foreach (var graphEdge in graph.Edges) + { + levelDescription.AddConnection(graphEdge.From, graphEdge.To); + } + + var random = new Random(0); + var generator = new GraphBasedGeneratorGrid2D(levelDescription); + generator.InjectRandomGenerator(random); + var successCount = 0; + + for (int i = 0; i < count; i++) + { + var level = generator.GenerateLayout(); + if (level != null) + { + successCount++; + } + } + + return successCount; + } + } + +} + diff --git a/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.Boolean.g.cs b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.Boolean.g.cs new file mode 100644 index 00000000..7efdb578 --- /dev/null +++ b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.Boolean.g.cs @@ -0,0 +1,34 @@ +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Edgar.NativeAotLib +{ + public partial class LayoutContext + { + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? _Boolean; + + /// + /// Defines the source generated JSON serialization contract metadata for a given type. + /// + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Boolean + { + get => _Boolean ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo)Options.GetTypeInfo(typeof(bool)); + } + + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Create_Boolean(global::System.Text.Json.JsonSerializerOptions options) + { + if (!TryGetTypeInfoForRuntimeCustomConverter(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo)) + { + jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateValueInfo(options, global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.BooleanConverter); + } + + jsonTypeInfo.OriginatingResolver = this; + return jsonTypeInfo; + } + } +} diff --git a/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.Direction.g.cs b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.Direction.g.cs new file mode 100644 index 00000000..d7f3ab6d --- /dev/null +++ b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.Direction.g.cs @@ -0,0 +1,34 @@ +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Edgar.NativeAotLib +{ + public partial class LayoutContext + { + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? _Direction; + + /// + /// Defines the source generated JSON serialization contract metadata for a given type. + /// + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Direction + { + get => _Direction ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo)Options.GetTypeInfo(typeof(global::Edgar.Geometry.OrthogonalLineGrid2D.Direction)); + } + + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Create_Direction(global::System.Text.Json.JsonSerializerOptions options) + { + if (!TryGetTypeInfoForRuntimeCustomConverter(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo)) + { + jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateValueInfo(options, global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.GetEnumConverter(options)); + } + + jsonTypeInfo.OriginatingResolver = this; + return jsonTypeInfo; + } + } +} diff --git a/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.DoorGrid2D.g.cs b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.DoorGrid2D.g.cs new file mode 100644 index 00000000..b46614b7 --- /dev/null +++ b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.DoorGrid2D.g.cs @@ -0,0 +1,194 @@ +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Edgar.NativeAotLib +{ + public partial class LayoutContext + { + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? _DoorGrid2D; + + /// + /// Defines the source generated JSON serialization contract metadata for a given type. + /// + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo DoorGrid2D + { + get => _DoorGrid2D ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo)Options.GetTypeInfo(typeof(global::Edgar.GraphBasedGenerator.Grid2D.DoorGrid2D)); + } + + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Create_DoorGrid2D(global::System.Text.Json.JsonSerializerOptions options) + { + if (!TryGetTypeInfoForRuntimeCustomConverter(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo)) + { + var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues + { + ObjectCreator = null, + ObjectWithParameterizedConstructorCreator = static args => new global::Edgar.GraphBasedGenerator.Grid2D.DoorGrid2D((global::Edgar.Geometry.Vector2Int)args[0], (global::Edgar.Geometry.Vector2Int)args[1], (global::Edgar.GraphBasedGenerator.Common.Doors.IDoorSocket)args[2], (global::Edgar.GraphBasedGenerator.Common.Doors.DoorType)args[3]), + PropertyMetadataInitializer = _ => DoorGrid2DPropInit(options), + ConstructorParameterMetadataInitializer = DoorGrid2DCtorParamInit, + SerializeHandler = DoorGrid2DSerializeHandler + }; + + jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo(options, objectInfo); + jsonTypeInfo.NumberHandling = null; + } + + jsonTypeInfo.OriginatingResolver = this; + return jsonTypeInfo; + } + + private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] DoorGrid2DPropInit(global::System.Text.Json.JsonSerializerOptions options) + { + var properties = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[4]; + + var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.GraphBasedGenerator.Grid2D.DoorGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.GraphBasedGenerator.Grid2D.DoorGrid2D)obj).From, + Setter = null, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "From", + JsonPropertyName = null + }; + + properties[0] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info0); + + var info1 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.GraphBasedGenerator.Grid2D.DoorGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.GraphBasedGenerator.Grid2D.DoorGrid2D)obj).To, + Setter = null, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "To", + JsonPropertyName = null + }; + + properties[1] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info1); + + var info2 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.GraphBasedGenerator.Grid2D.DoorGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.GraphBasedGenerator.Grid2D.DoorGrid2D)obj).Socket, + Setter = null, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "Socket", + JsonPropertyName = null + }; + + properties[2] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info2); + + var info3 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.GraphBasedGenerator.Grid2D.DoorGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.GraphBasedGenerator.Grid2D.DoorGrid2D)obj).Type, + Setter = null, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "Type", + JsonPropertyName = null + }; + + properties[3] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info3); + + return properties; + } + + // Intentionally not a static method because we create a delegate to it. Invoking delegates to instance + // methods is almost as fast as virtual calls. Static methods need to go through a shuffle thunk. + private void DoorGrid2DSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Edgar.GraphBasedGenerator.Grid2D.DoorGrid2D? value) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + + writer.WriteStartObject(); + + writer.WritePropertyName(PropName_From); + Vector2IntSerializeHandler(writer, ((global::Edgar.GraphBasedGenerator.Grid2D.DoorGrid2D)value).From); + writer.WritePropertyName(PropName_To); + Vector2IntSerializeHandler(writer, ((global::Edgar.GraphBasedGenerator.Grid2D.DoorGrid2D)value).To); + writer.WritePropertyName(PropName_Socket); + IDoorSocketSerializeHandler(writer, ((global::Edgar.GraphBasedGenerator.Grid2D.DoorGrid2D)value).Socket); + writer.WritePropertyName(PropName_Type); + global::System.Text.Json.JsonSerializer.Serialize(writer, ((global::Edgar.GraphBasedGenerator.Grid2D.DoorGrid2D)value).Type, DoorType); + + writer.WriteEndObject(); + } + + private static global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[] DoorGrid2DCtorParamInit() + { + var parameters = new global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[4]; + + parameters[0] = new() + { + Name = "from", + ParameterType = typeof(global::Edgar.Geometry.Vector2Int), + Position = 0, + HasDefaultValue = false, + DefaultValue = default(global::Edgar.Geometry.Vector2Int) + }; + + parameters[1] = new() + { + Name = "to", + ParameterType = typeof(global::Edgar.Geometry.Vector2Int), + Position = 1, + HasDefaultValue = false, + DefaultValue = default(global::Edgar.Geometry.Vector2Int) + }; + + parameters[2] = new() + { + Name = "socket", + ParameterType = typeof(global::Edgar.GraphBasedGenerator.Common.Doors.IDoorSocket), + Position = 2, + HasDefaultValue = true, + DefaultValue = default(global::Edgar.GraphBasedGenerator.Common.Doors.IDoorSocket) + }; + + parameters[3] = new() + { + Name = "type", + ParameterType = typeof(global::Edgar.GraphBasedGenerator.Common.Doors.DoorType), + Position = 3, + HasDefaultValue = true, + DefaultValue = (global::Edgar.GraphBasedGenerator.Common.Doors.DoorType)(0) + }; + + return parameters; + } + } +} diff --git a/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.DoorLineGrid2D.g.cs b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.DoorLineGrid2D.g.cs new file mode 100644 index 00000000..a5ccd97f --- /dev/null +++ b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.DoorLineGrid2D.g.cs @@ -0,0 +1,187 @@ +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Edgar.NativeAotLib +{ + public partial class LayoutContext + { + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? _DoorLineGrid2D; + + /// + /// Defines the source generated JSON serialization contract metadata for a given type. + /// + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo DoorLineGrid2D + { + get => _DoorLineGrid2D ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo)Options.GetTypeInfo(typeof(global::Edgar.GraphBasedGenerator.Grid2D.DoorLineGrid2D)); + } + + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Create_DoorLineGrid2D(global::System.Text.Json.JsonSerializerOptions options) + { + if (!TryGetTypeInfoForRuntimeCustomConverter(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo)) + { + var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues + { + ObjectCreator = null, + ObjectWithParameterizedConstructorCreator = static args => new global::Edgar.GraphBasedGenerator.Grid2D.DoorLineGrid2D((global::Edgar.Geometry.OrthogonalLineGrid2D)args[0], (int)args[1], (global::Edgar.GraphBasedGenerator.Common.Doors.IDoorSocket)args[2], (global::Edgar.GraphBasedGenerator.Common.Doors.DoorType)args[3]), + PropertyMetadataInitializer = _ => DoorLineGrid2DPropInit(options), + ConstructorParameterMetadataInitializer = DoorLineGrid2DCtorParamInit, + SerializeHandler = DoorLineGrid2DSerializeHandler + }; + + jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo(options, objectInfo); + jsonTypeInfo.NumberHandling = null; + } + + jsonTypeInfo.OriginatingResolver = this; + return jsonTypeInfo; + } + + private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] DoorLineGrid2DPropInit(global::System.Text.Json.JsonSerializerOptions options) + { + var properties = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[4]; + + var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.GraphBasedGenerator.Grid2D.DoorLineGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.GraphBasedGenerator.Grid2D.DoorLineGrid2D)obj).Line, + Setter = null, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "Line", + JsonPropertyName = null + }; + + properties[0] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info0); + + var info1 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.GraphBasedGenerator.Grid2D.DoorLineGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.GraphBasedGenerator.Grid2D.DoorLineGrid2D)obj).Length, + Setter = null, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "Length", + JsonPropertyName = null + }; + + properties[1] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info1); + + var info2 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.GraphBasedGenerator.Grid2D.DoorLineGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.GraphBasedGenerator.Grid2D.DoorLineGrid2D)obj).DoorSocket, + Setter = null, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "DoorSocket", + JsonPropertyName = null + }; + + properties[2] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info2); + + var info3 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.GraphBasedGenerator.Grid2D.DoorLineGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.GraphBasedGenerator.Grid2D.DoorLineGrid2D)obj).Type, + Setter = null, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "Type", + JsonPropertyName = null + }; + + properties[3] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info3); + + return properties; + } + + // Intentionally not a static method because we create a delegate to it. Invoking delegates to instance + // methods is almost as fast as virtual calls. Static methods need to go through a shuffle thunk. + private void DoorLineGrid2DSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Edgar.GraphBasedGenerator.Grid2D.DoorLineGrid2D value) + { + writer.WriteStartObject(); + + writer.WritePropertyName(PropName_Line); + OrthogonalLineGrid2DSerializeHandler(writer, ((global::Edgar.GraphBasedGenerator.Grid2D.DoorLineGrid2D)value).Line); + writer.WriteNumber(PropName_Length, ((global::Edgar.GraphBasedGenerator.Grid2D.DoorLineGrid2D)value).Length); + writer.WritePropertyName(PropName_DoorSocket); + IDoorSocketSerializeHandler(writer, ((global::Edgar.GraphBasedGenerator.Grid2D.DoorLineGrid2D)value).DoorSocket); + writer.WritePropertyName(PropName_Type); + global::System.Text.Json.JsonSerializer.Serialize(writer, ((global::Edgar.GraphBasedGenerator.Grid2D.DoorLineGrid2D)value).Type, DoorType); + + writer.WriteEndObject(); + } + + private static global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[] DoorLineGrid2DCtorParamInit() + { + var parameters = new global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[4]; + + parameters[0] = new() + { + Name = "line", + ParameterType = typeof(global::Edgar.Geometry.OrthogonalLineGrid2D), + Position = 0, + HasDefaultValue = false, + DefaultValue = default(global::Edgar.Geometry.OrthogonalLineGrid2D) + }; + + parameters[1] = new() + { + Name = "length", + ParameterType = typeof(int), + Position = 1, + HasDefaultValue = false, + DefaultValue = default(int) + }; + + parameters[2] = new() + { + Name = "doorSocket", + ParameterType = typeof(global::Edgar.GraphBasedGenerator.Common.Doors.IDoorSocket), + Position = 2, + HasDefaultValue = false, + DefaultValue = default(global::Edgar.GraphBasedGenerator.Common.Doors.IDoorSocket) + }; + + parameters[3] = new() + { + Name = "type", + ParameterType = typeof(global::Edgar.GraphBasedGenerator.Common.Doors.DoorType), + Position = 3, + HasDefaultValue = false, + DefaultValue = default(global::Edgar.GraphBasedGenerator.Common.Doors.DoorType) + }; + + return parameters; + } + } +} diff --git a/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.DoorType.g.cs b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.DoorType.g.cs new file mode 100644 index 00000000..e25881bf --- /dev/null +++ b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.DoorType.g.cs @@ -0,0 +1,34 @@ +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Edgar.NativeAotLib +{ + public partial class LayoutContext + { + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? _DoorType; + + /// + /// Defines the source generated JSON serialization contract metadata for a given type. + /// + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo DoorType + { + get => _DoorType ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo)Options.GetTypeInfo(typeof(global::Edgar.GraphBasedGenerator.Common.Doors.DoorType)); + } + + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Create_DoorType(global::System.Text.Json.JsonSerializerOptions options) + { + if (!TryGetTypeInfoForRuntimeCustomConverter(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo)) + { + jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateValueInfo(options, global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.GetEnumConverter(options)); + } + + jsonTypeInfo.OriginatingResolver = this; + return jsonTypeInfo; + } + } +} diff --git a/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.GetJsonTypeInfo.g.cs b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.GetJsonTypeInfo.g.cs new file mode 100644 index 00000000..93f04ef3 --- /dev/null +++ b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.GetJsonTypeInfo.g.cs @@ -0,0 +1,141 @@ +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Edgar.NativeAotLib +{ + public partial class LayoutContext : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver + { + /// + public override global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo(global::System.Type type) + { + Options.TryGetTypeInfo(type, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? typeInfo); + return typeInfo; + } + + global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver.GetTypeInfo(global::System.Type type, global::System.Text.Json.JsonSerializerOptions options) + { + if (type == typeof(bool)) + { + return Create_Boolean(options); + } + if (type == typeof(global::Edgar.Geometry.OrthogonalLineGrid2D)) + { + return Create_OrthogonalLineGrid2D(options); + } + if (type == typeof(global::Edgar.Geometry.OrthogonalLineGrid2D.Direction)) + { + return Create_Direction(options); + } + if (type == typeof(global::Edgar.Geometry.PolygonGrid2D)) + { + return Create_PolygonGrid2D(options); + } + if (type == typeof(global::Edgar.Geometry.TransformationGrid2D)) + { + return Create_TransformationGrid2D(options); + } + if (type == typeof(global::Edgar.Geometry.Vector2Int)) + { + return Create_Vector2Int(options); + } + if (type == typeof(global::Edgar.GraphBasedGenerator.Common.Doors.DoorType)) + { + return Create_DoorType(options); + } + if (type == typeof(global::Edgar.GraphBasedGenerator.Common.Doors.IDoorSocket)) + { + return Create_IDoorSocket(options); + } + if (type == typeof(global::Edgar.GraphBasedGenerator.Common.RoomTemplateRepeatMode)) + { + return Create_RoomTemplateRepeatMode(options); + } + if (type == typeof(global::Edgar.GraphBasedGenerator.Common.RoomTemplateRepeatMode?)) + { + return Create_NullableRoomTemplateRepeatMode(options); + } + if (type == typeof(global::Edgar.GraphBasedGenerator.Grid2D.DoorGrid2D)) + { + return Create_DoorGrid2D(options); + } + if (type == typeof(global::Edgar.GraphBasedGenerator.Grid2D.DoorLineGrid2D)) + { + return Create_DoorLineGrid2D(options); + } + if (type == typeof(global::Edgar.GraphBasedGenerator.Grid2D.IDoorModeGrid2D)) + { + return Create_IDoorModeGrid2D(options); + } + if (type == typeof(global::Edgar.GraphBasedGenerator.Grid2D.LayoutDoorGrid2D)) + { + return Create_LayoutDoorGrid2DInt32(options); + } + if (type == typeof(global::Edgar.GraphBasedGenerator.Grid2D.LayoutGrid2D)) + { + return Create_LayoutGrid2DInt32(options); + } + if (type == typeof(global::Edgar.GraphBasedGenerator.Grid2D.LayoutRoomGrid2D)) + { + return Create_LayoutRoomGrid2DInt32(options); + } + if (type == typeof(global::Edgar.GraphBasedGenerator.Grid2D.ManualDoorModeGrid2D)) + { + return Create_ManualDoorModeGrid2D(options); + } + if (type == typeof(global::Edgar.GraphBasedGenerator.Grid2D.RoomDescriptionGrid2D)) + { + return Create_RoomDescriptionGrid2D(options); + } + if (type == typeof(global::Edgar.GraphBasedGenerator.Grid2D.RoomTemplateGrid2D)) + { + return Create_RoomTemplateGrid2D(options); + } + if (type == typeof(global::Edgar.GraphBasedGenerator.Grid2D.SimpleDoorModeGrid2D)) + { + return Create_SimpleDoorModeGrid2D(options); + } + if (type == typeof(global::System.Collections.Generic.List)) + { + return Create_ListTransformationGrid2D(options); + } + if (type == typeof(global::System.Collections.Generic.List)) + { + return Create_ListVector2Int(options); + } + if (type == typeof(global::System.Collections.Generic.List)) + { + return Create_ListDoorGrid2D(options); + } + if (type == typeof(global::System.Collections.Generic.List)) + { + return Create_ListDoorLineGrid2D(options); + } + if (type == typeof(global::System.Collections.Generic.List>)) + { + return Create_ListLayoutDoorGrid2DInt32(options); + } + if (type == typeof(global::System.Collections.Generic.List>)) + { + return Create_ListLayoutRoomGrid2DInt32(options); + } + if (type == typeof(global::System.Collections.Generic.List)) + { + return Create_ListRoomTemplateGrid2D(options); + } + if (type == typeof(int)) + { + return Create_Int32(options); + } + if (type == typeof(string)) + { + return Create_String(options); + } + return null; + } + } +} diff --git a/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.IDoorModeGrid2D.g.cs b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.IDoorModeGrid2D.g.cs new file mode 100644 index 00000000..a058c871 --- /dev/null +++ b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.IDoorModeGrid2D.g.cs @@ -0,0 +1,51 @@ +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Edgar.NativeAotLib +{ + public partial class LayoutContext + { + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? _IDoorModeGrid2D; + + /// + /// Defines the source generated JSON serialization contract metadata for a given type. + /// + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo IDoorModeGrid2D + { + get => _IDoorModeGrid2D ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo)Options.GetTypeInfo(typeof(global::Edgar.GraphBasedGenerator.Grid2D.IDoorModeGrid2D)); + } + + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Create_IDoorModeGrid2D(global::System.Text.Json.JsonSerializerOptions options) + { + if (!TryGetTypeInfoForRuntimeCustomConverter(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo)) + { + var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues + { + ObjectCreator = null, + ObjectWithParameterizedConstructorCreator = null, + PropertyMetadataInitializer = _ => IDoorModeGrid2DPropInit(options), + ConstructorParameterMetadataInitializer = null, + SerializeHandler = null + }; + + jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo(options, objectInfo); + jsonTypeInfo.NumberHandling = null; + } + + jsonTypeInfo.OriginatingResolver = this; + return jsonTypeInfo; + } + + private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] IDoorModeGrid2DPropInit(global::System.Text.Json.JsonSerializerOptions options) + { + var properties = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[0]; + + return properties; + } + } +} diff --git a/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.IDoorSocket.g.cs b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.IDoorSocket.g.cs new file mode 100644 index 00000000..f59eda0f --- /dev/null +++ b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.IDoorSocket.g.cs @@ -0,0 +1,67 @@ +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Edgar.NativeAotLib +{ + public partial class LayoutContext + { + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? _IDoorSocket; + + /// + /// Defines the source generated JSON serialization contract metadata for a given type. + /// + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo IDoorSocket + { + get => _IDoorSocket ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo)Options.GetTypeInfo(typeof(global::Edgar.GraphBasedGenerator.Common.Doors.IDoorSocket)); + } + + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Create_IDoorSocket(global::System.Text.Json.JsonSerializerOptions options) + { + if (!TryGetTypeInfoForRuntimeCustomConverter(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo)) + { + var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues + { + ObjectCreator = null, + ObjectWithParameterizedConstructorCreator = null, + PropertyMetadataInitializer = _ => IDoorSocketPropInit(options), + ConstructorParameterMetadataInitializer = null, + SerializeHandler = IDoorSocketSerializeHandler + }; + + jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo(options, objectInfo); + jsonTypeInfo.NumberHandling = null; + } + + jsonTypeInfo.OriginatingResolver = this; + return jsonTypeInfo; + } + + private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] IDoorSocketPropInit(global::System.Text.Json.JsonSerializerOptions options) + { + var properties = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[0]; + + return properties; + } + + // Intentionally not a static method because we create a delegate to it. Invoking delegates to instance + // methods is almost as fast as virtual calls. Static methods need to go through a shuffle thunk. + private void IDoorSocketSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Edgar.GraphBasedGenerator.Common.Doors.IDoorSocket? value) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + + writer.WriteStartObject(); + + + writer.WriteEndObject(); + } + } +} diff --git a/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.Int32.g.cs b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.Int32.g.cs new file mode 100644 index 00000000..be0e0831 --- /dev/null +++ b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.Int32.g.cs @@ -0,0 +1,34 @@ +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Edgar.NativeAotLib +{ + public partial class LayoutContext + { + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? _Int32; + + /// + /// Defines the source generated JSON serialization contract metadata for a given type. + /// + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Int32 + { + get => _Int32 ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo)Options.GetTypeInfo(typeof(int)); + } + + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Create_Int32(global::System.Text.Json.JsonSerializerOptions options) + { + if (!TryGetTypeInfoForRuntimeCustomConverter(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo)) + { + jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateValueInfo(options, global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.Int32Converter); + } + + jsonTypeInfo.OriginatingResolver = this; + return jsonTypeInfo; + } + } +} diff --git a/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.LayoutDoorGrid2DInt32.g.cs b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.LayoutDoorGrid2DInt32.g.cs new file mode 100644 index 00000000..20fad595 --- /dev/null +++ b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.LayoutDoorGrid2DInt32.g.cs @@ -0,0 +1,222 @@ +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Edgar.NativeAotLib +{ + public partial class LayoutContext + { + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo>? _LayoutDoorGrid2DInt32; + + /// + /// Defines the source generated JSON serialization contract metadata for a given type. + /// + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo> LayoutDoorGrid2DInt32 + { + get => _LayoutDoorGrid2DInt32 ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo>)Options.GetTypeInfo(typeof(global::Edgar.GraphBasedGenerator.Grid2D.LayoutDoorGrid2D)); + } + + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo> Create_LayoutDoorGrid2DInt32(global::System.Text.Json.JsonSerializerOptions options) + { + if (!TryGetTypeInfoForRuntimeCustomConverter>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo> jsonTypeInfo)) + { + var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues> + { + ObjectCreator = null, + ObjectWithParameterizedConstructorCreator = static args => new global::Edgar.GraphBasedGenerator.Grid2D.LayoutDoorGrid2D((int)args[0], (int)args[1], (global::Edgar.Geometry.OrthogonalLineGrid2D)args[2], (global::Edgar.GraphBasedGenerator.Common.Doors.IDoorSocket)args[3], (global::Edgar.GraphBasedGenerator.Common.Doors.DoorType)args[4]), + PropertyMetadataInitializer = _ => LayoutDoorGrid2DInt32PropInit(options), + ConstructorParameterMetadataInitializer = LayoutDoorGrid2DInt32CtorParamInit, + SerializeHandler = LayoutDoorGrid2DInt32SerializeHandler + }; + + jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo>(options, objectInfo); + jsonTypeInfo.NumberHandling = null; + } + + jsonTypeInfo.OriginatingResolver = this; + return jsonTypeInfo; + } + + private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] LayoutDoorGrid2DInt32PropInit(global::System.Text.Json.JsonSerializerOptions options) + { + var properties = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[5]; + + var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.GraphBasedGenerator.Grid2D.LayoutDoorGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.GraphBasedGenerator.Grid2D.LayoutDoorGrid2D)obj).FromRoom, + Setter = null, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "FromRoom", + JsonPropertyName = null + }; + + properties[0] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info0); + + var info1 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.GraphBasedGenerator.Grid2D.LayoutDoorGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.GraphBasedGenerator.Grid2D.LayoutDoorGrid2D)obj).ToRoom, + Setter = null, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "ToRoom", + JsonPropertyName = null + }; + + properties[1] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info1); + + var info2 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.GraphBasedGenerator.Grid2D.LayoutDoorGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.GraphBasedGenerator.Grid2D.LayoutDoorGrid2D)obj).DoorLine, + Setter = null, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "DoorLine", + JsonPropertyName = null + }; + + properties[2] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info2); + + var info3 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.GraphBasedGenerator.Grid2D.LayoutDoorGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.GraphBasedGenerator.Grid2D.LayoutDoorGrid2D)obj).Socket, + Setter = null, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "Socket", + JsonPropertyName = null + }; + + properties[3] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info3); + + var info4 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.GraphBasedGenerator.Grid2D.LayoutDoorGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.GraphBasedGenerator.Grid2D.LayoutDoorGrid2D)obj).Type, + Setter = null, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "Type", + JsonPropertyName = null + }; + + properties[4] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info4); + + return properties; + } + + // Intentionally not a static method because we create a delegate to it. Invoking delegates to instance + // methods is almost as fast as virtual calls. Static methods need to go through a shuffle thunk. + private void LayoutDoorGrid2DInt32SerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Edgar.GraphBasedGenerator.Grid2D.LayoutDoorGrid2D? value) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + + writer.WriteStartObject(); + + writer.WriteNumber(PropName_FromRoom, ((global::Edgar.GraphBasedGenerator.Grid2D.LayoutDoorGrid2D)value).FromRoom); + writer.WriteNumber(PropName_ToRoom, ((global::Edgar.GraphBasedGenerator.Grid2D.LayoutDoorGrid2D)value).ToRoom); + writer.WritePropertyName(PropName_DoorLine); + OrthogonalLineGrid2DSerializeHandler(writer, ((global::Edgar.GraphBasedGenerator.Grid2D.LayoutDoorGrid2D)value).DoorLine); + writer.WritePropertyName(PropName_Socket); + IDoorSocketSerializeHandler(writer, ((global::Edgar.GraphBasedGenerator.Grid2D.LayoutDoorGrid2D)value).Socket); + writer.WritePropertyName(PropName_Type); + global::System.Text.Json.JsonSerializer.Serialize(writer, ((global::Edgar.GraphBasedGenerator.Grid2D.LayoutDoorGrid2D)value).Type, DoorType); + + writer.WriteEndObject(); + } + + private static global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[] LayoutDoorGrid2DInt32CtorParamInit() + { + var parameters = new global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[5]; + + parameters[0] = new() + { + Name = "fromRoom", + ParameterType = typeof(int), + Position = 0, + HasDefaultValue = false, + DefaultValue = default(int) + }; + + parameters[1] = new() + { + Name = "toRoom", + ParameterType = typeof(int), + Position = 1, + HasDefaultValue = false, + DefaultValue = default(int) + }; + + parameters[2] = new() + { + Name = "doorLine", + ParameterType = typeof(global::Edgar.Geometry.OrthogonalLineGrid2D), + Position = 2, + HasDefaultValue = false, + DefaultValue = default(global::Edgar.Geometry.OrthogonalLineGrid2D) + }; + + parameters[3] = new() + { + Name = "socket", + ParameterType = typeof(global::Edgar.GraphBasedGenerator.Common.Doors.IDoorSocket), + Position = 3, + HasDefaultValue = false, + DefaultValue = default(global::Edgar.GraphBasedGenerator.Common.Doors.IDoorSocket) + }; + + parameters[4] = new() + { + Name = "type", + ParameterType = typeof(global::Edgar.GraphBasedGenerator.Common.Doors.DoorType), + Position = 4, + HasDefaultValue = false, + DefaultValue = default(global::Edgar.GraphBasedGenerator.Common.Doors.DoorType) + }; + + return parameters; + } + } +} diff --git a/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.LayoutGrid2DInt32.g.cs b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.LayoutGrid2DInt32.g.cs new file mode 100644 index 00000000..67530b03 --- /dev/null +++ b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.LayoutGrid2DInt32.g.cs @@ -0,0 +1,104 @@ +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Edgar.NativeAotLib +{ + public partial class LayoutContext + { + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo>? _LayoutGrid2DInt32; + + /// + /// Defines the source generated JSON serialization contract metadata for a given type. + /// + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo> LayoutGrid2DInt32 + { + get => _LayoutGrid2DInt32 ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo>)Options.GetTypeInfo(typeof(global::Edgar.GraphBasedGenerator.Grid2D.LayoutGrid2D)); + } + + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo> Create_LayoutGrid2DInt32(global::System.Text.Json.JsonSerializerOptions options) + { + if (!TryGetTypeInfoForRuntimeCustomConverter>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo> jsonTypeInfo)) + { + var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues> + { + ObjectCreator = null, + ObjectWithParameterizedConstructorCreator = static args => new global::Edgar.GraphBasedGenerator.Grid2D.LayoutGrid2D((global::System.Collections.Generic.List>)args[0]), + PropertyMetadataInitializer = _ => LayoutGrid2DInt32PropInit(options), + ConstructorParameterMetadataInitializer = LayoutGrid2DInt32CtorParamInit, + SerializeHandler = LayoutGrid2DInt32SerializeHandler + }; + + jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo>(options, objectInfo); + jsonTypeInfo.NumberHandling = null; + } + + jsonTypeInfo.OriginatingResolver = this; + return jsonTypeInfo; + } + + private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] LayoutGrid2DInt32PropInit(global::System.Text.Json.JsonSerializerOptions options) + { + var properties = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[1]; + + var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues>> + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.GraphBasedGenerator.Grid2D.LayoutGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.GraphBasedGenerator.Grid2D.LayoutGrid2D)obj).Rooms, + Setter = null, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "Rooms", + JsonPropertyName = null + }; + + properties[0] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo>>(options, info0); + + return properties; + } + + // Intentionally not a static method because we create a delegate to it. Invoking delegates to instance + // methods is almost as fast as virtual calls. Static methods need to go through a shuffle thunk. + private void LayoutGrid2DInt32SerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Edgar.GraphBasedGenerator.Grid2D.LayoutGrid2D? value) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + + writer.WriteStartObject(); + + writer.WritePropertyName(PropName_Rooms); + ListLayoutRoomGrid2DInt32SerializeHandler(writer, ((global::Edgar.GraphBasedGenerator.Grid2D.LayoutGrid2D)value).Rooms); + + writer.WriteEndObject(); + } + + private static global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[] LayoutGrid2DInt32CtorParamInit() + { + var parameters = new global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[1]; + + parameters[0] = new() + { + Name = "rooms", + ParameterType = typeof(global::System.Collections.Generic.List>), + Position = 0, + HasDefaultValue = false, + DefaultValue = default(global::System.Collections.Generic.List>) + }; + + return parameters; + } + } +} diff --git a/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.LayoutRoomGrid2DInt32.g.cs b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.LayoutRoomGrid2DInt32.g.cs new file mode 100644 index 00000000..42a73c4a --- /dev/null +++ b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.LayoutRoomGrid2DInt32.g.cs @@ -0,0 +1,301 @@ +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Edgar.NativeAotLib +{ + public partial class LayoutContext + { + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo>? _LayoutRoomGrid2DInt32; + + /// + /// Defines the source generated JSON serialization contract metadata for a given type. + /// + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo> LayoutRoomGrid2DInt32 + { + get => _LayoutRoomGrid2DInt32 ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo>)Options.GetTypeInfo(typeof(global::Edgar.GraphBasedGenerator.Grid2D.LayoutRoomGrid2D)); + } + + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo> Create_LayoutRoomGrid2DInt32(global::System.Text.Json.JsonSerializerOptions options) + { + if (!TryGetTypeInfoForRuntimeCustomConverter>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo> jsonTypeInfo)) + { + var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues> + { + ObjectCreator = null, + ObjectWithParameterizedConstructorCreator = static args => new global::Edgar.GraphBasedGenerator.Grid2D.LayoutRoomGrid2D((int)args[0], (global::Edgar.Geometry.PolygonGrid2D)args[1], (global::Edgar.Geometry.Vector2Int)args[2], (bool)args[3], (global::Edgar.GraphBasedGenerator.Grid2D.RoomTemplateGrid2D)args[4], (global::Edgar.GraphBasedGenerator.Grid2D.RoomDescriptionGrid2D)args[5], (global::Edgar.Geometry.TransformationGrid2D)args[6]), + PropertyMetadataInitializer = _ => LayoutRoomGrid2DInt32PropInit(options), + ConstructorParameterMetadataInitializer = LayoutRoomGrid2DInt32CtorParamInit, + SerializeHandler = LayoutRoomGrid2DInt32SerializeHandler + }; + + jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo>(options, objectInfo); + jsonTypeInfo.NumberHandling = null; + } + + jsonTypeInfo.OriginatingResolver = this; + return jsonTypeInfo; + } + + private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] LayoutRoomGrid2DInt32PropInit(global::System.Text.Json.JsonSerializerOptions options) + { + var properties = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[8]; + + var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.GraphBasedGenerator.Grid2D.LayoutRoomGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.GraphBasedGenerator.Grid2D.LayoutRoomGrid2D)obj).Room, + Setter = null, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "Room", + JsonPropertyName = null + }; + + properties[0] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info0); + + var info1 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.GraphBasedGenerator.Grid2D.LayoutRoomGrid2D), + Converter = null, + Getter = null, + Setter = null, + IgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.Always, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "RoomDescription", + JsonPropertyName = null + }; + + properties[1] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info1); + + var info2 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.GraphBasedGenerator.Grid2D.LayoutRoomGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.GraphBasedGenerator.Grid2D.LayoutRoomGrid2D)obj).Outline, + Setter = null, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "Outline", + JsonPropertyName = null + }; + + properties[2] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info2); + + var info3 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.GraphBasedGenerator.Grid2D.LayoutRoomGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.GraphBasedGenerator.Grid2D.LayoutRoomGrid2D)obj).Position, + Setter = null, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "Position", + JsonPropertyName = null + }; + + properties[3] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info3); + + var info4 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.GraphBasedGenerator.Grid2D.LayoutRoomGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.GraphBasedGenerator.Grid2D.LayoutRoomGrid2D)obj).RoomTemplate, + Setter = null, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "RoomTemplate", + JsonPropertyName = null + }; + + properties[4] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info4); + + var info5 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.GraphBasedGenerator.Grid2D.LayoutRoomGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.GraphBasedGenerator.Grid2D.LayoutRoomGrid2D)obj).IsCorridor, + Setter = null, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "IsCorridor", + JsonPropertyName = null + }; + + properties[5] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info5); + + var info6 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues>> + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.GraphBasedGenerator.Grid2D.LayoutRoomGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.GraphBasedGenerator.Grid2D.LayoutRoomGrid2D)obj).Doors, + Setter = static (obj, value) => ((global::Edgar.GraphBasedGenerator.Grid2D.LayoutRoomGrid2D)obj).Doors = value!, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "Doors", + JsonPropertyName = null + }; + + properties[6] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo>>(options, info6); + + var info7 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.GraphBasedGenerator.Grid2D.LayoutRoomGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.GraphBasedGenerator.Grid2D.LayoutRoomGrid2D)obj).Transformation, + Setter = null, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "Transformation", + JsonPropertyName = null + }; + + properties[7] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info7); + + return properties; + } + + // Intentionally not a static method because we create a delegate to it. Invoking delegates to instance + // methods is almost as fast as virtual calls. Static methods need to go through a shuffle thunk. + private void LayoutRoomGrid2DInt32SerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Edgar.GraphBasedGenerator.Grid2D.LayoutRoomGrid2D? value) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + + writer.WriteStartObject(); + + writer.WriteNumber(PropName_Room, ((global::Edgar.GraphBasedGenerator.Grid2D.LayoutRoomGrid2D)value).Room); + writer.WritePropertyName(PropName_Outline); + PolygonGrid2DSerializeHandler(writer, ((global::Edgar.GraphBasedGenerator.Grid2D.LayoutRoomGrid2D)value).Outline); + writer.WritePropertyName(PropName_Position); + Vector2IntSerializeHandler(writer, ((global::Edgar.GraphBasedGenerator.Grid2D.LayoutRoomGrid2D)value).Position); + writer.WritePropertyName(PropName_RoomTemplate); + RoomTemplateGrid2DSerializeHandler(writer, ((global::Edgar.GraphBasedGenerator.Grid2D.LayoutRoomGrid2D)value).RoomTemplate); + writer.WriteBoolean(PropName_IsCorridor, ((global::Edgar.GraphBasedGenerator.Grid2D.LayoutRoomGrid2D)value).IsCorridor); + writer.WritePropertyName(PropName_Doors); + ListLayoutDoorGrid2DInt32SerializeHandler(writer, ((global::Edgar.GraphBasedGenerator.Grid2D.LayoutRoomGrid2D)value).Doors); + writer.WritePropertyName(PropName_Transformation); + global::System.Text.Json.JsonSerializer.Serialize(writer, ((global::Edgar.GraphBasedGenerator.Grid2D.LayoutRoomGrid2D)value).Transformation, TransformationGrid2D); + + writer.WriteEndObject(); + } + + private static global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[] LayoutRoomGrid2DInt32CtorParamInit() + { + var parameters = new global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[7]; + + parameters[0] = new() + { + Name = "room", + ParameterType = typeof(int), + Position = 0, + HasDefaultValue = false, + DefaultValue = default(int) + }; + + parameters[1] = new() + { + Name = "outline", + ParameterType = typeof(global::Edgar.Geometry.PolygonGrid2D), + Position = 1, + HasDefaultValue = false, + DefaultValue = default(global::Edgar.Geometry.PolygonGrid2D) + }; + + parameters[2] = new() + { + Name = "position", + ParameterType = typeof(global::Edgar.Geometry.Vector2Int), + Position = 2, + HasDefaultValue = false, + DefaultValue = default(global::Edgar.Geometry.Vector2Int) + }; + + parameters[3] = new() + { + Name = "isCorridor", + ParameterType = typeof(bool), + Position = 3, + HasDefaultValue = false, + DefaultValue = default(bool) + }; + + parameters[4] = new() + { + Name = "roomTemplate", + ParameterType = typeof(global::Edgar.GraphBasedGenerator.Grid2D.RoomTemplateGrid2D), + Position = 4, + HasDefaultValue = false, + DefaultValue = default(global::Edgar.GraphBasedGenerator.Grid2D.RoomTemplateGrid2D) + }; + + parameters[5] = new() + { + Name = "roomDescription", + ParameterType = typeof(global::Edgar.GraphBasedGenerator.Grid2D.RoomDescriptionGrid2D), + Position = 5, + HasDefaultValue = false, + DefaultValue = default(global::Edgar.GraphBasedGenerator.Grid2D.RoomDescriptionGrid2D) + }; + + parameters[6] = new() + { + Name = "transformation", + ParameterType = typeof(global::Edgar.Geometry.TransformationGrid2D), + Position = 6, + HasDefaultValue = false, + DefaultValue = default(global::Edgar.Geometry.TransformationGrid2D) + }; + + return parameters; + } + } +} diff --git a/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.ListDoorGrid2D.g.cs b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.ListDoorGrid2D.g.cs new file mode 100644 index 00000000..16b140b9 --- /dev/null +++ b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.ListDoorGrid2D.g.cs @@ -0,0 +1,61 @@ +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Edgar.NativeAotLib +{ + public partial class LayoutContext + { + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo>? _ListDoorGrid2D; + + /// + /// Defines the source generated JSON serialization contract metadata for a given type. + /// + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo> ListDoorGrid2D + { + get => _ListDoorGrid2D ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo>)Options.GetTypeInfo(typeof(global::System.Collections.Generic.List)); + } + + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo> Create_ListDoorGrid2D(global::System.Text.Json.JsonSerializerOptions options) + { + if (!TryGetTypeInfoForRuntimeCustomConverter>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo> jsonTypeInfo)) + { + var info = new global::System.Text.Json.Serialization.Metadata.JsonCollectionInfoValues> + { + ObjectCreator = () => new global::System.Collections.Generic.List(), + SerializeHandler = ListDoorGrid2DSerializeHandler + }; + + jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateListInfo, global::Edgar.GraphBasedGenerator.Grid2D.DoorGrid2D>(options, info); + jsonTypeInfo.NumberHandling = null; + } + + jsonTypeInfo.OriginatingResolver = this; + return jsonTypeInfo; + } + + // Intentionally not a static method because we create a delegate to it. Invoking delegates to instance + // methods is almost as fast as virtual calls. Static methods need to go through a shuffle thunk. + private void ListDoorGrid2DSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::System.Collections.Generic.List? value) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + + writer.WriteStartArray(); + + for (int i = 0; i < value.Count; i++) + { + DoorGrid2DSerializeHandler(writer, value[i]); + } + + writer.WriteEndArray(); + } + } +} diff --git a/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.ListDoorLineGrid2D.g.cs b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.ListDoorLineGrid2D.g.cs new file mode 100644 index 00000000..5647a6a9 --- /dev/null +++ b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.ListDoorLineGrid2D.g.cs @@ -0,0 +1,61 @@ +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Edgar.NativeAotLib +{ + public partial class LayoutContext + { + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo>? _ListDoorLineGrid2D; + + /// + /// Defines the source generated JSON serialization contract metadata for a given type. + /// + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo> ListDoorLineGrid2D + { + get => _ListDoorLineGrid2D ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo>)Options.GetTypeInfo(typeof(global::System.Collections.Generic.List)); + } + + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo> Create_ListDoorLineGrid2D(global::System.Text.Json.JsonSerializerOptions options) + { + if (!TryGetTypeInfoForRuntimeCustomConverter>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo> jsonTypeInfo)) + { + var info = new global::System.Text.Json.Serialization.Metadata.JsonCollectionInfoValues> + { + ObjectCreator = () => new global::System.Collections.Generic.List(), + SerializeHandler = ListDoorLineGrid2DSerializeHandler + }; + + jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateListInfo, global::Edgar.GraphBasedGenerator.Grid2D.DoorLineGrid2D>(options, info); + jsonTypeInfo.NumberHandling = null; + } + + jsonTypeInfo.OriginatingResolver = this; + return jsonTypeInfo; + } + + // Intentionally not a static method because we create a delegate to it. Invoking delegates to instance + // methods is almost as fast as virtual calls. Static methods need to go through a shuffle thunk. + private void ListDoorLineGrid2DSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::System.Collections.Generic.List? value) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + + writer.WriteStartArray(); + + for (int i = 0; i < value.Count; i++) + { + DoorLineGrid2DSerializeHandler(writer, value[i]); + } + + writer.WriteEndArray(); + } + } +} diff --git a/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.ListLayoutDoorGrid2DInt32.g.cs b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.ListLayoutDoorGrid2DInt32.g.cs new file mode 100644 index 00000000..4bc9a560 --- /dev/null +++ b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.ListLayoutDoorGrid2DInt32.g.cs @@ -0,0 +1,61 @@ +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Edgar.NativeAotLib +{ + public partial class LayoutContext + { + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo>>? _ListLayoutDoorGrid2DInt32; + + /// + /// Defines the source generated JSON serialization contract metadata for a given type. + /// + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo>> ListLayoutDoorGrid2DInt32 + { + get => _ListLayoutDoorGrid2DInt32 ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo>>)Options.GetTypeInfo(typeof(global::System.Collections.Generic.List>)); + } + + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo>> Create_ListLayoutDoorGrid2DInt32(global::System.Text.Json.JsonSerializerOptions options) + { + if (!TryGetTypeInfoForRuntimeCustomConverter>>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo>> jsonTypeInfo)) + { + var info = new global::System.Text.Json.Serialization.Metadata.JsonCollectionInfoValues>> + { + ObjectCreator = () => new global::System.Collections.Generic.List>(), + SerializeHandler = ListLayoutDoorGrid2DInt32SerializeHandler + }; + + jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateListInfo>, global::Edgar.GraphBasedGenerator.Grid2D.LayoutDoorGrid2D>(options, info); + jsonTypeInfo.NumberHandling = null; + } + + jsonTypeInfo.OriginatingResolver = this; + return jsonTypeInfo; + } + + // Intentionally not a static method because we create a delegate to it. Invoking delegates to instance + // methods is almost as fast as virtual calls. Static methods need to go through a shuffle thunk. + private void ListLayoutDoorGrid2DInt32SerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::System.Collections.Generic.List>? value) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + + writer.WriteStartArray(); + + for (int i = 0; i < value.Count; i++) + { + LayoutDoorGrid2DInt32SerializeHandler(writer, value[i]); + } + + writer.WriteEndArray(); + } + } +} diff --git a/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.ListLayoutRoomGrid2DInt32.g.cs b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.ListLayoutRoomGrid2DInt32.g.cs new file mode 100644 index 00000000..f395d599 --- /dev/null +++ b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.ListLayoutRoomGrid2DInt32.g.cs @@ -0,0 +1,61 @@ +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Edgar.NativeAotLib +{ + public partial class LayoutContext + { + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo>>? _ListLayoutRoomGrid2DInt32; + + /// + /// Defines the source generated JSON serialization contract metadata for a given type. + /// + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo>> ListLayoutRoomGrid2DInt32 + { + get => _ListLayoutRoomGrid2DInt32 ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo>>)Options.GetTypeInfo(typeof(global::System.Collections.Generic.List>)); + } + + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo>> Create_ListLayoutRoomGrid2DInt32(global::System.Text.Json.JsonSerializerOptions options) + { + if (!TryGetTypeInfoForRuntimeCustomConverter>>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo>> jsonTypeInfo)) + { + var info = new global::System.Text.Json.Serialization.Metadata.JsonCollectionInfoValues>> + { + ObjectCreator = () => new global::System.Collections.Generic.List>(), + SerializeHandler = ListLayoutRoomGrid2DInt32SerializeHandler + }; + + jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateListInfo>, global::Edgar.GraphBasedGenerator.Grid2D.LayoutRoomGrid2D>(options, info); + jsonTypeInfo.NumberHandling = null; + } + + jsonTypeInfo.OriginatingResolver = this; + return jsonTypeInfo; + } + + // Intentionally not a static method because we create a delegate to it. Invoking delegates to instance + // methods is almost as fast as virtual calls. Static methods need to go through a shuffle thunk. + private void ListLayoutRoomGrid2DInt32SerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::System.Collections.Generic.List>? value) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + + writer.WriteStartArray(); + + for (int i = 0; i < value.Count; i++) + { + LayoutRoomGrid2DInt32SerializeHandler(writer, value[i]); + } + + writer.WriteEndArray(); + } + } +} diff --git a/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.ListRoomTemplateGrid2D.g.cs b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.ListRoomTemplateGrid2D.g.cs new file mode 100644 index 00000000..5cdbbe8f --- /dev/null +++ b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.ListRoomTemplateGrid2D.g.cs @@ -0,0 +1,61 @@ +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Edgar.NativeAotLib +{ + public partial class LayoutContext + { + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo>? _ListRoomTemplateGrid2D; + + /// + /// Defines the source generated JSON serialization contract metadata for a given type. + /// + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo> ListRoomTemplateGrid2D + { + get => _ListRoomTemplateGrid2D ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo>)Options.GetTypeInfo(typeof(global::System.Collections.Generic.List)); + } + + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo> Create_ListRoomTemplateGrid2D(global::System.Text.Json.JsonSerializerOptions options) + { + if (!TryGetTypeInfoForRuntimeCustomConverter>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo> jsonTypeInfo)) + { + var info = new global::System.Text.Json.Serialization.Metadata.JsonCollectionInfoValues> + { + ObjectCreator = () => new global::System.Collections.Generic.List(), + SerializeHandler = ListRoomTemplateGrid2DSerializeHandler + }; + + jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateListInfo, global::Edgar.GraphBasedGenerator.Grid2D.RoomTemplateGrid2D>(options, info); + jsonTypeInfo.NumberHandling = null; + } + + jsonTypeInfo.OriginatingResolver = this; + return jsonTypeInfo; + } + + // Intentionally not a static method because we create a delegate to it. Invoking delegates to instance + // methods is almost as fast as virtual calls. Static methods need to go through a shuffle thunk. + private void ListRoomTemplateGrid2DSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::System.Collections.Generic.List? value) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + + writer.WriteStartArray(); + + for (int i = 0; i < value.Count; i++) + { + RoomTemplateGrid2DSerializeHandler(writer, value[i]); + } + + writer.WriteEndArray(); + } + } +} diff --git a/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.ListTransformationGrid2D.g.cs b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.ListTransformationGrid2D.g.cs new file mode 100644 index 00000000..909a6ad2 --- /dev/null +++ b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.ListTransformationGrid2D.g.cs @@ -0,0 +1,61 @@ +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Edgar.NativeAotLib +{ + public partial class LayoutContext + { + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo>? _ListTransformationGrid2D; + + /// + /// Defines the source generated JSON serialization contract metadata for a given type. + /// + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo> ListTransformationGrid2D + { + get => _ListTransformationGrid2D ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo>)Options.GetTypeInfo(typeof(global::System.Collections.Generic.List)); + } + + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo> Create_ListTransformationGrid2D(global::System.Text.Json.JsonSerializerOptions options) + { + if (!TryGetTypeInfoForRuntimeCustomConverter>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo> jsonTypeInfo)) + { + var info = new global::System.Text.Json.Serialization.Metadata.JsonCollectionInfoValues> + { + ObjectCreator = () => new global::System.Collections.Generic.List(), + SerializeHandler = ListTransformationGrid2DSerializeHandler + }; + + jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateListInfo, global::Edgar.Geometry.TransformationGrid2D>(options, info); + jsonTypeInfo.NumberHandling = null; + } + + jsonTypeInfo.OriginatingResolver = this; + return jsonTypeInfo; + } + + // Intentionally not a static method because we create a delegate to it. Invoking delegates to instance + // methods is almost as fast as virtual calls. Static methods need to go through a shuffle thunk. + private void ListTransformationGrid2DSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::System.Collections.Generic.List? value) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + + writer.WriteStartArray(); + + for (int i = 0; i < value.Count; i++) + { + global::System.Text.Json.JsonSerializer.Serialize(writer, value[i], TransformationGrid2D); + } + + writer.WriteEndArray(); + } + } +} diff --git a/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.ListVector2Int.g.cs b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.ListVector2Int.g.cs new file mode 100644 index 00000000..3f81ef0c --- /dev/null +++ b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.ListVector2Int.g.cs @@ -0,0 +1,61 @@ +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Edgar.NativeAotLib +{ + public partial class LayoutContext + { + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo>? _ListVector2Int; + + /// + /// Defines the source generated JSON serialization contract metadata for a given type. + /// + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo> ListVector2Int + { + get => _ListVector2Int ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo>)Options.GetTypeInfo(typeof(global::System.Collections.Generic.List)); + } + + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo> Create_ListVector2Int(global::System.Text.Json.JsonSerializerOptions options) + { + if (!TryGetTypeInfoForRuntimeCustomConverter>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo> jsonTypeInfo)) + { + var info = new global::System.Text.Json.Serialization.Metadata.JsonCollectionInfoValues> + { + ObjectCreator = () => new global::System.Collections.Generic.List(), + SerializeHandler = ListVector2IntSerializeHandler + }; + + jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateListInfo, global::Edgar.Geometry.Vector2Int>(options, info); + jsonTypeInfo.NumberHandling = null; + } + + jsonTypeInfo.OriginatingResolver = this; + return jsonTypeInfo; + } + + // Intentionally not a static method because we create a delegate to it. Invoking delegates to instance + // methods is almost as fast as virtual calls. Static methods need to go through a shuffle thunk. + private void ListVector2IntSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::System.Collections.Generic.List? value) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + + writer.WriteStartArray(); + + for (int i = 0; i < value.Count; i++) + { + Vector2IntSerializeHandler(writer, value[i]); + } + + writer.WriteEndArray(); + } + } +} diff --git a/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.ManualDoorModeGrid2D.g.cs b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.ManualDoorModeGrid2D.g.cs new file mode 100644 index 00000000..e033580a --- /dev/null +++ b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.ManualDoorModeGrid2D.g.cs @@ -0,0 +1,109 @@ +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Edgar.NativeAotLib +{ + public partial class LayoutContext + { + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? _ManualDoorModeGrid2D; + + /// + /// Defines the source generated JSON serialization contract metadata for a given type. + /// + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ManualDoorModeGrid2D + { + get => _ManualDoorModeGrid2D ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo)Options.GetTypeInfo(typeof(global::Edgar.GraphBasedGenerator.Grid2D.ManualDoorModeGrid2D)); + } + + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Create_ManualDoorModeGrid2D(global::System.Text.Json.JsonSerializerOptions options) + { + if (!TryGetTypeInfoForRuntimeCustomConverter(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo)) + { + var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues + { + ObjectCreator = () => new global::Edgar.GraphBasedGenerator.Grid2D.ManualDoorModeGrid2D(), + ObjectWithParameterizedConstructorCreator = null, + PropertyMetadataInitializer = _ => ManualDoorModeGrid2DPropInit(options), + ConstructorParameterMetadataInitializer = null, + SerializeHandler = ManualDoorModeGrid2DSerializeHandler + }; + + jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo(options, objectInfo); + jsonTypeInfo.NumberHandling = null; + } + + jsonTypeInfo.OriginatingResolver = this; + return jsonTypeInfo; + } + + private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] ManualDoorModeGrid2DPropInit(global::System.Text.Json.JsonSerializerOptions options) + { + var properties = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[2]; + + var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues> + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.GraphBasedGenerator.Grid2D.ManualDoorModeGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.GraphBasedGenerator.Grid2D.ManualDoorModeGrid2D)obj).Doors, + Setter = static (obj, value) => ((global::Edgar.GraphBasedGenerator.Grid2D.ManualDoorModeGrid2D)obj).Doors = value!, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "Doors", + JsonPropertyName = null + }; + + properties[0] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo>(options, info0); + + var info1 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues> + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.GraphBasedGenerator.Grid2D.ManualDoorModeGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.GraphBasedGenerator.Grid2D.ManualDoorModeGrid2D)obj).DoorLines, + Setter = static (obj, value) => ((global::Edgar.GraphBasedGenerator.Grid2D.ManualDoorModeGrid2D)obj).DoorLines = value!, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "DoorLines", + JsonPropertyName = null + }; + + properties[1] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo>(options, info1); + + return properties; + } + + // Intentionally not a static method because we create a delegate to it. Invoking delegates to instance + // methods is almost as fast as virtual calls. Static methods need to go through a shuffle thunk. + private void ManualDoorModeGrid2DSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Edgar.GraphBasedGenerator.Grid2D.ManualDoorModeGrid2D? value) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + + writer.WriteStartObject(); + + writer.WritePropertyName(PropName_Doors); + ListDoorGrid2DSerializeHandler(writer, ((global::Edgar.GraphBasedGenerator.Grid2D.ManualDoorModeGrid2D)value).Doors); + writer.WritePropertyName(PropName_DoorLines); + ListDoorLineGrid2DSerializeHandler(writer, ((global::Edgar.GraphBasedGenerator.Grid2D.ManualDoorModeGrid2D)value).DoorLines); + + writer.WriteEndObject(); + } + } +} diff --git a/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.NullableRoomTemplateRepeatMode.g.cs b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.NullableRoomTemplateRepeatMode.g.cs new file mode 100644 index 00000000..3b56e0ae --- /dev/null +++ b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.NullableRoomTemplateRepeatMode.g.cs @@ -0,0 +1,35 @@ +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Edgar.NativeAotLib +{ + public partial class LayoutContext + { + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? _NullableRoomTemplateRepeatMode; + + /// + /// Defines the source generated JSON serialization contract metadata for a given type. + /// + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo NullableRoomTemplateRepeatMode + { + get => _NullableRoomTemplateRepeatMode ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo)Options.GetTypeInfo(typeof(global::Edgar.GraphBasedGenerator.Common.RoomTemplateRepeatMode?)); + } + + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Create_NullableRoomTemplateRepeatMode(global::System.Text.Json.JsonSerializerOptions options) + { + if (!TryGetTypeInfoForRuntimeCustomConverter(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo)) + { + global::System.Text.Json.Serialization.JsonConverter converter = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.GetNullableConverter(options); + jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateValueInfo(options, converter); + } + + jsonTypeInfo.OriginatingResolver = this; + return jsonTypeInfo; + } + } +} diff --git a/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.OrthogonalLineGrid2D.g.cs b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.OrthogonalLineGrid2D.g.cs new file mode 100644 index 00000000..216e3de6 --- /dev/null +++ b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.OrthogonalLineGrid2D.g.cs @@ -0,0 +1,172 @@ +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Edgar.NativeAotLib +{ + public partial class LayoutContext + { + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? _OrthogonalLineGrid2D; + + /// + /// Defines the source generated JSON serialization contract metadata for a given type. + /// + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo OrthogonalLineGrid2D + { + get => _OrthogonalLineGrid2D ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo)Options.GetTypeInfo(typeof(global::Edgar.Geometry.OrthogonalLineGrid2D)); + } + + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Create_OrthogonalLineGrid2D(global::System.Text.Json.JsonSerializerOptions options) + { + if (!TryGetTypeInfoForRuntimeCustomConverter(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo)) + { + var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues + { + ObjectCreator = null, + ObjectWithParameterizedConstructorCreator = static args => new global::Edgar.Geometry.OrthogonalLineGrid2D((global::Edgar.Geometry.Vector2Int)args[0], (global::Edgar.Geometry.Vector2Int)args[1], (global::Edgar.Geometry.OrthogonalLineGrid2D.Direction)args[2]), + PropertyMetadataInitializer = _ => OrthogonalLineGrid2DPropInit(options), + ConstructorParameterMetadataInitializer = OrthogonalLineGrid2DCtorParamInit, + SerializeHandler = OrthogonalLineGrid2DSerializeHandler + }; + + jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo(options, objectInfo); + jsonTypeInfo.NumberHandling = null; + } + + jsonTypeInfo.OriginatingResolver = this; + return jsonTypeInfo; + } + + private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] OrthogonalLineGrid2DPropInit(global::System.Text.Json.JsonSerializerOptions options) + { + var properties = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[4]; + + var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.Geometry.OrthogonalLineGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.Geometry.OrthogonalLineGrid2D)obj).Length, + Setter = null, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "Length", + JsonPropertyName = null + }; + + properties[0] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info0); + + var info1 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = false, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.Geometry.OrthogonalLineGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.Geometry.OrthogonalLineGrid2D)obj).From, + Setter = null, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "From", + JsonPropertyName = null + }; + + properties[1] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info1); + + var info2 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = false, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.Geometry.OrthogonalLineGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.Geometry.OrthogonalLineGrid2D)obj).To, + Setter = null, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "To", + JsonPropertyName = null + }; + + properties[2] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info2); + + var info3 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = false, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.Geometry.OrthogonalLineGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.Geometry.OrthogonalLineGrid2D)obj).degeneratedDirection, + Setter = null, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "degeneratedDirection", + JsonPropertyName = null + }; + + properties[3] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info3); + + return properties; + } + + // Intentionally not a static method because we create a delegate to it. Invoking delegates to instance + // methods is almost as fast as virtual calls. Static methods need to go through a shuffle thunk. + private void OrthogonalLineGrid2DSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Edgar.Geometry.OrthogonalLineGrid2D value) + { + writer.WriteStartObject(); + + writer.WriteNumber(PropName_Length, ((global::Edgar.Geometry.OrthogonalLineGrid2D)value).Length); + + writer.WriteEndObject(); + } + + private static global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[] OrthogonalLineGrid2DCtorParamInit() + { + var parameters = new global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[3]; + + parameters[0] = new() + { + Name = "from", + ParameterType = typeof(global::Edgar.Geometry.Vector2Int), + Position = 0, + HasDefaultValue = false, + DefaultValue = default(global::Edgar.Geometry.Vector2Int) + }; + + parameters[1] = new() + { + Name = "to", + ParameterType = typeof(global::Edgar.Geometry.Vector2Int), + Position = 1, + HasDefaultValue = false, + DefaultValue = default(global::Edgar.Geometry.Vector2Int) + }; + + parameters[2] = new() + { + Name = "degeneratedDirection", + ParameterType = typeof(global::Edgar.Geometry.OrthogonalLineGrid2D.Direction), + Position = 2, + HasDefaultValue = false, + DefaultValue = default(global::Edgar.Geometry.OrthogonalLineGrid2D.Direction) + }; + + return parameters; + } + } +} diff --git a/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.PolygonGrid2D.g.cs b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.PolygonGrid2D.g.cs new file mode 100644 index 00000000..50d46fc9 --- /dev/null +++ b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.PolygonGrid2D.g.cs @@ -0,0 +1,105 @@ +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Edgar.NativeAotLib +{ + public partial class LayoutContext + { + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? _PolygonGrid2D; + + /// + /// Defines the source generated JSON serialization contract metadata for a given type. + /// + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo PolygonGrid2D + { + get => _PolygonGrid2D ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo)Options.GetTypeInfo(typeof(global::Edgar.Geometry.PolygonGrid2D)); + } + + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Create_PolygonGrid2D(global::System.Text.Json.JsonSerializerOptions options) + { + if (!TryGetTypeInfoForRuntimeCustomConverter(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo)) + { + var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues + { + ObjectCreator = () => new global::Edgar.Geometry.PolygonGrid2D(), + ObjectWithParameterizedConstructorCreator = null, + PropertyMetadataInitializer = _ => PolygonGrid2DPropInit(options), + ConstructorParameterMetadataInitializer = null, + SerializeHandler = PolygonGrid2DSerializeHandler + }; + + jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo(options, objectInfo); + jsonTypeInfo.NumberHandling = null; + } + + jsonTypeInfo.OriginatingResolver = this; + return jsonTypeInfo; + } + + private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] PolygonGrid2DPropInit(global::System.Text.Json.JsonSerializerOptions options) + { + var properties = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[2]; + + var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.Geometry.PolygonGrid2D), + Converter = null, + Getter = null, + Setter = null, + IgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.Always, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "BoundingRectangle", + JsonPropertyName = null + }; + + properties[0] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info0); + + var info1 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues> + { + IsProperty = false, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.Geometry.PolygonGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.Geometry.PolygonGrid2D)obj).points, + Setter = static (obj, value) => ((global::Edgar.Geometry.PolygonGrid2D)obj).points = value!, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "points", + JsonPropertyName = null + }; + + properties[1] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo>(options, info1); + + return properties; + } + + // Intentionally not a static method because we create a delegate to it. Invoking delegates to instance + // methods is almost as fast as virtual calls. Static methods need to go through a shuffle thunk. + private void PolygonGrid2DSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Edgar.Geometry.PolygonGrid2D? value) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + + writer.WriteStartObject(); + + + writer.WriteEndObject(); + } + } +} diff --git a/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.PropertyNames.g.cs b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.PropertyNames.g.cs new file mode 100644 index 00000000..b83f9a4d --- /dev/null +++ b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.PropertyNames.g.cs @@ -0,0 +1,39 @@ +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Edgar.NativeAotLib +{ + public partial class LayoutContext + { + private static readonly global::System.Text.Json.JsonEncodedText PropName_Length = global::System.Text.Json.JsonEncodedText.Encode("Length"); + private static readonly global::System.Text.Json.JsonEncodedText PropName_From = global::System.Text.Json.JsonEncodedText.Encode("From"); + private static readonly global::System.Text.Json.JsonEncodedText PropName_To = global::System.Text.Json.JsonEncodedText.Encode("To"); + private static readonly global::System.Text.Json.JsonEncodedText PropName_Socket = global::System.Text.Json.JsonEncodedText.Encode("Socket"); + private static readonly global::System.Text.Json.JsonEncodedText PropName_Type = global::System.Text.Json.JsonEncodedText.Encode("Type"); + private static readonly global::System.Text.Json.JsonEncodedText PropName_Line = global::System.Text.Json.JsonEncodedText.Encode("Line"); + private static readonly global::System.Text.Json.JsonEncodedText PropName_DoorSocket = global::System.Text.Json.JsonEncodedText.Encode("DoorSocket"); + private static readonly global::System.Text.Json.JsonEncodedText PropName_FromRoom = global::System.Text.Json.JsonEncodedText.Encode("FromRoom"); + private static readonly global::System.Text.Json.JsonEncodedText PropName_ToRoom = global::System.Text.Json.JsonEncodedText.Encode("ToRoom"); + private static readonly global::System.Text.Json.JsonEncodedText PropName_DoorLine = global::System.Text.Json.JsonEncodedText.Encode("DoorLine"); + private static readonly global::System.Text.Json.JsonEncodedText PropName_Rooms = global::System.Text.Json.JsonEncodedText.Encode("Rooms"); + private static readonly global::System.Text.Json.JsonEncodedText PropName_Room = global::System.Text.Json.JsonEncodedText.Encode("Room"); + private static readonly global::System.Text.Json.JsonEncodedText PropName_Outline = global::System.Text.Json.JsonEncodedText.Encode("Outline"); + private static readonly global::System.Text.Json.JsonEncodedText PropName_Position = global::System.Text.Json.JsonEncodedText.Encode("Position"); + private static readonly global::System.Text.Json.JsonEncodedText PropName_RoomTemplate = global::System.Text.Json.JsonEncodedText.Encode("RoomTemplate"); + private static readonly global::System.Text.Json.JsonEncodedText PropName_IsCorridor = global::System.Text.Json.JsonEncodedText.Encode("IsCorridor"); + private static readonly global::System.Text.Json.JsonEncodedText PropName_Doors = global::System.Text.Json.JsonEncodedText.Encode("Doors"); + private static readonly global::System.Text.Json.JsonEncodedText PropName_Transformation = global::System.Text.Json.JsonEncodedText.Encode("Transformation"); + private static readonly global::System.Text.Json.JsonEncodedText PropName_DoorLines = global::System.Text.Json.JsonEncodedText.Encode("DoorLines"); + private static readonly global::System.Text.Json.JsonEncodedText PropName_RoomTemplates = global::System.Text.Json.JsonEncodedText.Encode("RoomTemplates"); + private static readonly global::System.Text.Json.JsonEncodedText PropName_Name = global::System.Text.Json.JsonEncodedText.Encode("Name"); + private static readonly global::System.Text.Json.JsonEncodedText PropName_RepeatMode = global::System.Text.Json.JsonEncodedText.Encode("RepeatMode"); + private static readonly global::System.Text.Json.JsonEncodedText PropName_AllowedTransformations = global::System.Text.Json.JsonEncodedText.Encode("AllowedTransformations"); + private static readonly global::System.Text.Json.JsonEncodedText PropName_DoorLength = global::System.Text.Json.JsonEncodedText.Encode("DoorLength"); + private static readonly global::System.Text.Json.JsonEncodedText PropName_CornerDistance = global::System.Text.Json.JsonEncodedText.Encode("CornerDistance"); + } +} diff --git a/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.RectangleGrid2D.g.cs b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.RectangleGrid2D.g.cs new file mode 100644 index 00000000..a5047d5e --- /dev/null +++ b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.RectangleGrid2D.g.cs @@ -0,0 +1,205 @@ +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Edgar.NativeAotLib +{ + public partial class LayoutContext + { + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? _RectangleGrid2D; + + /// + /// Defines the source generated JSON serialization contract metadata for a given type. + /// + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo RectangleGrid2D + { + get => _RectangleGrid2D ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo)Options.GetTypeInfo(typeof(global::Edgar.Geometry.RectangleGrid2D)); + } + + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Create_RectangleGrid2D(global::System.Text.Json.JsonSerializerOptions options) + { + if (!TryGetTypeInfoForRuntimeCustomConverter(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo)) + { + var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues + { + ObjectCreator = null, + ObjectWithParameterizedConstructorCreator = static args => new global::Edgar.Geometry.RectangleGrid2D((global::Edgar.Geometry.Vector2Int)args[0], (global::Edgar.Geometry.Vector2Int)args[1]), + PropertyMetadataInitializer = _ => RectangleGrid2DPropInit(options), + ConstructorParameterMetadataInitializer = RectangleGrid2DCtorParamInit, + SerializeHandler = RectangleGrid2DSerializeHandler + }; + + jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo(options, objectInfo); + jsonTypeInfo.NumberHandling = null; + } + + jsonTypeInfo.OriginatingResolver = this; + return jsonTypeInfo; + } + + private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] RectangleGrid2DPropInit(global::System.Text.Json.JsonSerializerOptions options) + { + var properties = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[6]; + + var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.Geometry.RectangleGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.Geometry.RectangleGrid2D)obj).Center, + Setter = null, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "Center", + JsonPropertyName = null + }; + + properties[0] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info0); + + var info1 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.Geometry.RectangleGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.Geometry.RectangleGrid2D)obj).Area, + Setter = null, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "Area", + JsonPropertyName = null + }; + + properties[1] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info1); + + var info2 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.Geometry.RectangleGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.Geometry.RectangleGrid2D)obj).Width, + Setter = null, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "Width", + JsonPropertyName = null + }; + + properties[2] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info2); + + var info3 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.Geometry.RectangleGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.Geometry.RectangleGrid2D)obj).Height, + Setter = null, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "Height", + JsonPropertyName = null + }; + + properties[3] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info3); + + var info4 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = false, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.Geometry.RectangleGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.Geometry.RectangleGrid2D)obj).A, + Setter = null, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "A", + JsonPropertyName = null + }; + + properties[4] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info4); + + var info5 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = false, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.Geometry.RectangleGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.Geometry.RectangleGrid2D)obj).B, + Setter = null, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "B", + JsonPropertyName = null + }; + + properties[5] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info5); + + return properties; + } + + // Intentionally not a static method because we create a delegate to it. Invoking delegates to instance + // methods is almost as fast as virtual calls. Static methods need to go through a shuffle thunk. + private void RectangleGrid2DSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Edgar.Geometry.RectangleGrid2D value) + { + writer.WriteStartObject(); + + writer.WritePropertyName(PropName_Center); + Vector2IntSerializeHandler(writer, ((global::Edgar.Geometry.RectangleGrid2D)value).Center); + writer.WriteNumber(PropName_Area, ((global::Edgar.Geometry.RectangleGrid2D)value).Area); + writer.WriteNumber(PropName_Width, ((global::Edgar.Geometry.RectangleGrid2D)value).Width); + writer.WriteNumber(PropName_Height, ((global::Edgar.Geometry.RectangleGrid2D)value).Height); + + writer.WriteEndObject(); + } + + private static global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[] RectangleGrid2DCtorParamInit() + { + var parameters = new global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[2]; + + parameters[0] = new() + { + Name = "a", + ParameterType = typeof(global::Edgar.Geometry.Vector2Int), + Position = 0, + HasDefaultValue = false, + DefaultValue = default(global::Edgar.Geometry.Vector2Int) + }; + + parameters[1] = new() + { + Name = "b", + ParameterType = typeof(global::Edgar.Geometry.Vector2Int), + Position = 1, + HasDefaultValue = false, + DefaultValue = default(global::Edgar.Geometry.Vector2Int) + }; + + return parameters; + } + } +} diff --git a/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.RoomDescriptionGrid2D.g.cs b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.RoomDescriptionGrid2D.g.cs new file mode 100644 index 00000000..5b209a07 --- /dev/null +++ b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.RoomDescriptionGrid2D.g.cs @@ -0,0 +1,108 @@ +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Edgar.NativeAotLib +{ + public partial class LayoutContext + { + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? _RoomDescriptionGrid2D; + + /// + /// Defines the source generated JSON serialization contract metadata for a given type. + /// + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo RoomDescriptionGrid2D + { + get => _RoomDescriptionGrid2D ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo)Options.GetTypeInfo(typeof(global::Edgar.GraphBasedGenerator.Grid2D.RoomDescriptionGrid2D)); + } + + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Create_RoomDescriptionGrid2D(global::System.Text.Json.JsonSerializerOptions options) + { + if (!TryGetTypeInfoForRuntimeCustomConverter(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo)) + { + var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues + { + ObjectCreator = () => new global::Edgar.GraphBasedGenerator.Grid2D.RoomDescriptionGrid2D(), + ObjectWithParameterizedConstructorCreator = null, + PropertyMetadataInitializer = _ => RoomDescriptionGrid2DPropInit(options), + ConstructorParameterMetadataInitializer = null, + SerializeHandler = RoomDescriptionGrid2DSerializeHandler + }; + + jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo(options, objectInfo); + jsonTypeInfo.NumberHandling = null; + } + + jsonTypeInfo.OriginatingResolver = this; + return jsonTypeInfo; + } + + private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] RoomDescriptionGrid2DPropInit(global::System.Text.Json.JsonSerializerOptions options) + { + var properties = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[2]; + + var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.GraphBasedGenerator.Grid2D.RoomDescriptionGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.GraphBasedGenerator.Grid2D.RoomDescriptionGrid2D)obj).IsCorridor, + Setter = static (obj, value) => ((global::Edgar.GraphBasedGenerator.Grid2D.RoomDescriptionGrid2D)obj).IsCorridor = value!, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "IsCorridor", + JsonPropertyName = null + }; + + properties[0] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info0); + + var info1 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues> + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.GraphBasedGenerator.Grid2D.RoomDescriptionGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.GraphBasedGenerator.Grid2D.RoomDescriptionGrid2D)obj).RoomTemplates, + Setter = static (obj, value) => ((global::Edgar.GraphBasedGenerator.Grid2D.RoomDescriptionGrid2D)obj).RoomTemplates = value!, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "RoomTemplates", + JsonPropertyName = null + }; + + properties[1] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo>(options, info1); + + return properties; + } + + // Intentionally not a static method because we create a delegate to it. Invoking delegates to instance + // methods is almost as fast as virtual calls. Static methods need to go through a shuffle thunk. + private void RoomDescriptionGrid2DSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Edgar.GraphBasedGenerator.Grid2D.RoomDescriptionGrid2D? value) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + + writer.WriteStartObject(); + + writer.WriteBoolean(PropName_IsCorridor, ((global::Edgar.GraphBasedGenerator.Grid2D.RoomDescriptionGrid2D)value).IsCorridor); + writer.WritePropertyName(PropName_RoomTemplates); + ListRoomTemplateGrid2DSerializeHandler(writer, ((global::Edgar.GraphBasedGenerator.Grid2D.RoomDescriptionGrid2D)value).RoomTemplates); + + writer.WriteEndObject(); + } + } +} diff --git a/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.RoomTemplateGrid2D.g.cs b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.RoomTemplateGrid2D.g.cs new file mode 100644 index 00000000..ade8d3d4 --- /dev/null +++ b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.RoomTemplateGrid2D.g.cs @@ -0,0 +1,171 @@ +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Edgar.NativeAotLib +{ + public partial class LayoutContext + { + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? _RoomTemplateGrid2D; + + /// + /// Defines the source generated JSON serialization contract metadata for a given type. + /// + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo RoomTemplateGrid2D + { + get => _RoomTemplateGrid2D ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo)Options.GetTypeInfo(typeof(global::Edgar.GraphBasedGenerator.Grid2D.RoomTemplateGrid2D)); + } + + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Create_RoomTemplateGrid2D(global::System.Text.Json.JsonSerializerOptions options) + { + if (!TryGetTypeInfoForRuntimeCustomConverter(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo)) + { + var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues + { + ObjectCreator = () => new global::Edgar.GraphBasedGenerator.Grid2D.RoomTemplateGrid2D(), + ObjectWithParameterizedConstructorCreator = null, + PropertyMetadataInitializer = _ => RoomTemplateGrid2DPropInit(options), + ConstructorParameterMetadataInitializer = null, + SerializeHandler = RoomTemplateGrid2DSerializeHandler + }; + + jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo(options, objectInfo); + jsonTypeInfo.NumberHandling = null; + } + + jsonTypeInfo.OriginatingResolver = this; + return jsonTypeInfo; + } + + private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] RoomTemplateGrid2DPropInit(global::System.Text.Json.JsonSerializerOptions options) + { + var properties = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[5]; + + var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.GraphBasedGenerator.Grid2D.RoomTemplateGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.GraphBasedGenerator.Grid2D.RoomTemplateGrid2D)obj).Name, + Setter = static (obj, value) => ((global::Edgar.GraphBasedGenerator.Grid2D.RoomTemplateGrid2D)obj).Name = value!, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "Name", + JsonPropertyName = null + }; + + properties[0] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info0); + + var info1 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.GraphBasedGenerator.Grid2D.RoomTemplateGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.GraphBasedGenerator.Grid2D.RoomTemplateGrid2D)obj).Outline, + Setter = static (obj, value) => ((global::Edgar.GraphBasedGenerator.Grid2D.RoomTemplateGrid2D)obj).Outline = value!, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "Outline", + JsonPropertyName = null + }; + + properties[1] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info1); + + var info2 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.GraphBasedGenerator.Grid2D.RoomTemplateGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.GraphBasedGenerator.Grid2D.RoomTemplateGrid2D)obj).Doors, + Setter = static (obj, value) => ((global::Edgar.GraphBasedGenerator.Grid2D.RoomTemplateGrid2D)obj).Doors = value!, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "Doors", + JsonPropertyName = null + }; + + properties[2] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info2); + + var info3 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.GraphBasedGenerator.Grid2D.RoomTemplateGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.GraphBasedGenerator.Grid2D.RoomTemplateGrid2D)obj).RepeatMode, + Setter = static (obj, value) => ((global::Edgar.GraphBasedGenerator.Grid2D.RoomTemplateGrid2D)obj).RepeatMode = value!, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "RepeatMode", + JsonPropertyName = null + }; + + properties[3] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info3); + + var info4 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues> + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.GraphBasedGenerator.Grid2D.RoomTemplateGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.GraphBasedGenerator.Grid2D.RoomTemplateGrid2D)obj).AllowedTransformations, + Setter = static (obj, value) => ((global::Edgar.GraphBasedGenerator.Grid2D.RoomTemplateGrid2D)obj).AllowedTransformations = value!, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "AllowedTransformations", + JsonPropertyName = null + }; + + properties[4] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo>(options, info4); + + return properties; + } + + // Intentionally not a static method because we create a delegate to it. Invoking delegates to instance + // methods is almost as fast as virtual calls. Static methods need to go through a shuffle thunk. + private void RoomTemplateGrid2DSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Edgar.GraphBasedGenerator.Grid2D.RoomTemplateGrid2D? value) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + + writer.WriteStartObject(); + + writer.WriteString(PropName_Name, ((global::Edgar.GraphBasedGenerator.Grid2D.RoomTemplateGrid2D)value).Name); + writer.WritePropertyName(PropName_Outline); + PolygonGrid2DSerializeHandler(writer, ((global::Edgar.GraphBasedGenerator.Grid2D.RoomTemplateGrid2D)value).Outline); + writer.WritePropertyName(PropName_Doors); + global::System.Text.Json.JsonSerializer.Serialize(writer, ((global::Edgar.GraphBasedGenerator.Grid2D.RoomTemplateGrid2D)value).Doors, IDoorModeGrid2D); + writer.WritePropertyName(PropName_RepeatMode); + global::System.Text.Json.JsonSerializer.Serialize(writer, ((global::Edgar.GraphBasedGenerator.Grid2D.RoomTemplateGrid2D)value).RepeatMode, NullableRoomTemplateRepeatMode); + writer.WritePropertyName(PropName_AllowedTransformations); + ListTransformationGrid2DSerializeHandler(writer, ((global::Edgar.GraphBasedGenerator.Grid2D.RoomTemplateGrid2D)value).AllowedTransformations); + + writer.WriteEndObject(); + } + } +} diff --git a/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.RoomTemplateRepeatMode.g.cs b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.RoomTemplateRepeatMode.g.cs new file mode 100644 index 00000000..82830e0f --- /dev/null +++ b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.RoomTemplateRepeatMode.g.cs @@ -0,0 +1,34 @@ +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Edgar.NativeAotLib +{ + public partial class LayoutContext + { + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? _RoomTemplateRepeatMode; + + /// + /// Defines the source generated JSON serialization contract metadata for a given type. + /// + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo RoomTemplateRepeatMode + { + get => _RoomTemplateRepeatMode ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo)Options.GetTypeInfo(typeof(global::Edgar.GraphBasedGenerator.Common.RoomTemplateRepeatMode)); + } + + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Create_RoomTemplateRepeatMode(global::System.Text.Json.JsonSerializerOptions options) + { + if (!TryGetTypeInfoForRuntimeCustomConverter(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo)) + { + jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateValueInfo(options, global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.GetEnumConverter(options)); + } + + jsonTypeInfo.OriginatingResolver = this; + return jsonTypeInfo; + } + } +} diff --git a/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.SimpleDoorModeGrid2D.g.cs b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.SimpleDoorModeGrid2D.g.cs new file mode 100644 index 00000000..7bb6e965 --- /dev/null +++ b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.SimpleDoorModeGrid2D.g.cs @@ -0,0 +1,162 @@ +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Edgar.NativeAotLib +{ + public partial class LayoutContext + { + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? _SimpleDoorModeGrid2D; + + /// + /// Defines the source generated JSON serialization contract metadata for a given type. + /// + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo SimpleDoorModeGrid2D + { + get => _SimpleDoorModeGrid2D ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo)Options.GetTypeInfo(typeof(global::Edgar.GraphBasedGenerator.Grid2D.SimpleDoorModeGrid2D)); + } + + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Create_SimpleDoorModeGrid2D(global::System.Text.Json.JsonSerializerOptions options) + { + if (!TryGetTypeInfoForRuntimeCustomConverter(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo)) + { + var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues + { + ObjectCreator = null, + ObjectWithParameterizedConstructorCreator = static args => new global::Edgar.GraphBasedGenerator.Grid2D.SimpleDoorModeGrid2D((int)args[0], (int)args[1], (global::Edgar.GraphBasedGenerator.Common.Doors.IDoorSocket)args[2]), + PropertyMetadataInitializer = _ => SimpleDoorModeGrid2DPropInit(options), + ConstructorParameterMetadataInitializer = SimpleDoorModeGrid2DCtorParamInit, + SerializeHandler = SimpleDoorModeGrid2DSerializeHandler + }; + + jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo(options, objectInfo); + jsonTypeInfo.NumberHandling = null; + } + + jsonTypeInfo.OriginatingResolver = this; + return jsonTypeInfo; + } + + private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] SimpleDoorModeGrid2DPropInit(global::System.Text.Json.JsonSerializerOptions options) + { + var properties = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[3]; + + var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.GraphBasedGenerator.Grid2D.SimpleDoorModeGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.GraphBasedGenerator.Grid2D.SimpleDoorModeGrid2D)obj).DoorLength, + Setter = null, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "DoorLength", + JsonPropertyName = null + }; + + properties[0] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info0); + + var info1 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.GraphBasedGenerator.Grid2D.SimpleDoorModeGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.GraphBasedGenerator.Grid2D.SimpleDoorModeGrid2D)obj).CornerDistance, + Setter = null, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "CornerDistance", + JsonPropertyName = null + }; + + properties[1] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info1); + + var info2 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.GraphBasedGenerator.Grid2D.SimpleDoorModeGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.GraphBasedGenerator.Grid2D.SimpleDoorModeGrid2D)obj).DoorSocket, + Setter = null, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "DoorSocket", + JsonPropertyName = null + }; + + properties[2] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info2); + + return properties; + } + + // Intentionally not a static method because we create a delegate to it. Invoking delegates to instance + // methods is almost as fast as virtual calls. Static methods need to go through a shuffle thunk. + private void SimpleDoorModeGrid2DSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Edgar.GraphBasedGenerator.Grid2D.SimpleDoorModeGrid2D? value) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + + writer.WriteStartObject(); + + writer.WriteNumber(PropName_DoorLength, ((global::Edgar.GraphBasedGenerator.Grid2D.SimpleDoorModeGrid2D)value).DoorLength); + writer.WriteNumber(PropName_CornerDistance, ((global::Edgar.GraphBasedGenerator.Grid2D.SimpleDoorModeGrid2D)value).CornerDistance); + writer.WritePropertyName(PropName_DoorSocket); + IDoorSocketSerializeHandler(writer, ((global::Edgar.GraphBasedGenerator.Grid2D.SimpleDoorModeGrid2D)value).DoorSocket); + + writer.WriteEndObject(); + } + + private static global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[] SimpleDoorModeGrid2DCtorParamInit() + { + var parameters = new global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[3]; + + parameters[0] = new() + { + Name = "doorLength", + ParameterType = typeof(int), + Position = 0, + HasDefaultValue = false, + DefaultValue = default(int) + }; + + parameters[1] = new() + { + Name = "cornerDistance", + ParameterType = typeof(int), + Position = 1, + HasDefaultValue = false, + DefaultValue = default(int) + }; + + parameters[2] = new() + { + Name = "doorSocket", + ParameterType = typeof(global::Edgar.GraphBasedGenerator.Common.Doors.IDoorSocket), + Position = 2, + HasDefaultValue = true, + DefaultValue = default(global::Edgar.GraphBasedGenerator.Common.Doors.IDoorSocket) + }; + + return parameters; + } + } +} diff --git a/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.String.g.cs b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.String.g.cs new file mode 100644 index 00000000..39245a63 --- /dev/null +++ b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.String.g.cs @@ -0,0 +1,34 @@ +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Edgar.NativeAotLib +{ + public partial class LayoutContext + { + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? _String; + + /// + /// Defines the source generated JSON serialization contract metadata for a given type. + /// + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo String + { + get => _String ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo)Options.GetTypeInfo(typeof(string)); + } + + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Create_String(global::System.Text.Json.JsonSerializerOptions options) + { + if (!TryGetTypeInfoForRuntimeCustomConverter(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo)) + { + jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateValueInfo(options, global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.StringConverter); + } + + jsonTypeInfo.OriginatingResolver = this; + return jsonTypeInfo; + } + } +} diff --git a/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.TransformationGrid2D.g.cs b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.TransformationGrid2D.g.cs new file mode 100644 index 00000000..ce8056a4 --- /dev/null +++ b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.TransformationGrid2D.g.cs @@ -0,0 +1,34 @@ +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Edgar.NativeAotLib +{ + public partial class LayoutContext + { + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? _TransformationGrid2D; + + /// + /// Defines the source generated JSON serialization contract metadata for a given type. + /// + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo TransformationGrid2D + { + get => _TransformationGrid2D ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo)Options.GetTypeInfo(typeof(global::Edgar.Geometry.TransformationGrid2D)); + } + + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Create_TransformationGrid2D(global::System.Text.Json.JsonSerializerOptions options) + { + if (!TryGetTypeInfoForRuntimeCustomConverter(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo)) + { + jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateValueInfo(options, global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.GetEnumConverter(options)); + } + + jsonTypeInfo.OriginatingResolver = this; + return jsonTypeInfo; + } + } +} diff --git a/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.Vector2Int.g.cs b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.Vector2Int.g.cs new file mode 100644 index 00000000..a9973ac2 --- /dev/null +++ b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.Vector2Int.g.cs @@ -0,0 +1,124 @@ +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Edgar.NativeAotLib +{ + public partial class LayoutContext + { + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? _Vector2Int; + + /// + /// Defines the source generated JSON serialization contract metadata for a given type. + /// + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Vector2Int + { + get => _Vector2Int ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo)Options.GetTypeInfo(typeof(global::Edgar.Geometry.Vector2Int)); + } + + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Create_Vector2Int(global::System.Text.Json.JsonSerializerOptions options) + { + if (!TryGetTypeInfoForRuntimeCustomConverter(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo)) + { + var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues + { + ObjectCreator = null, + ObjectWithParameterizedConstructorCreator = static args => new global::Edgar.Geometry.Vector2Int((int)args[0], (int)args[1]), + PropertyMetadataInitializer = _ => Vector2IntPropInit(options), + ConstructorParameterMetadataInitializer = Vector2IntCtorParamInit, + SerializeHandler = Vector2IntSerializeHandler + }; + + jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo(options, objectInfo); + jsonTypeInfo.NumberHandling = null; + } + + jsonTypeInfo.OriginatingResolver = this; + return jsonTypeInfo; + } + + private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] Vector2IntPropInit(global::System.Text.Json.JsonSerializerOptions options) + { + var properties = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[2]; + + var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = false, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.Geometry.Vector2Int), + Converter = null, + Getter = static obj => ((global::Edgar.Geometry.Vector2Int)obj).X, + Setter = null, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "X", + JsonPropertyName = null + }; + + properties[0] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info0); + + var info1 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = false, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.Geometry.Vector2Int), + Converter = null, + Getter = static obj => ((global::Edgar.Geometry.Vector2Int)obj).Y, + Setter = null, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "Y", + JsonPropertyName = null + }; + + properties[1] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info1); + + return properties; + } + + // Intentionally not a static method because we create a delegate to it. Invoking delegates to instance + // methods is almost as fast as virtual calls. Static methods need to go through a shuffle thunk. + private void Vector2IntSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Edgar.Geometry.Vector2Int value) + { + writer.WriteStartObject(); + + + writer.WriteEndObject(); + } + + private static global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[] Vector2IntCtorParamInit() + { + var parameters = new global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[2]; + + parameters[0] = new() + { + Name = "x", + ParameterType = typeof(int), + Position = 0, + HasDefaultValue = false, + DefaultValue = default(int) + }; + + parameters[1] = new() + { + Name = "y", + ParameterType = typeof(int), + Position = 1, + HasDefaultValue = false, + DefaultValue = default(int) + }; + + return parameters; + } + } +} diff --git a/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.g.cs b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.g.cs new file mode 100644 index 00000000..5e8673ee --- /dev/null +++ b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LayoutContext.g.cs @@ -0,0 +1,85 @@ +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Edgar.NativeAotLib +{ + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Text.Json.SourceGeneration", "8.0.9.3103")] + public partial class LayoutContext + { + private readonly static global::System.Text.Json.JsonSerializerOptions s_defaultOptions = new() + { + WriteIndented = true, + }; + + /// + /// The default associated with a default instance. + /// + public static global::Edgar.NativeAotLib.LayoutContext Default { get; } = new global::Edgar.NativeAotLib.LayoutContext(new global::System.Text.Json.JsonSerializerOptions(s_defaultOptions)); + + /// + /// The source-generated options associated with this context. + /// + protected override global::System.Text.Json.JsonSerializerOptions? GeneratedSerializerOptions { get; } = s_defaultOptions; + + /// + public LayoutContext() : base(null) + { + } + + /// + public LayoutContext(global::System.Text.Json.JsonSerializerOptions options) : base(options) + { + } + + private static bool TryGetTypeInfoForRuntimeCustomConverter(global::System.Text.Json.JsonSerializerOptions options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo) + { + global::System.Text.Json.Serialization.JsonConverter? converter = GetRuntimeConverterForType(typeof(TJsonMetadataType), options); + if (converter != null) + { + jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateValueInfo(options, converter); + return true; + } + + jsonTypeInfo = null; + return false; + } + + private static global::System.Text.Json.Serialization.JsonConverter? GetRuntimeConverterForType(global::System.Type type, global::System.Text.Json.JsonSerializerOptions options) + { + for (int i = 0; i < options.Converters.Count; i++) + { + global::System.Text.Json.Serialization.JsonConverter? converter = options.Converters[i]; + if (converter?.CanConvert(type) == true) + { + return ExpandConverter(type, converter, options, validateCanConvert: false); + } + } + + return null; + } + + private static global::System.Text.Json.Serialization.JsonConverter ExpandConverter(global::System.Type type, global::System.Text.Json.Serialization.JsonConverter converter, global::System.Text.Json.JsonSerializerOptions options, bool validateCanConvert = true) + { + if (validateCanConvert && !converter.CanConvert(type)) + { + throw new global::System.InvalidOperationException(string.Format("The converter '{0}' is not compatible with the type '{1}'.", converter.GetType(), type)); + } + + if (converter is global::System.Text.Json.Serialization.JsonConverterFactory factory) + { + converter = factory.CreateConverter(type, options); + if (converter is null || converter is global::System.Text.Json.Serialization.JsonConverterFactory) + { + throw new global::System.InvalidOperationException(string.Format("The converter '{0}' cannot return null or a JsonConverterFactory instance.", factory.GetType())); + } + } + + return converter; + } + } +} diff --git a/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.Boolean.g.cs b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.Boolean.g.cs new file mode 100644 index 00000000..f3cd76e9 --- /dev/null +++ b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.Boolean.g.cs @@ -0,0 +1,34 @@ +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Edgar.NativeAotLib +{ + public partial class LevelDescriptionContext + { + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? _Boolean; + + /// + /// Defines the source generated JSON serialization contract metadata for a given type. + /// + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Boolean + { + get => _Boolean ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo)Options.GetTypeInfo(typeof(bool)); + } + + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Create_Boolean(global::System.Text.Json.JsonSerializerOptions options) + { + if (!TryGetTypeInfoForRuntimeCustomConverter(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo)) + { + jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateValueInfo(options, global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.BooleanConverter); + } + + jsonTypeInfo.OriginatingResolver = this; + return jsonTypeInfo; + } + } +} diff --git a/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.DictionaryInt32RoomDescriptionGrid2D.g.cs b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.DictionaryInt32RoomDescriptionGrid2D.g.cs new file mode 100644 index 00000000..b6cbb80d --- /dev/null +++ b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.DictionaryInt32RoomDescriptionGrid2D.g.cs @@ -0,0 +1,41 @@ +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Edgar.NativeAotLib +{ + public partial class LevelDescriptionContext + { + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo>? _DictionaryInt32RoomDescriptionGrid2D; + + /// + /// Defines the source generated JSON serialization contract metadata for a given type. + /// + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo> DictionaryInt32RoomDescriptionGrid2D + { + get => _DictionaryInt32RoomDescriptionGrid2D ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo>)Options.GetTypeInfo(typeof(global::System.Collections.Generic.Dictionary)); + } + + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo> Create_DictionaryInt32RoomDescriptionGrid2D(global::System.Text.Json.JsonSerializerOptions options) + { + if (!TryGetTypeInfoForRuntimeCustomConverter>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo> jsonTypeInfo)) + { + var info = new global::System.Text.Json.Serialization.Metadata.JsonCollectionInfoValues> + { + ObjectCreator = () => new global::System.Collections.Generic.Dictionary(), + SerializeHandler = null + }; + + jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateDictionaryInfo, int, global::Edgar.GraphBasedGenerator.Grid2D.RoomDescriptionGrid2D>(options, info); + jsonTypeInfo.NumberHandling = null; + } + + jsonTypeInfo.OriginatingResolver = this; + return jsonTypeInfo; + } + } +} diff --git a/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.Direction.g.cs b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.Direction.g.cs new file mode 100644 index 00000000..6526ceb5 --- /dev/null +++ b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.Direction.g.cs @@ -0,0 +1,34 @@ +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Edgar.NativeAotLib +{ + public partial class LevelDescriptionContext + { + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? _Direction; + + /// + /// Defines the source generated JSON serialization contract metadata for a given type. + /// + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Direction + { + get => _Direction ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo)Options.GetTypeInfo(typeof(global::Edgar.Geometry.OrthogonalLineGrid2D.Direction)); + } + + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Create_Direction(global::System.Text.Json.JsonSerializerOptions options) + { + if (!TryGetTypeInfoForRuntimeCustomConverter(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo)) + { + jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateValueInfo(options, global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.GetEnumConverter(options)); + } + + jsonTypeInfo.OriginatingResolver = this; + return jsonTypeInfo; + } + } +} diff --git a/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.DoorGrid2D.g.cs b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.DoorGrid2D.g.cs new file mode 100644 index 00000000..df7c876b --- /dev/null +++ b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.DoorGrid2D.g.cs @@ -0,0 +1,194 @@ +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Edgar.NativeAotLib +{ + public partial class LevelDescriptionContext + { + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? _DoorGrid2D; + + /// + /// Defines the source generated JSON serialization contract metadata for a given type. + /// + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo DoorGrid2D + { + get => _DoorGrid2D ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo)Options.GetTypeInfo(typeof(global::Edgar.GraphBasedGenerator.Grid2D.DoorGrid2D)); + } + + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Create_DoorGrid2D(global::System.Text.Json.JsonSerializerOptions options) + { + if (!TryGetTypeInfoForRuntimeCustomConverter(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo)) + { + var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues + { + ObjectCreator = null, + ObjectWithParameterizedConstructorCreator = static args => new global::Edgar.GraphBasedGenerator.Grid2D.DoorGrid2D((global::Edgar.Geometry.Vector2Int)args[0], (global::Edgar.Geometry.Vector2Int)args[1], (global::Edgar.GraphBasedGenerator.Common.Doors.IDoorSocket)args[2], (global::Edgar.GraphBasedGenerator.Common.Doors.DoorType)args[3]), + PropertyMetadataInitializer = _ => DoorGrid2DPropInit(options), + ConstructorParameterMetadataInitializer = DoorGrid2DCtorParamInit, + SerializeHandler = DoorGrid2DSerializeHandler + }; + + jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo(options, objectInfo); + jsonTypeInfo.NumberHandling = null; + } + + jsonTypeInfo.OriginatingResolver = this; + return jsonTypeInfo; + } + + private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] DoorGrid2DPropInit(global::System.Text.Json.JsonSerializerOptions options) + { + var properties = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[4]; + + var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.GraphBasedGenerator.Grid2D.DoorGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.GraphBasedGenerator.Grid2D.DoorGrid2D)obj).From, + Setter = null, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "From", + JsonPropertyName = null + }; + + properties[0] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info0); + + var info1 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.GraphBasedGenerator.Grid2D.DoorGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.GraphBasedGenerator.Grid2D.DoorGrid2D)obj).To, + Setter = null, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "To", + JsonPropertyName = null + }; + + properties[1] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info1); + + var info2 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.GraphBasedGenerator.Grid2D.DoorGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.GraphBasedGenerator.Grid2D.DoorGrid2D)obj).Socket, + Setter = null, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "Socket", + JsonPropertyName = null + }; + + properties[2] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info2); + + var info3 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.GraphBasedGenerator.Grid2D.DoorGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.GraphBasedGenerator.Grid2D.DoorGrid2D)obj).Type, + Setter = null, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "Type", + JsonPropertyName = null + }; + + properties[3] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info3); + + return properties; + } + + // Intentionally not a static method because we create a delegate to it. Invoking delegates to instance + // methods is almost as fast as virtual calls. Static methods need to go through a shuffle thunk. + private void DoorGrid2DSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Edgar.GraphBasedGenerator.Grid2D.DoorGrid2D? value) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + + writer.WriteStartObject(); + + writer.WritePropertyName(PropName_From); + Vector2IntSerializeHandler(writer, ((global::Edgar.GraphBasedGenerator.Grid2D.DoorGrid2D)value).From); + writer.WritePropertyName(PropName_To); + Vector2IntSerializeHandler(writer, ((global::Edgar.GraphBasedGenerator.Grid2D.DoorGrid2D)value).To); + writer.WritePropertyName(PropName_Socket); + IDoorSocketSerializeHandler(writer, ((global::Edgar.GraphBasedGenerator.Grid2D.DoorGrid2D)value).Socket); + writer.WritePropertyName(PropName_Type); + global::System.Text.Json.JsonSerializer.Serialize(writer, ((global::Edgar.GraphBasedGenerator.Grid2D.DoorGrid2D)value).Type, DoorType); + + writer.WriteEndObject(); + } + + private static global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[] DoorGrid2DCtorParamInit() + { + var parameters = new global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[4]; + + parameters[0] = new() + { + Name = "from", + ParameterType = typeof(global::Edgar.Geometry.Vector2Int), + Position = 0, + HasDefaultValue = false, + DefaultValue = default(global::Edgar.Geometry.Vector2Int) + }; + + parameters[1] = new() + { + Name = "to", + ParameterType = typeof(global::Edgar.Geometry.Vector2Int), + Position = 1, + HasDefaultValue = false, + DefaultValue = default(global::Edgar.Geometry.Vector2Int) + }; + + parameters[2] = new() + { + Name = "socket", + ParameterType = typeof(global::Edgar.GraphBasedGenerator.Common.Doors.IDoorSocket), + Position = 2, + HasDefaultValue = true, + DefaultValue = default(global::Edgar.GraphBasedGenerator.Common.Doors.IDoorSocket) + }; + + parameters[3] = new() + { + Name = "type", + ParameterType = typeof(global::Edgar.GraphBasedGenerator.Common.Doors.DoorType), + Position = 3, + HasDefaultValue = true, + DefaultValue = (global::Edgar.GraphBasedGenerator.Common.Doors.DoorType)(0) + }; + + return parameters; + } + } +} diff --git a/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.DoorLineGrid2D.g.cs b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.DoorLineGrid2D.g.cs new file mode 100644 index 00000000..c5188ded --- /dev/null +++ b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.DoorLineGrid2D.g.cs @@ -0,0 +1,187 @@ +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Edgar.NativeAotLib +{ + public partial class LevelDescriptionContext + { + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? _DoorLineGrid2D; + + /// + /// Defines the source generated JSON serialization contract metadata for a given type. + /// + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo DoorLineGrid2D + { + get => _DoorLineGrid2D ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo)Options.GetTypeInfo(typeof(global::Edgar.GraphBasedGenerator.Grid2D.DoorLineGrid2D)); + } + + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Create_DoorLineGrid2D(global::System.Text.Json.JsonSerializerOptions options) + { + if (!TryGetTypeInfoForRuntimeCustomConverter(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo)) + { + var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues + { + ObjectCreator = null, + ObjectWithParameterizedConstructorCreator = static args => new global::Edgar.GraphBasedGenerator.Grid2D.DoorLineGrid2D((global::Edgar.Geometry.OrthogonalLineGrid2D)args[0], (int)args[1], (global::Edgar.GraphBasedGenerator.Common.Doors.IDoorSocket)args[2], (global::Edgar.GraphBasedGenerator.Common.Doors.DoorType)args[3]), + PropertyMetadataInitializer = _ => DoorLineGrid2DPropInit(options), + ConstructorParameterMetadataInitializer = DoorLineGrid2DCtorParamInit, + SerializeHandler = DoorLineGrid2DSerializeHandler + }; + + jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo(options, objectInfo); + jsonTypeInfo.NumberHandling = null; + } + + jsonTypeInfo.OriginatingResolver = this; + return jsonTypeInfo; + } + + private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] DoorLineGrid2DPropInit(global::System.Text.Json.JsonSerializerOptions options) + { + var properties = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[4]; + + var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.GraphBasedGenerator.Grid2D.DoorLineGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.GraphBasedGenerator.Grid2D.DoorLineGrid2D)obj).Line, + Setter = null, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "Line", + JsonPropertyName = null + }; + + properties[0] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info0); + + var info1 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.GraphBasedGenerator.Grid2D.DoorLineGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.GraphBasedGenerator.Grid2D.DoorLineGrid2D)obj).Length, + Setter = null, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "Length", + JsonPropertyName = null + }; + + properties[1] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info1); + + var info2 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.GraphBasedGenerator.Grid2D.DoorLineGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.GraphBasedGenerator.Grid2D.DoorLineGrid2D)obj).DoorSocket, + Setter = null, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "DoorSocket", + JsonPropertyName = null + }; + + properties[2] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info2); + + var info3 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.GraphBasedGenerator.Grid2D.DoorLineGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.GraphBasedGenerator.Grid2D.DoorLineGrid2D)obj).Type, + Setter = null, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "Type", + JsonPropertyName = null + }; + + properties[3] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info3); + + return properties; + } + + // Intentionally not a static method because we create a delegate to it. Invoking delegates to instance + // methods is almost as fast as virtual calls. Static methods need to go through a shuffle thunk. + private void DoorLineGrid2DSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Edgar.GraphBasedGenerator.Grid2D.DoorLineGrid2D value) + { + writer.WriteStartObject(); + + writer.WritePropertyName(PropName_Line); + OrthogonalLineGrid2DSerializeHandler(writer, ((global::Edgar.GraphBasedGenerator.Grid2D.DoorLineGrid2D)value).Line); + writer.WriteNumber(PropName_Length, ((global::Edgar.GraphBasedGenerator.Grid2D.DoorLineGrid2D)value).Length); + writer.WritePropertyName(PropName_DoorSocket); + IDoorSocketSerializeHandler(writer, ((global::Edgar.GraphBasedGenerator.Grid2D.DoorLineGrid2D)value).DoorSocket); + writer.WritePropertyName(PropName_Type); + global::System.Text.Json.JsonSerializer.Serialize(writer, ((global::Edgar.GraphBasedGenerator.Grid2D.DoorLineGrid2D)value).Type, DoorType); + + writer.WriteEndObject(); + } + + private static global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[] DoorLineGrid2DCtorParamInit() + { + var parameters = new global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[4]; + + parameters[0] = new() + { + Name = "line", + ParameterType = typeof(global::Edgar.Geometry.OrthogonalLineGrid2D), + Position = 0, + HasDefaultValue = false, + DefaultValue = default(global::Edgar.Geometry.OrthogonalLineGrid2D) + }; + + parameters[1] = new() + { + Name = "length", + ParameterType = typeof(int), + Position = 1, + HasDefaultValue = false, + DefaultValue = default(int) + }; + + parameters[2] = new() + { + Name = "doorSocket", + ParameterType = typeof(global::Edgar.GraphBasedGenerator.Common.Doors.IDoorSocket), + Position = 2, + HasDefaultValue = false, + DefaultValue = default(global::Edgar.GraphBasedGenerator.Common.Doors.IDoorSocket) + }; + + parameters[3] = new() + { + Name = "type", + ParameterType = typeof(global::Edgar.GraphBasedGenerator.Common.Doors.DoorType), + Position = 3, + HasDefaultValue = false, + DefaultValue = default(global::Edgar.GraphBasedGenerator.Common.Doors.DoorType) + }; + + return parameters; + } + } +} diff --git a/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.DoorType.g.cs b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.DoorType.g.cs new file mode 100644 index 00000000..dad3e6d6 --- /dev/null +++ b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.DoorType.g.cs @@ -0,0 +1,34 @@ +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Edgar.NativeAotLib +{ + public partial class LevelDescriptionContext + { + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? _DoorType; + + /// + /// Defines the source generated JSON serialization contract metadata for a given type. + /// + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo DoorType + { + get => _DoorType ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo)Options.GetTypeInfo(typeof(global::Edgar.GraphBasedGenerator.Common.Doors.DoorType)); + } + + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Create_DoorType(global::System.Text.Json.JsonSerializerOptions options) + { + if (!TryGetTypeInfoForRuntimeCustomConverter(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo)) + { + jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateValueInfo(options, global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.GetEnumConverter(options)); + } + + jsonTypeInfo.OriginatingResolver = this; + return jsonTypeInfo; + } + } +} diff --git a/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.GetJsonTypeInfo.g.cs b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.GetJsonTypeInfo.g.cs new file mode 100644 index 00000000..c794e21b --- /dev/null +++ b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.GetJsonTypeInfo.g.cs @@ -0,0 +1,153 @@ +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Edgar.NativeAotLib +{ + public partial class LevelDescriptionContext : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver + { + /// + public override global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo(global::System.Type type) + { + Options.TryGetTypeInfo(type, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? typeInfo); + return typeInfo; + } + + global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver.GetTypeInfo(global::System.Type type, global::System.Text.Json.JsonSerializerOptions options) + { + if (type == typeof(bool)) + { + return Create_Boolean(options); + } + if (type == typeof(global::Edgar.Geometry.OrthogonalLineGrid2D)) + { + return Create_OrthogonalLineGrid2D(options); + } + if (type == typeof(global::Edgar.Geometry.OrthogonalLineGrid2D.Direction)) + { + return Create_Direction(options); + } + if (type == typeof(global::Edgar.Geometry.PolygonGrid2D)) + { + return Create_PolygonGrid2D(options); + } + if (type == typeof(global::Edgar.Geometry.TransformationGrid2D)) + { + return Create_TransformationGrid2D(options); + } + if (type == typeof(global::Edgar.Geometry.Vector2Int)) + { + return Create_Vector2Int(options); + } + if (type == typeof(global::Edgar.GraphBasedGenerator.Common.Doors.DoorType)) + { + return Create_DoorType(options); + } + if (type == typeof(global::Edgar.GraphBasedGenerator.Common.Doors.IDoorSocket)) + { + return Create_IDoorSocket(options); + } + if (type == typeof(global::Edgar.GraphBasedGenerator.Common.LevelDescriptionBase.Passage)) + { + return Create_PassageInt32RoomDescriptionGrid2D(options); + } + if (type == typeof(global::Edgar.GraphBasedGenerator.Common.RoomTemplateRepeatMode)) + { + return Create_RoomTemplateRepeatMode(options); + } + if (type == typeof(global::Edgar.GraphBasedGenerator.Common.RoomTemplateRepeatMode?)) + { + return Create_NullableRoomTemplateRepeatMode(options); + } + if (type == typeof(global::Edgar.GraphBasedGenerator.Grid2D.DoorGrid2D)) + { + return Create_DoorGrid2D(options); + } + if (type == typeof(global::Edgar.GraphBasedGenerator.Grid2D.DoorLineGrid2D)) + { + return Create_DoorLineGrid2D(options); + } + if (type == typeof(global::Edgar.GraphBasedGenerator.Grid2D.IDoorModeGrid2D)) + { + return Create_IDoorModeGrid2D(options); + } + if (type == typeof(global::Edgar.GraphBasedGenerator.Grid2D.IGeneratorConstraintGrid2D)) + { + return Create_IGeneratorConstraintGrid2DInt32(options); + } + if (type == typeof(global::Edgar.GraphBasedGenerator.Grid2D.LevelDescriptionGrid2D)) + { + return Create_LevelDescriptionGrid2DInt32(options); + } + if (type == typeof(global::Edgar.GraphBasedGenerator.Grid2D.ManualDoorModeGrid2D)) + { + return Create_ManualDoorModeGrid2D(options); + } + if (type == typeof(global::Edgar.GraphBasedGenerator.Grid2D.RoomDescriptionGrid2D)) + { + return Create_RoomDescriptionGrid2D(options); + } + if (type == typeof(global::Edgar.GraphBasedGenerator.Grid2D.RoomTemplateGrid2D)) + { + return Create_RoomTemplateGrid2D(options); + } + if (type == typeof(global::Edgar.GraphBasedGenerator.Grid2D.SimpleDoorModeGrid2D)) + { + return Create_SimpleDoorModeGrid2D(options); + } + if (type == typeof(global::System.Collections.Generic.Dictionary)) + { + return Create_DictionaryInt32RoomDescriptionGrid2D(options); + } + if (type == typeof(global::System.Collections.Generic.List)) + { + return Create_ListTransformationGrid2D(options); + } + if (type == typeof(global::System.Collections.Generic.List)) + { + return Create_ListVector2Int(options); + } + if (type == typeof(global::System.Collections.Generic.List.Passage>)) + { + return Create_ListPassageInt32RoomDescriptionGrid2D(options); + } + if (type == typeof(global::System.Collections.Generic.List)) + { + return Create_ListDoorGrid2D(options); + } + if (type == typeof(global::System.Collections.Generic.List)) + { + return Create_ListDoorLineGrid2D(options); + } + if (type == typeof(global::System.Collections.Generic.List>)) + { + return Create_ListIGeneratorConstraintGrid2DInt32(options); + } + if (type == typeof(global::System.Collections.Generic.List)) + { + return Create_ListRoomTemplateGrid2D(options); + } + if (type == typeof(global::System.Collections.Generic.List>)) + { + return Create_ListListInt32(options); + } + if (type == typeof(global::System.Collections.Generic.List)) + { + return Create_ListInt32(options); + } + if (type == typeof(int)) + { + return Create_Int32(options); + } + if (type == typeof(string)) + { + return Create_String(options); + } + return null; + } + } +} diff --git a/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.IDoorModeGrid2D.g.cs b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.IDoorModeGrid2D.g.cs new file mode 100644 index 00000000..40e8cab9 --- /dev/null +++ b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.IDoorModeGrid2D.g.cs @@ -0,0 +1,51 @@ +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Edgar.NativeAotLib +{ + public partial class LevelDescriptionContext + { + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? _IDoorModeGrid2D; + + /// + /// Defines the source generated JSON serialization contract metadata for a given type. + /// + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo IDoorModeGrid2D + { + get => _IDoorModeGrid2D ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo)Options.GetTypeInfo(typeof(global::Edgar.GraphBasedGenerator.Grid2D.IDoorModeGrid2D)); + } + + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Create_IDoorModeGrid2D(global::System.Text.Json.JsonSerializerOptions options) + { + if (!TryGetTypeInfoForRuntimeCustomConverter(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo)) + { + var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues + { + ObjectCreator = null, + ObjectWithParameterizedConstructorCreator = null, + PropertyMetadataInitializer = _ => IDoorModeGrid2DPropInit(options), + ConstructorParameterMetadataInitializer = null, + SerializeHandler = null + }; + + jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo(options, objectInfo); + jsonTypeInfo.NumberHandling = null; + } + + jsonTypeInfo.OriginatingResolver = this; + return jsonTypeInfo; + } + + private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] IDoorModeGrid2DPropInit(global::System.Text.Json.JsonSerializerOptions options) + { + var properties = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[0]; + + return properties; + } + } +} diff --git a/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.IDoorSocket.g.cs b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.IDoorSocket.g.cs new file mode 100644 index 00000000..e96f7488 --- /dev/null +++ b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.IDoorSocket.g.cs @@ -0,0 +1,67 @@ +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Edgar.NativeAotLib +{ + public partial class LevelDescriptionContext + { + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? _IDoorSocket; + + /// + /// Defines the source generated JSON serialization contract metadata for a given type. + /// + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo IDoorSocket + { + get => _IDoorSocket ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo)Options.GetTypeInfo(typeof(global::Edgar.GraphBasedGenerator.Common.Doors.IDoorSocket)); + } + + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Create_IDoorSocket(global::System.Text.Json.JsonSerializerOptions options) + { + if (!TryGetTypeInfoForRuntimeCustomConverter(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo)) + { + var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues + { + ObjectCreator = null, + ObjectWithParameterizedConstructorCreator = null, + PropertyMetadataInitializer = _ => IDoorSocketPropInit(options), + ConstructorParameterMetadataInitializer = null, + SerializeHandler = IDoorSocketSerializeHandler + }; + + jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo(options, objectInfo); + jsonTypeInfo.NumberHandling = null; + } + + jsonTypeInfo.OriginatingResolver = this; + return jsonTypeInfo; + } + + private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] IDoorSocketPropInit(global::System.Text.Json.JsonSerializerOptions options) + { + var properties = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[0]; + + return properties; + } + + // Intentionally not a static method because we create a delegate to it. Invoking delegates to instance + // methods is almost as fast as virtual calls. Static methods need to go through a shuffle thunk. + private void IDoorSocketSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Edgar.GraphBasedGenerator.Common.Doors.IDoorSocket? value) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + + writer.WriteStartObject(); + + + writer.WriteEndObject(); + } + } +} diff --git a/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.IGeneratorConstraintGrid2DInt32.g.cs b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.IGeneratorConstraintGrid2DInt32.g.cs new file mode 100644 index 00000000..64feb795 --- /dev/null +++ b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.IGeneratorConstraintGrid2DInt32.g.cs @@ -0,0 +1,67 @@ +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Edgar.NativeAotLib +{ + public partial class LevelDescriptionContext + { + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo>? _IGeneratorConstraintGrid2DInt32; + + /// + /// Defines the source generated JSON serialization contract metadata for a given type. + /// + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo> IGeneratorConstraintGrid2DInt32 + { + get => _IGeneratorConstraintGrid2DInt32 ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo>)Options.GetTypeInfo(typeof(global::Edgar.GraphBasedGenerator.Grid2D.IGeneratorConstraintGrid2D)); + } + + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo> Create_IGeneratorConstraintGrid2DInt32(global::System.Text.Json.JsonSerializerOptions options) + { + if (!TryGetTypeInfoForRuntimeCustomConverter>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo> jsonTypeInfo)) + { + var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues> + { + ObjectCreator = null, + ObjectWithParameterizedConstructorCreator = null, + PropertyMetadataInitializer = _ => IGeneratorConstraintGrid2DInt32PropInit(options), + ConstructorParameterMetadataInitializer = null, + SerializeHandler = IGeneratorConstraintGrid2DInt32SerializeHandler + }; + + jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo>(options, objectInfo); + jsonTypeInfo.NumberHandling = null; + } + + jsonTypeInfo.OriginatingResolver = this; + return jsonTypeInfo; + } + + private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] IGeneratorConstraintGrid2DInt32PropInit(global::System.Text.Json.JsonSerializerOptions options) + { + var properties = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[0]; + + return properties; + } + + // Intentionally not a static method because we create a delegate to it. Invoking delegates to instance + // methods is almost as fast as virtual calls. Static methods need to go through a shuffle thunk. + private void IGeneratorConstraintGrid2DInt32SerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Edgar.GraphBasedGenerator.Grid2D.IGeneratorConstraintGrid2D? value) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + + writer.WriteStartObject(); + + + writer.WriteEndObject(); + } + } +} diff --git a/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.Int32.g.cs b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.Int32.g.cs new file mode 100644 index 00000000..261940fc --- /dev/null +++ b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.Int32.g.cs @@ -0,0 +1,34 @@ +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Edgar.NativeAotLib +{ + public partial class LevelDescriptionContext + { + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? _Int32; + + /// + /// Defines the source generated JSON serialization contract metadata for a given type. + /// + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Int32 + { + get => _Int32 ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo)Options.GetTypeInfo(typeof(int)); + } + + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Create_Int32(global::System.Text.Json.JsonSerializerOptions options) + { + if (!TryGetTypeInfoForRuntimeCustomConverter(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo)) + { + jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateValueInfo(options, global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.Int32Converter); + } + + jsonTypeInfo.OriginatingResolver = this; + return jsonTypeInfo; + } + } +} diff --git a/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.LevelDescriptionGrid2DInt32.g.cs b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.LevelDescriptionGrid2DInt32.g.cs new file mode 100644 index 00000000..1ee804ab --- /dev/null +++ b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.LevelDescriptionGrid2DInt32.g.cs @@ -0,0 +1,229 @@ +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Edgar.NativeAotLib +{ + public partial class LevelDescriptionContext + { + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo>? _LevelDescriptionGrid2DInt32; + + /// + /// Defines the source generated JSON serialization contract metadata for a given type. + /// + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo> LevelDescriptionGrid2DInt32 + { + get => _LevelDescriptionGrid2DInt32 ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo>)Options.GetTypeInfo(typeof(global::Edgar.GraphBasedGenerator.Grid2D.LevelDescriptionGrid2D)); + } + + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo> Create_LevelDescriptionGrid2DInt32(global::System.Text.Json.JsonSerializerOptions options) + { + if (!TryGetTypeInfoForRuntimeCustomConverter>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo> jsonTypeInfo)) + { + var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues> + { + ObjectCreator = () => new global::Edgar.GraphBasedGenerator.Grid2D.LevelDescriptionGrid2D(), + ObjectWithParameterizedConstructorCreator = null, + PropertyMetadataInitializer = _ => LevelDescriptionGrid2DInt32PropInit(options), + ConstructorParameterMetadataInitializer = null, + SerializeHandler = LevelDescriptionGrid2DInt32SerializeHandler + }; + + jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo>(options, objectInfo); + jsonTypeInfo.NumberHandling = null; + } + + jsonTypeInfo.OriginatingResolver = this; + return jsonTypeInfo; + } + + private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] LevelDescriptionGrid2DInt32PropInit(global::System.Text.Json.JsonSerializerOptions options) + { + var properties = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[8]; + + var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.GraphBasedGenerator.Grid2D.LevelDescriptionGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.GraphBasedGenerator.Grid2D.LevelDescriptionGrid2D)obj).MinimumRoomDistance, + Setter = static (obj, value) => ((global::Edgar.GraphBasedGenerator.Grid2D.LevelDescriptionGrid2D)obj).MinimumRoomDistance = value!, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "MinimumRoomDistance", + JsonPropertyName = null + }; + + properties[0] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info0); + + var info1 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues>> + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.GraphBasedGenerator.Grid2D.LevelDescriptionGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.GraphBasedGenerator.Grid2D.LevelDescriptionGrid2D)obj).Clusters, + Setter = static (obj, value) => ((global::Edgar.GraphBasedGenerator.Grid2D.LevelDescriptionGrid2D)obj).Clusters = value!, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "Clusters", + JsonPropertyName = null + }; + + properties[1] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo>>(options, info1); + + var info2 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues>> + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.GraphBasedGenerator.Grid2D.LevelDescriptionGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.GraphBasedGenerator.Grid2D.LevelDescriptionGrid2D)obj).Constraints, + Setter = static (obj, value) => ((global::Edgar.GraphBasedGenerator.Grid2D.LevelDescriptionGrid2D)obj).Constraints = value!, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "Constraints", + JsonPropertyName = null + }; + + properties[2] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo>>(options, info2); + + var info3 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.GraphBasedGenerator.Grid2D.LevelDescriptionGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.GraphBasedGenerator.Grid2D.LevelDescriptionGrid2D)obj).RoomTemplateRepeatModeDefault, + Setter = static (obj, value) => ((global::Edgar.GraphBasedGenerator.Grid2D.LevelDescriptionGrid2D)obj).RoomTemplateRepeatModeDefault = value!, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "RoomTemplateRepeatModeDefault", + JsonPropertyName = null + }; + + properties[3] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info3); + + var info4 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.GraphBasedGenerator.Grid2D.LevelDescriptionGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.GraphBasedGenerator.Grid2D.LevelDescriptionGrid2D)obj).RoomTemplateRepeatModeOverride, + Setter = static (obj, value) => ((global::Edgar.GraphBasedGenerator.Grid2D.LevelDescriptionGrid2D)obj).RoomTemplateRepeatModeOverride = value!, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "RoomTemplateRepeatModeOverride", + JsonPropertyName = null + }; + + properties[4] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info4); + + var info5 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.GraphBasedGenerator.Common.LevelDescriptionBase), + Converter = null, + Getter = static obj => ((global::Edgar.GraphBasedGenerator.Common.LevelDescriptionBase)obj).Name, + Setter = static (obj, value) => ((global::Edgar.GraphBasedGenerator.Common.LevelDescriptionBase)obj).Name = value!, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "Name", + JsonPropertyName = null + }; + + properties[5] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info5); + + var info6 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues> + { + IsProperty = false, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.GraphBasedGenerator.Common.LevelDescriptionBase), + Converter = null, + Getter = static obj => ((global::Edgar.GraphBasedGenerator.Common.LevelDescriptionBase)obj).roomDescriptions, + Setter = static (obj, value) => ((global::Edgar.GraphBasedGenerator.Common.LevelDescriptionBase)obj).roomDescriptions = value!, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "roomDescriptions", + JsonPropertyName = null + }; + + properties[6] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo>(options, info6); + + var info7 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues.Passage>> + { + IsProperty = false, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.GraphBasedGenerator.Common.LevelDescriptionBase), + Converter = null, + Getter = static obj => ((global::Edgar.GraphBasedGenerator.Common.LevelDescriptionBase)obj).passages, + Setter = static (obj, value) => ((global::Edgar.GraphBasedGenerator.Common.LevelDescriptionBase)obj).passages = value!, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "passages", + JsonPropertyName = null + }; + + properties[7] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo.Passage>>(options, info7); + + return properties; + } + + // Intentionally not a static method because we create a delegate to it. Invoking delegates to instance + // methods is almost as fast as virtual calls. Static methods need to go through a shuffle thunk. + private void LevelDescriptionGrid2DInt32SerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Edgar.GraphBasedGenerator.Grid2D.LevelDescriptionGrid2D? value) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + + writer.WriteStartObject(); + + writer.WriteNumber(PropName_MinimumRoomDistance, ((global::Edgar.GraphBasedGenerator.Grid2D.LevelDescriptionGrid2D)value).MinimumRoomDistance); + writer.WritePropertyName(PropName_Clusters); + ListListInt32SerializeHandler(writer, ((global::Edgar.GraphBasedGenerator.Grid2D.LevelDescriptionGrid2D)value).Clusters); + writer.WritePropertyName(PropName_Constraints); + ListIGeneratorConstraintGrid2DInt32SerializeHandler(writer, ((global::Edgar.GraphBasedGenerator.Grid2D.LevelDescriptionGrid2D)value).Constraints); + writer.WritePropertyName(PropName_RoomTemplateRepeatModeDefault); + global::System.Text.Json.JsonSerializer.Serialize(writer, ((global::Edgar.GraphBasedGenerator.Grid2D.LevelDescriptionGrid2D)value).RoomTemplateRepeatModeDefault, NullableRoomTemplateRepeatMode); + writer.WritePropertyName(PropName_RoomTemplateRepeatModeOverride); + global::System.Text.Json.JsonSerializer.Serialize(writer, ((global::Edgar.GraphBasedGenerator.Grid2D.LevelDescriptionGrid2D)value).RoomTemplateRepeatModeOverride, NullableRoomTemplateRepeatMode); + writer.WriteString(PropName_Name, ((global::Edgar.GraphBasedGenerator.Common.LevelDescriptionBase)value).Name); + + writer.WriteEndObject(); + } + } +} diff --git a/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.ListDoorGrid2D.g.cs b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.ListDoorGrid2D.g.cs new file mode 100644 index 00000000..f676d113 --- /dev/null +++ b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.ListDoorGrid2D.g.cs @@ -0,0 +1,61 @@ +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Edgar.NativeAotLib +{ + public partial class LevelDescriptionContext + { + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo>? _ListDoorGrid2D; + + /// + /// Defines the source generated JSON serialization contract metadata for a given type. + /// + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo> ListDoorGrid2D + { + get => _ListDoorGrid2D ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo>)Options.GetTypeInfo(typeof(global::System.Collections.Generic.List)); + } + + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo> Create_ListDoorGrid2D(global::System.Text.Json.JsonSerializerOptions options) + { + if (!TryGetTypeInfoForRuntimeCustomConverter>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo> jsonTypeInfo)) + { + var info = new global::System.Text.Json.Serialization.Metadata.JsonCollectionInfoValues> + { + ObjectCreator = () => new global::System.Collections.Generic.List(), + SerializeHandler = ListDoorGrid2DSerializeHandler + }; + + jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateListInfo, global::Edgar.GraphBasedGenerator.Grid2D.DoorGrid2D>(options, info); + jsonTypeInfo.NumberHandling = null; + } + + jsonTypeInfo.OriginatingResolver = this; + return jsonTypeInfo; + } + + // Intentionally not a static method because we create a delegate to it. Invoking delegates to instance + // methods is almost as fast as virtual calls. Static methods need to go through a shuffle thunk. + private void ListDoorGrid2DSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::System.Collections.Generic.List? value) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + + writer.WriteStartArray(); + + for (int i = 0; i < value.Count; i++) + { + DoorGrid2DSerializeHandler(writer, value[i]); + } + + writer.WriteEndArray(); + } + } +} diff --git a/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.ListDoorLineGrid2D.g.cs b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.ListDoorLineGrid2D.g.cs new file mode 100644 index 00000000..8d38e791 --- /dev/null +++ b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.ListDoorLineGrid2D.g.cs @@ -0,0 +1,61 @@ +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Edgar.NativeAotLib +{ + public partial class LevelDescriptionContext + { + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo>? _ListDoorLineGrid2D; + + /// + /// Defines the source generated JSON serialization contract metadata for a given type. + /// + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo> ListDoorLineGrid2D + { + get => _ListDoorLineGrid2D ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo>)Options.GetTypeInfo(typeof(global::System.Collections.Generic.List)); + } + + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo> Create_ListDoorLineGrid2D(global::System.Text.Json.JsonSerializerOptions options) + { + if (!TryGetTypeInfoForRuntimeCustomConverter>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo> jsonTypeInfo)) + { + var info = new global::System.Text.Json.Serialization.Metadata.JsonCollectionInfoValues> + { + ObjectCreator = () => new global::System.Collections.Generic.List(), + SerializeHandler = ListDoorLineGrid2DSerializeHandler + }; + + jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateListInfo, global::Edgar.GraphBasedGenerator.Grid2D.DoorLineGrid2D>(options, info); + jsonTypeInfo.NumberHandling = null; + } + + jsonTypeInfo.OriginatingResolver = this; + return jsonTypeInfo; + } + + // Intentionally not a static method because we create a delegate to it. Invoking delegates to instance + // methods is almost as fast as virtual calls. Static methods need to go through a shuffle thunk. + private void ListDoorLineGrid2DSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::System.Collections.Generic.List? value) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + + writer.WriteStartArray(); + + for (int i = 0; i < value.Count; i++) + { + DoorLineGrid2DSerializeHandler(writer, value[i]); + } + + writer.WriteEndArray(); + } + } +} diff --git a/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.ListIGeneratorConstraintGrid2DInt32.g.cs b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.ListIGeneratorConstraintGrid2DInt32.g.cs new file mode 100644 index 00000000..c7fd1a64 --- /dev/null +++ b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.ListIGeneratorConstraintGrid2DInt32.g.cs @@ -0,0 +1,61 @@ +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Edgar.NativeAotLib +{ + public partial class LevelDescriptionContext + { + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo>>? _ListIGeneratorConstraintGrid2DInt32; + + /// + /// Defines the source generated JSON serialization contract metadata for a given type. + /// + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo>> ListIGeneratorConstraintGrid2DInt32 + { + get => _ListIGeneratorConstraintGrid2DInt32 ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo>>)Options.GetTypeInfo(typeof(global::System.Collections.Generic.List>)); + } + + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo>> Create_ListIGeneratorConstraintGrid2DInt32(global::System.Text.Json.JsonSerializerOptions options) + { + if (!TryGetTypeInfoForRuntimeCustomConverter>>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo>> jsonTypeInfo)) + { + var info = new global::System.Text.Json.Serialization.Metadata.JsonCollectionInfoValues>> + { + ObjectCreator = () => new global::System.Collections.Generic.List>(), + SerializeHandler = ListIGeneratorConstraintGrid2DInt32SerializeHandler + }; + + jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateListInfo>, global::Edgar.GraphBasedGenerator.Grid2D.IGeneratorConstraintGrid2D>(options, info); + jsonTypeInfo.NumberHandling = null; + } + + jsonTypeInfo.OriginatingResolver = this; + return jsonTypeInfo; + } + + // Intentionally not a static method because we create a delegate to it. Invoking delegates to instance + // methods is almost as fast as virtual calls. Static methods need to go through a shuffle thunk. + private void ListIGeneratorConstraintGrid2DInt32SerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::System.Collections.Generic.List>? value) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + + writer.WriteStartArray(); + + for (int i = 0; i < value.Count; i++) + { + IGeneratorConstraintGrid2DInt32SerializeHandler(writer, value[i]); + } + + writer.WriteEndArray(); + } + } +} diff --git a/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.ListInt32.g.cs b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.ListInt32.g.cs new file mode 100644 index 00000000..211c3cb3 --- /dev/null +++ b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.ListInt32.g.cs @@ -0,0 +1,61 @@ +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Edgar.NativeAotLib +{ + public partial class LevelDescriptionContext + { + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo>? _ListInt32; + + /// + /// Defines the source generated JSON serialization contract metadata for a given type. + /// + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo> ListInt32 + { + get => _ListInt32 ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo>)Options.GetTypeInfo(typeof(global::System.Collections.Generic.List)); + } + + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo> Create_ListInt32(global::System.Text.Json.JsonSerializerOptions options) + { + if (!TryGetTypeInfoForRuntimeCustomConverter>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo> jsonTypeInfo)) + { + var info = new global::System.Text.Json.Serialization.Metadata.JsonCollectionInfoValues> + { + ObjectCreator = () => new global::System.Collections.Generic.List(), + SerializeHandler = ListInt32SerializeHandler + }; + + jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateListInfo, int>(options, info); + jsonTypeInfo.NumberHandling = null; + } + + jsonTypeInfo.OriginatingResolver = this; + return jsonTypeInfo; + } + + // Intentionally not a static method because we create a delegate to it. Invoking delegates to instance + // methods is almost as fast as virtual calls. Static methods need to go through a shuffle thunk. + private void ListInt32SerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::System.Collections.Generic.List? value) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + + writer.WriteStartArray(); + + for (int i = 0; i < value.Count; i++) + { + writer.WriteNumberValue(value[i]); + } + + writer.WriteEndArray(); + } + } +} diff --git a/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.ListListInt32.g.cs b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.ListListInt32.g.cs new file mode 100644 index 00000000..c5db26f5 --- /dev/null +++ b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.ListListInt32.g.cs @@ -0,0 +1,61 @@ +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Edgar.NativeAotLib +{ + public partial class LevelDescriptionContext + { + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo>>? _ListListInt32; + + /// + /// Defines the source generated JSON serialization contract metadata for a given type. + /// + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo>> ListListInt32 + { + get => _ListListInt32 ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo>>)Options.GetTypeInfo(typeof(global::System.Collections.Generic.List>)); + } + + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo>> Create_ListListInt32(global::System.Text.Json.JsonSerializerOptions options) + { + if (!TryGetTypeInfoForRuntimeCustomConverter>>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo>> jsonTypeInfo)) + { + var info = new global::System.Text.Json.Serialization.Metadata.JsonCollectionInfoValues>> + { + ObjectCreator = () => new global::System.Collections.Generic.List>(), + SerializeHandler = ListListInt32SerializeHandler + }; + + jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateListInfo>, global::System.Collections.Generic.List>(options, info); + jsonTypeInfo.NumberHandling = null; + } + + jsonTypeInfo.OriginatingResolver = this; + return jsonTypeInfo; + } + + // Intentionally not a static method because we create a delegate to it. Invoking delegates to instance + // methods is almost as fast as virtual calls. Static methods need to go through a shuffle thunk. + private void ListListInt32SerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::System.Collections.Generic.List>? value) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + + writer.WriteStartArray(); + + for (int i = 0; i < value.Count; i++) + { + ListInt32SerializeHandler(writer, value[i]); + } + + writer.WriteEndArray(); + } + } +} diff --git a/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.ListPassageInt32RoomDescriptionGrid2D.g.cs b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.ListPassageInt32RoomDescriptionGrid2D.g.cs new file mode 100644 index 00000000..432b283d --- /dev/null +++ b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.ListPassageInt32RoomDescriptionGrid2D.g.cs @@ -0,0 +1,61 @@ +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Edgar.NativeAotLib +{ + public partial class LevelDescriptionContext + { + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo.Passage>>? _ListPassageInt32RoomDescriptionGrid2D; + + /// + /// Defines the source generated JSON serialization contract metadata for a given type. + /// + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo.Passage>> ListPassageInt32RoomDescriptionGrid2D + { + get => _ListPassageInt32RoomDescriptionGrid2D ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo.Passage>>)Options.GetTypeInfo(typeof(global::System.Collections.Generic.List.Passage>)); + } + + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo.Passage>> Create_ListPassageInt32RoomDescriptionGrid2D(global::System.Text.Json.JsonSerializerOptions options) + { + if (!TryGetTypeInfoForRuntimeCustomConverter.Passage>>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo.Passage>> jsonTypeInfo)) + { + var info = new global::System.Text.Json.Serialization.Metadata.JsonCollectionInfoValues.Passage>> + { + ObjectCreator = () => new global::System.Collections.Generic.List.Passage>(), + SerializeHandler = ListPassageInt32RoomDescriptionGrid2DSerializeHandler + }; + + jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateListInfo.Passage>, global::Edgar.GraphBasedGenerator.Common.LevelDescriptionBase.Passage>(options, info); + jsonTypeInfo.NumberHandling = null; + } + + jsonTypeInfo.OriginatingResolver = this; + return jsonTypeInfo; + } + + // Intentionally not a static method because we create a delegate to it. Invoking delegates to instance + // methods is almost as fast as virtual calls. Static methods need to go through a shuffle thunk. + private void ListPassageInt32RoomDescriptionGrid2DSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::System.Collections.Generic.List.Passage>? value) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + + writer.WriteStartArray(); + + for (int i = 0; i < value.Count; i++) + { + PassageInt32RoomDescriptionGrid2DSerializeHandler(writer, value[i]); + } + + writer.WriteEndArray(); + } + } +} diff --git a/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.ListRoomTemplateGrid2D.g.cs b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.ListRoomTemplateGrid2D.g.cs new file mode 100644 index 00000000..63a7ca23 --- /dev/null +++ b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.ListRoomTemplateGrid2D.g.cs @@ -0,0 +1,61 @@ +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Edgar.NativeAotLib +{ + public partial class LevelDescriptionContext + { + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo>? _ListRoomTemplateGrid2D; + + /// + /// Defines the source generated JSON serialization contract metadata for a given type. + /// + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo> ListRoomTemplateGrid2D + { + get => _ListRoomTemplateGrid2D ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo>)Options.GetTypeInfo(typeof(global::System.Collections.Generic.List)); + } + + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo> Create_ListRoomTemplateGrid2D(global::System.Text.Json.JsonSerializerOptions options) + { + if (!TryGetTypeInfoForRuntimeCustomConverter>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo> jsonTypeInfo)) + { + var info = new global::System.Text.Json.Serialization.Metadata.JsonCollectionInfoValues> + { + ObjectCreator = () => new global::System.Collections.Generic.List(), + SerializeHandler = ListRoomTemplateGrid2DSerializeHandler + }; + + jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateListInfo, global::Edgar.GraphBasedGenerator.Grid2D.RoomTemplateGrid2D>(options, info); + jsonTypeInfo.NumberHandling = null; + } + + jsonTypeInfo.OriginatingResolver = this; + return jsonTypeInfo; + } + + // Intentionally not a static method because we create a delegate to it. Invoking delegates to instance + // methods is almost as fast as virtual calls. Static methods need to go through a shuffle thunk. + private void ListRoomTemplateGrid2DSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::System.Collections.Generic.List? value) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + + writer.WriteStartArray(); + + for (int i = 0; i < value.Count; i++) + { + RoomTemplateGrid2DSerializeHandler(writer, value[i]); + } + + writer.WriteEndArray(); + } + } +} diff --git a/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.ListTransformationGrid2D.g.cs b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.ListTransformationGrid2D.g.cs new file mode 100644 index 00000000..d3344bc8 --- /dev/null +++ b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.ListTransformationGrid2D.g.cs @@ -0,0 +1,61 @@ +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Edgar.NativeAotLib +{ + public partial class LevelDescriptionContext + { + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo>? _ListTransformationGrid2D; + + /// + /// Defines the source generated JSON serialization contract metadata for a given type. + /// + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo> ListTransformationGrid2D + { + get => _ListTransformationGrid2D ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo>)Options.GetTypeInfo(typeof(global::System.Collections.Generic.List)); + } + + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo> Create_ListTransformationGrid2D(global::System.Text.Json.JsonSerializerOptions options) + { + if (!TryGetTypeInfoForRuntimeCustomConverter>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo> jsonTypeInfo)) + { + var info = new global::System.Text.Json.Serialization.Metadata.JsonCollectionInfoValues> + { + ObjectCreator = () => new global::System.Collections.Generic.List(), + SerializeHandler = ListTransformationGrid2DSerializeHandler + }; + + jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateListInfo, global::Edgar.Geometry.TransformationGrid2D>(options, info); + jsonTypeInfo.NumberHandling = null; + } + + jsonTypeInfo.OriginatingResolver = this; + return jsonTypeInfo; + } + + // Intentionally not a static method because we create a delegate to it. Invoking delegates to instance + // methods is almost as fast as virtual calls. Static methods need to go through a shuffle thunk. + private void ListTransformationGrid2DSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::System.Collections.Generic.List? value) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + + writer.WriteStartArray(); + + for (int i = 0; i < value.Count; i++) + { + global::System.Text.Json.JsonSerializer.Serialize(writer, value[i], TransformationGrid2D); + } + + writer.WriteEndArray(); + } + } +} diff --git a/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.ListVector2Int.g.cs b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.ListVector2Int.g.cs new file mode 100644 index 00000000..5ea58ec9 --- /dev/null +++ b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.ListVector2Int.g.cs @@ -0,0 +1,61 @@ +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Edgar.NativeAotLib +{ + public partial class LevelDescriptionContext + { + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo>? _ListVector2Int; + + /// + /// Defines the source generated JSON serialization contract metadata for a given type. + /// + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo> ListVector2Int + { + get => _ListVector2Int ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo>)Options.GetTypeInfo(typeof(global::System.Collections.Generic.List)); + } + + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo> Create_ListVector2Int(global::System.Text.Json.JsonSerializerOptions options) + { + if (!TryGetTypeInfoForRuntimeCustomConverter>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo> jsonTypeInfo)) + { + var info = new global::System.Text.Json.Serialization.Metadata.JsonCollectionInfoValues> + { + ObjectCreator = () => new global::System.Collections.Generic.List(), + SerializeHandler = ListVector2IntSerializeHandler + }; + + jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateListInfo, global::Edgar.Geometry.Vector2Int>(options, info); + jsonTypeInfo.NumberHandling = null; + } + + jsonTypeInfo.OriginatingResolver = this; + return jsonTypeInfo; + } + + // Intentionally not a static method because we create a delegate to it. Invoking delegates to instance + // methods is almost as fast as virtual calls. Static methods need to go through a shuffle thunk. + private void ListVector2IntSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::System.Collections.Generic.List? value) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + + writer.WriteStartArray(); + + for (int i = 0; i < value.Count; i++) + { + Vector2IntSerializeHandler(writer, value[i]); + } + + writer.WriteEndArray(); + } + } +} diff --git a/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.ManualDoorModeGrid2D.g.cs b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.ManualDoorModeGrid2D.g.cs new file mode 100644 index 00000000..5121dd47 --- /dev/null +++ b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.ManualDoorModeGrid2D.g.cs @@ -0,0 +1,109 @@ +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Edgar.NativeAotLib +{ + public partial class LevelDescriptionContext + { + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? _ManualDoorModeGrid2D; + + /// + /// Defines the source generated JSON serialization contract metadata for a given type. + /// + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ManualDoorModeGrid2D + { + get => _ManualDoorModeGrid2D ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo)Options.GetTypeInfo(typeof(global::Edgar.GraphBasedGenerator.Grid2D.ManualDoorModeGrid2D)); + } + + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Create_ManualDoorModeGrid2D(global::System.Text.Json.JsonSerializerOptions options) + { + if (!TryGetTypeInfoForRuntimeCustomConverter(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo)) + { + var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues + { + ObjectCreator = () => new global::Edgar.GraphBasedGenerator.Grid2D.ManualDoorModeGrid2D(), + ObjectWithParameterizedConstructorCreator = null, + PropertyMetadataInitializer = _ => ManualDoorModeGrid2DPropInit(options), + ConstructorParameterMetadataInitializer = null, + SerializeHandler = ManualDoorModeGrid2DSerializeHandler + }; + + jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo(options, objectInfo); + jsonTypeInfo.NumberHandling = null; + } + + jsonTypeInfo.OriginatingResolver = this; + return jsonTypeInfo; + } + + private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] ManualDoorModeGrid2DPropInit(global::System.Text.Json.JsonSerializerOptions options) + { + var properties = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[2]; + + var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues> + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.GraphBasedGenerator.Grid2D.ManualDoorModeGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.GraphBasedGenerator.Grid2D.ManualDoorModeGrid2D)obj).Doors, + Setter = static (obj, value) => ((global::Edgar.GraphBasedGenerator.Grid2D.ManualDoorModeGrid2D)obj).Doors = value!, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "Doors", + JsonPropertyName = null + }; + + properties[0] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo>(options, info0); + + var info1 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues> + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.GraphBasedGenerator.Grid2D.ManualDoorModeGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.GraphBasedGenerator.Grid2D.ManualDoorModeGrid2D)obj).DoorLines, + Setter = static (obj, value) => ((global::Edgar.GraphBasedGenerator.Grid2D.ManualDoorModeGrid2D)obj).DoorLines = value!, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "DoorLines", + JsonPropertyName = null + }; + + properties[1] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo>(options, info1); + + return properties; + } + + // Intentionally not a static method because we create a delegate to it. Invoking delegates to instance + // methods is almost as fast as virtual calls. Static methods need to go through a shuffle thunk. + private void ManualDoorModeGrid2DSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Edgar.GraphBasedGenerator.Grid2D.ManualDoorModeGrid2D? value) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + + writer.WriteStartObject(); + + writer.WritePropertyName(PropName_Doors); + ListDoorGrid2DSerializeHandler(writer, ((global::Edgar.GraphBasedGenerator.Grid2D.ManualDoorModeGrid2D)value).Doors); + writer.WritePropertyName(PropName_DoorLines); + ListDoorLineGrid2DSerializeHandler(writer, ((global::Edgar.GraphBasedGenerator.Grid2D.ManualDoorModeGrid2D)value).DoorLines); + + writer.WriteEndObject(); + } + } +} diff --git a/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.NullableRoomTemplateRepeatMode.g.cs b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.NullableRoomTemplateRepeatMode.g.cs new file mode 100644 index 00000000..515fd5e7 --- /dev/null +++ b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.NullableRoomTemplateRepeatMode.g.cs @@ -0,0 +1,35 @@ +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Edgar.NativeAotLib +{ + public partial class LevelDescriptionContext + { + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? _NullableRoomTemplateRepeatMode; + + /// + /// Defines the source generated JSON serialization contract metadata for a given type. + /// + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo NullableRoomTemplateRepeatMode + { + get => _NullableRoomTemplateRepeatMode ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo)Options.GetTypeInfo(typeof(global::Edgar.GraphBasedGenerator.Common.RoomTemplateRepeatMode?)); + } + + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Create_NullableRoomTemplateRepeatMode(global::System.Text.Json.JsonSerializerOptions options) + { + if (!TryGetTypeInfoForRuntimeCustomConverter(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo)) + { + global::System.Text.Json.Serialization.JsonConverter converter = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.GetNullableConverter(options); + jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateValueInfo(options, converter); + } + + jsonTypeInfo.OriginatingResolver = this; + return jsonTypeInfo; + } + } +} diff --git a/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.OrthogonalLineGrid2D.g.cs b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.OrthogonalLineGrid2D.g.cs new file mode 100644 index 00000000..5645ef54 --- /dev/null +++ b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.OrthogonalLineGrid2D.g.cs @@ -0,0 +1,172 @@ +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Edgar.NativeAotLib +{ + public partial class LevelDescriptionContext + { + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? _OrthogonalLineGrid2D; + + /// + /// Defines the source generated JSON serialization contract metadata for a given type. + /// + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo OrthogonalLineGrid2D + { + get => _OrthogonalLineGrid2D ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo)Options.GetTypeInfo(typeof(global::Edgar.Geometry.OrthogonalLineGrid2D)); + } + + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Create_OrthogonalLineGrid2D(global::System.Text.Json.JsonSerializerOptions options) + { + if (!TryGetTypeInfoForRuntimeCustomConverter(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo)) + { + var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues + { + ObjectCreator = null, + ObjectWithParameterizedConstructorCreator = static args => new global::Edgar.Geometry.OrthogonalLineGrid2D((global::Edgar.Geometry.Vector2Int)args[0], (global::Edgar.Geometry.Vector2Int)args[1], (global::Edgar.Geometry.OrthogonalLineGrid2D.Direction)args[2]), + PropertyMetadataInitializer = _ => OrthogonalLineGrid2DPropInit(options), + ConstructorParameterMetadataInitializer = OrthogonalLineGrid2DCtorParamInit, + SerializeHandler = OrthogonalLineGrid2DSerializeHandler + }; + + jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo(options, objectInfo); + jsonTypeInfo.NumberHandling = null; + } + + jsonTypeInfo.OriginatingResolver = this; + return jsonTypeInfo; + } + + private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] OrthogonalLineGrid2DPropInit(global::System.Text.Json.JsonSerializerOptions options) + { + var properties = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[4]; + + var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.Geometry.OrthogonalLineGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.Geometry.OrthogonalLineGrid2D)obj).Length, + Setter = null, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "Length", + JsonPropertyName = null + }; + + properties[0] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info0); + + var info1 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = false, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.Geometry.OrthogonalLineGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.Geometry.OrthogonalLineGrid2D)obj).From, + Setter = null, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "From", + JsonPropertyName = null + }; + + properties[1] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info1); + + var info2 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = false, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.Geometry.OrthogonalLineGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.Geometry.OrthogonalLineGrid2D)obj).To, + Setter = null, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "To", + JsonPropertyName = null + }; + + properties[2] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info2); + + var info3 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = false, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.Geometry.OrthogonalLineGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.Geometry.OrthogonalLineGrid2D)obj).degeneratedDirection, + Setter = null, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "degeneratedDirection", + JsonPropertyName = null + }; + + properties[3] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info3); + + return properties; + } + + // Intentionally not a static method because we create a delegate to it. Invoking delegates to instance + // methods is almost as fast as virtual calls. Static methods need to go through a shuffle thunk. + private void OrthogonalLineGrid2DSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Edgar.Geometry.OrthogonalLineGrid2D value) + { + writer.WriteStartObject(); + + writer.WriteNumber(PropName_Length, ((global::Edgar.Geometry.OrthogonalLineGrid2D)value).Length); + + writer.WriteEndObject(); + } + + private static global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[] OrthogonalLineGrid2DCtorParamInit() + { + var parameters = new global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[3]; + + parameters[0] = new() + { + Name = "from", + ParameterType = typeof(global::Edgar.Geometry.Vector2Int), + Position = 0, + HasDefaultValue = false, + DefaultValue = default(global::Edgar.Geometry.Vector2Int) + }; + + parameters[1] = new() + { + Name = "to", + ParameterType = typeof(global::Edgar.Geometry.Vector2Int), + Position = 1, + HasDefaultValue = false, + DefaultValue = default(global::Edgar.Geometry.Vector2Int) + }; + + parameters[2] = new() + { + Name = "degeneratedDirection", + ParameterType = typeof(global::Edgar.Geometry.OrthogonalLineGrid2D.Direction), + Position = 2, + HasDefaultValue = false, + DefaultValue = default(global::Edgar.Geometry.OrthogonalLineGrid2D.Direction) + }; + + return parameters; + } + } +} diff --git a/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.PassageInt32RoomDescriptionGrid2D.g.cs b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.PassageInt32RoomDescriptionGrid2D.g.cs new file mode 100644 index 00000000..55738a0b --- /dev/null +++ b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.PassageInt32RoomDescriptionGrid2D.g.cs @@ -0,0 +1,132 @@ +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Edgar.NativeAotLib +{ + public partial class LevelDescriptionContext + { + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo.Passage>? _PassageInt32RoomDescriptionGrid2D; + + /// + /// Defines the source generated JSON serialization contract metadata for a given type. + /// + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo.Passage> PassageInt32RoomDescriptionGrid2D + { + get => _PassageInt32RoomDescriptionGrid2D ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo.Passage>)Options.GetTypeInfo(typeof(global::Edgar.GraphBasedGenerator.Common.LevelDescriptionBase.Passage)); + } + + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo.Passage> Create_PassageInt32RoomDescriptionGrid2D(global::System.Text.Json.JsonSerializerOptions options) + { + if (!TryGetTypeInfoForRuntimeCustomConverter.Passage>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo.Passage> jsonTypeInfo)) + { + var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues.Passage> + { + ObjectCreator = null, + ObjectWithParameterizedConstructorCreator = static args => new global::Edgar.GraphBasedGenerator.Common.LevelDescriptionBase.Passage((int)args[0], (int)args[1]), + PropertyMetadataInitializer = _ => PassageInt32RoomDescriptionGrid2DPropInit(options), + ConstructorParameterMetadataInitializer = PassageInt32RoomDescriptionGrid2DCtorParamInit, + SerializeHandler = PassageInt32RoomDescriptionGrid2DSerializeHandler + }; + + jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo.Passage>(options, objectInfo); + jsonTypeInfo.NumberHandling = null; + } + + jsonTypeInfo.OriginatingResolver = this; + return jsonTypeInfo; + } + + private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] PassageInt32RoomDescriptionGrid2DPropInit(global::System.Text.Json.JsonSerializerOptions options) + { + var properties = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[2]; + + var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.GraphBasedGenerator.Common.LevelDescriptionBase.Passage), + Converter = null, + Getter = static obj => ((global::Edgar.GraphBasedGenerator.Common.LevelDescriptionBase.Passage)obj).Room1, + Setter = null, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "Room1", + JsonPropertyName = null + }; + + properties[0] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info0); + + var info1 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.GraphBasedGenerator.Common.LevelDescriptionBase.Passage), + Converter = null, + Getter = static obj => ((global::Edgar.GraphBasedGenerator.Common.LevelDescriptionBase.Passage)obj).Room2, + Setter = null, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "Room2", + JsonPropertyName = null + }; + + properties[1] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info1); + + return properties; + } + + // Intentionally not a static method because we create a delegate to it. Invoking delegates to instance + // methods is almost as fast as virtual calls. Static methods need to go through a shuffle thunk. + private void PassageInt32RoomDescriptionGrid2DSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Edgar.GraphBasedGenerator.Common.LevelDescriptionBase.Passage? value) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + + writer.WriteStartObject(); + + writer.WriteNumber(PropName_Room1, ((global::Edgar.GraphBasedGenerator.Common.LevelDescriptionBase.Passage)value).Room1); + writer.WriteNumber(PropName_Room2, ((global::Edgar.GraphBasedGenerator.Common.LevelDescriptionBase.Passage)value).Room2); + + writer.WriteEndObject(); + } + + private static global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[] PassageInt32RoomDescriptionGrid2DCtorParamInit() + { + var parameters = new global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[2]; + + parameters[0] = new() + { + Name = "room1", + ParameterType = typeof(int), + Position = 0, + HasDefaultValue = false, + DefaultValue = default(int) + }; + + parameters[1] = new() + { + Name = "room2", + ParameterType = typeof(int), + Position = 1, + HasDefaultValue = false, + DefaultValue = default(int) + }; + + return parameters; + } + } +} diff --git a/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.PolygonGrid2D.g.cs b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.PolygonGrid2D.g.cs new file mode 100644 index 00000000..1f69220e --- /dev/null +++ b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.PolygonGrid2D.g.cs @@ -0,0 +1,105 @@ +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Edgar.NativeAotLib +{ + public partial class LevelDescriptionContext + { + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? _PolygonGrid2D; + + /// + /// Defines the source generated JSON serialization contract metadata for a given type. + /// + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo PolygonGrid2D + { + get => _PolygonGrid2D ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo)Options.GetTypeInfo(typeof(global::Edgar.Geometry.PolygonGrid2D)); + } + + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Create_PolygonGrid2D(global::System.Text.Json.JsonSerializerOptions options) + { + if (!TryGetTypeInfoForRuntimeCustomConverter(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo)) + { + var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues + { + ObjectCreator = () => new global::Edgar.Geometry.PolygonGrid2D(), + ObjectWithParameterizedConstructorCreator = null, + PropertyMetadataInitializer = _ => PolygonGrid2DPropInit(options), + ConstructorParameterMetadataInitializer = null, + SerializeHandler = PolygonGrid2DSerializeHandler + }; + + jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo(options, objectInfo); + jsonTypeInfo.NumberHandling = null; + } + + jsonTypeInfo.OriginatingResolver = this; + return jsonTypeInfo; + } + + private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] PolygonGrid2DPropInit(global::System.Text.Json.JsonSerializerOptions options) + { + var properties = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[2]; + + var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.Geometry.PolygonGrid2D), + Converter = null, + Getter = null, + Setter = null, + IgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.Always, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "BoundingRectangle", + JsonPropertyName = null + }; + + properties[0] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info0); + + var info1 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues> + { + IsProperty = false, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.Geometry.PolygonGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.Geometry.PolygonGrid2D)obj).points, + Setter = static (obj, value) => ((global::Edgar.Geometry.PolygonGrid2D)obj).points = value!, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "points", + JsonPropertyName = null + }; + + properties[1] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo>(options, info1); + + return properties; + } + + // Intentionally not a static method because we create a delegate to it. Invoking delegates to instance + // methods is almost as fast as virtual calls. Static methods need to go through a shuffle thunk. + private void PolygonGrid2DSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Edgar.Geometry.PolygonGrid2D? value) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + + writer.WriteStartObject(); + + + writer.WriteEndObject(); + } + } +} diff --git a/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.PropertyNames.g.cs b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.PropertyNames.g.cs new file mode 100644 index 00000000..d7d25adc --- /dev/null +++ b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.PropertyNames.g.cs @@ -0,0 +1,38 @@ +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Edgar.NativeAotLib +{ + public partial class LevelDescriptionContext + { + private static readonly global::System.Text.Json.JsonEncodedText PropName_Length = global::System.Text.Json.JsonEncodedText.Encode("Length"); + private static readonly global::System.Text.Json.JsonEncodedText PropName_Room1 = global::System.Text.Json.JsonEncodedText.Encode("Room1"); + private static readonly global::System.Text.Json.JsonEncodedText PropName_Room2 = global::System.Text.Json.JsonEncodedText.Encode("Room2"); + private static readonly global::System.Text.Json.JsonEncodedText PropName_From = global::System.Text.Json.JsonEncodedText.Encode("From"); + private static readonly global::System.Text.Json.JsonEncodedText PropName_To = global::System.Text.Json.JsonEncodedText.Encode("To"); + private static readonly global::System.Text.Json.JsonEncodedText PropName_Socket = global::System.Text.Json.JsonEncodedText.Encode("Socket"); + private static readonly global::System.Text.Json.JsonEncodedText PropName_Type = global::System.Text.Json.JsonEncodedText.Encode("Type"); + private static readonly global::System.Text.Json.JsonEncodedText PropName_Line = global::System.Text.Json.JsonEncodedText.Encode("Line"); + private static readonly global::System.Text.Json.JsonEncodedText PropName_DoorSocket = global::System.Text.Json.JsonEncodedText.Encode("DoorSocket"); + private static readonly global::System.Text.Json.JsonEncodedText PropName_MinimumRoomDistance = global::System.Text.Json.JsonEncodedText.Encode("MinimumRoomDistance"); + private static readonly global::System.Text.Json.JsonEncodedText PropName_Clusters = global::System.Text.Json.JsonEncodedText.Encode("Clusters"); + private static readonly global::System.Text.Json.JsonEncodedText PropName_Constraints = global::System.Text.Json.JsonEncodedText.Encode("Constraints"); + private static readonly global::System.Text.Json.JsonEncodedText PropName_RoomTemplateRepeatModeDefault = global::System.Text.Json.JsonEncodedText.Encode("RoomTemplateRepeatModeDefault"); + private static readonly global::System.Text.Json.JsonEncodedText PropName_RoomTemplateRepeatModeOverride = global::System.Text.Json.JsonEncodedText.Encode("RoomTemplateRepeatModeOverride"); + private static readonly global::System.Text.Json.JsonEncodedText PropName_Name = global::System.Text.Json.JsonEncodedText.Encode("Name"); + private static readonly global::System.Text.Json.JsonEncodedText PropName_Doors = global::System.Text.Json.JsonEncodedText.Encode("Doors"); + private static readonly global::System.Text.Json.JsonEncodedText PropName_DoorLines = global::System.Text.Json.JsonEncodedText.Encode("DoorLines"); + private static readonly global::System.Text.Json.JsonEncodedText PropName_IsCorridor = global::System.Text.Json.JsonEncodedText.Encode("IsCorridor"); + private static readonly global::System.Text.Json.JsonEncodedText PropName_RoomTemplates = global::System.Text.Json.JsonEncodedText.Encode("RoomTemplates"); + private static readonly global::System.Text.Json.JsonEncodedText PropName_Outline = global::System.Text.Json.JsonEncodedText.Encode("Outline"); + private static readonly global::System.Text.Json.JsonEncodedText PropName_RepeatMode = global::System.Text.Json.JsonEncodedText.Encode("RepeatMode"); + private static readonly global::System.Text.Json.JsonEncodedText PropName_AllowedTransformations = global::System.Text.Json.JsonEncodedText.Encode("AllowedTransformations"); + private static readonly global::System.Text.Json.JsonEncodedText PropName_DoorLength = global::System.Text.Json.JsonEncodedText.Encode("DoorLength"); + private static readonly global::System.Text.Json.JsonEncodedText PropName_CornerDistance = global::System.Text.Json.JsonEncodedText.Encode("CornerDistance"); + } +} diff --git a/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.RectangleGrid2D.g.cs b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.RectangleGrid2D.g.cs new file mode 100644 index 00000000..7c2b71dc --- /dev/null +++ b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.RectangleGrid2D.g.cs @@ -0,0 +1,205 @@ +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Edgar.NativeAotLib +{ + public partial class LevelDescriptionContext + { + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? _RectangleGrid2D; + + /// + /// Defines the source generated JSON serialization contract metadata for a given type. + /// + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo RectangleGrid2D + { + get => _RectangleGrid2D ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo)Options.GetTypeInfo(typeof(global::Edgar.Geometry.RectangleGrid2D)); + } + + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Create_RectangleGrid2D(global::System.Text.Json.JsonSerializerOptions options) + { + if (!TryGetTypeInfoForRuntimeCustomConverter(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo)) + { + var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues + { + ObjectCreator = null, + ObjectWithParameterizedConstructorCreator = static args => new global::Edgar.Geometry.RectangleGrid2D((global::Edgar.Geometry.Vector2Int)args[0], (global::Edgar.Geometry.Vector2Int)args[1]), + PropertyMetadataInitializer = _ => RectangleGrid2DPropInit(options), + ConstructorParameterMetadataInitializer = RectangleGrid2DCtorParamInit, + SerializeHandler = RectangleGrid2DSerializeHandler + }; + + jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo(options, objectInfo); + jsonTypeInfo.NumberHandling = null; + } + + jsonTypeInfo.OriginatingResolver = this; + return jsonTypeInfo; + } + + private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] RectangleGrid2DPropInit(global::System.Text.Json.JsonSerializerOptions options) + { + var properties = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[6]; + + var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.Geometry.RectangleGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.Geometry.RectangleGrid2D)obj).Center, + Setter = null, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "Center", + JsonPropertyName = null + }; + + properties[0] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info0); + + var info1 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.Geometry.RectangleGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.Geometry.RectangleGrid2D)obj).Area, + Setter = null, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "Area", + JsonPropertyName = null + }; + + properties[1] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info1); + + var info2 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.Geometry.RectangleGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.Geometry.RectangleGrid2D)obj).Width, + Setter = null, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "Width", + JsonPropertyName = null + }; + + properties[2] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info2); + + var info3 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.Geometry.RectangleGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.Geometry.RectangleGrid2D)obj).Height, + Setter = null, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "Height", + JsonPropertyName = null + }; + + properties[3] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info3); + + var info4 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = false, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.Geometry.RectangleGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.Geometry.RectangleGrid2D)obj).A, + Setter = null, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "A", + JsonPropertyName = null + }; + + properties[4] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info4); + + var info5 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = false, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.Geometry.RectangleGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.Geometry.RectangleGrid2D)obj).B, + Setter = null, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "B", + JsonPropertyName = null + }; + + properties[5] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info5); + + return properties; + } + + // Intentionally not a static method because we create a delegate to it. Invoking delegates to instance + // methods is almost as fast as virtual calls. Static methods need to go through a shuffle thunk. + private void RectangleGrid2DSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Edgar.Geometry.RectangleGrid2D value) + { + writer.WriteStartObject(); + + writer.WritePropertyName(PropName_Center); + Vector2IntSerializeHandler(writer, ((global::Edgar.Geometry.RectangleGrid2D)value).Center); + writer.WriteNumber(PropName_Area, ((global::Edgar.Geometry.RectangleGrid2D)value).Area); + writer.WriteNumber(PropName_Width, ((global::Edgar.Geometry.RectangleGrid2D)value).Width); + writer.WriteNumber(PropName_Height, ((global::Edgar.Geometry.RectangleGrid2D)value).Height); + + writer.WriteEndObject(); + } + + private static global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[] RectangleGrid2DCtorParamInit() + { + var parameters = new global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[2]; + + parameters[0] = new() + { + Name = "a", + ParameterType = typeof(global::Edgar.Geometry.Vector2Int), + Position = 0, + HasDefaultValue = false, + DefaultValue = default(global::Edgar.Geometry.Vector2Int) + }; + + parameters[1] = new() + { + Name = "b", + ParameterType = typeof(global::Edgar.Geometry.Vector2Int), + Position = 1, + HasDefaultValue = false, + DefaultValue = default(global::Edgar.Geometry.Vector2Int) + }; + + return parameters; + } + } +} diff --git a/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.RoomDescriptionGrid2D.g.cs b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.RoomDescriptionGrid2D.g.cs new file mode 100644 index 00000000..392c4b7f --- /dev/null +++ b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.RoomDescriptionGrid2D.g.cs @@ -0,0 +1,108 @@ +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Edgar.NativeAotLib +{ + public partial class LevelDescriptionContext + { + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? _RoomDescriptionGrid2D; + + /// + /// Defines the source generated JSON serialization contract metadata for a given type. + /// + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo RoomDescriptionGrid2D + { + get => _RoomDescriptionGrid2D ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo)Options.GetTypeInfo(typeof(global::Edgar.GraphBasedGenerator.Grid2D.RoomDescriptionGrid2D)); + } + + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Create_RoomDescriptionGrid2D(global::System.Text.Json.JsonSerializerOptions options) + { + if (!TryGetTypeInfoForRuntimeCustomConverter(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo)) + { + var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues + { + ObjectCreator = () => new global::Edgar.GraphBasedGenerator.Grid2D.RoomDescriptionGrid2D(), + ObjectWithParameterizedConstructorCreator = null, + PropertyMetadataInitializer = _ => RoomDescriptionGrid2DPropInit(options), + ConstructorParameterMetadataInitializer = null, + SerializeHandler = RoomDescriptionGrid2DSerializeHandler + }; + + jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo(options, objectInfo); + jsonTypeInfo.NumberHandling = null; + } + + jsonTypeInfo.OriginatingResolver = this; + return jsonTypeInfo; + } + + private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] RoomDescriptionGrid2DPropInit(global::System.Text.Json.JsonSerializerOptions options) + { + var properties = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[2]; + + var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.GraphBasedGenerator.Grid2D.RoomDescriptionGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.GraphBasedGenerator.Grid2D.RoomDescriptionGrid2D)obj).IsCorridor, + Setter = static (obj, value) => ((global::Edgar.GraphBasedGenerator.Grid2D.RoomDescriptionGrid2D)obj).IsCorridor = value!, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "IsCorridor", + JsonPropertyName = null + }; + + properties[0] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info0); + + var info1 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues> + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.GraphBasedGenerator.Grid2D.RoomDescriptionGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.GraphBasedGenerator.Grid2D.RoomDescriptionGrid2D)obj).RoomTemplates, + Setter = static (obj, value) => ((global::Edgar.GraphBasedGenerator.Grid2D.RoomDescriptionGrid2D)obj).RoomTemplates = value!, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "RoomTemplates", + JsonPropertyName = null + }; + + properties[1] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo>(options, info1); + + return properties; + } + + // Intentionally not a static method because we create a delegate to it. Invoking delegates to instance + // methods is almost as fast as virtual calls. Static methods need to go through a shuffle thunk. + private void RoomDescriptionGrid2DSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Edgar.GraphBasedGenerator.Grid2D.RoomDescriptionGrid2D? value) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + + writer.WriteStartObject(); + + writer.WriteBoolean(PropName_IsCorridor, ((global::Edgar.GraphBasedGenerator.Grid2D.RoomDescriptionGrid2D)value).IsCorridor); + writer.WritePropertyName(PropName_RoomTemplates); + ListRoomTemplateGrid2DSerializeHandler(writer, ((global::Edgar.GraphBasedGenerator.Grid2D.RoomDescriptionGrid2D)value).RoomTemplates); + + writer.WriteEndObject(); + } + } +} diff --git a/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.RoomTemplateGrid2D.g.cs b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.RoomTemplateGrid2D.g.cs new file mode 100644 index 00000000..c2f8d9a2 --- /dev/null +++ b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.RoomTemplateGrid2D.g.cs @@ -0,0 +1,171 @@ +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Edgar.NativeAotLib +{ + public partial class LevelDescriptionContext + { + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? _RoomTemplateGrid2D; + + /// + /// Defines the source generated JSON serialization contract metadata for a given type. + /// + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo RoomTemplateGrid2D + { + get => _RoomTemplateGrid2D ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo)Options.GetTypeInfo(typeof(global::Edgar.GraphBasedGenerator.Grid2D.RoomTemplateGrid2D)); + } + + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Create_RoomTemplateGrid2D(global::System.Text.Json.JsonSerializerOptions options) + { + if (!TryGetTypeInfoForRuntimeCustomConverter(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo)) + { + var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues + { + ObjectCreator = () => new global::Edgar.GraphBasedGenerator.Grid2D.RoomTemplateGrid2D(), + ObjectWithParameterizedConstructorCreator = null, + PropertyMetadataInitializer = _ => RoomTemplateGrid2DPropInit(options), + ConstructorParameterMetadataInitializer = null, + SerializeHandler = RoomTemplateGrid2DSerializeHandler + }; + + jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo(options, objectInfo); + jsonTypeInfo.NumberHandling = null; + } + + jsonTypeInfo.OriginatingResolver = this; + return jsonTypeInfo; + } + + private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] RoomTemplateGrid2DPropInit(global::System.Text.Json.JsonSerializerOptions options) + { + var properties = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[5]; + + var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.GraphBasedGenerator.Grid2D.RoomTemplateGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.GraphBasedGenerator.Grid2D.RoomTemplateGrid2D)obj).Name, + Setter = static (obj, value) => ((global::Edgar.GraphBasedGenerator.Grid2D.RoomTemplateGrid2D)obj).Name = value!, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "Name", + JsonPropertyName = null + }; + + properties[0] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info0); + + var info1 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.GraphBasedGenerator.Grid2D.RoomTemplateGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.GraphBasedGenerator.Grid2D.RoomTemplateGrid2D)obj).Outline, + Setter = static (obj, value) => ((global::Edgar.GraphBasedGenerator.Grid2D.RoomTemplateGrid2D)obj).Outline = value!, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "Outline", + JsonPropertyName = null + }; + + properties[1] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info1); + + var info2 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.GraphBasedGenerator.Grid2D.RoomTemplateGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.GraphBasedGenerator.Grid2D.RoomTemplateGrid2D)obj).Doors, + Setter = static (obj, value) => ((global::Edgar.GraphBasedGenerator.Grid2D.RoomTemplateGrid2D)obj).Doors = value!, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "Doors", + JsonPropertyName = null + }; + + properties[2] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info2); + + var info3 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.GraphBasedGenerator.Grid2D.RoomTemplateGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.GraphBasedGenerator.Grid2D.RoomTemplateGrid2D)obj).RepeatMode, + Setter = static (obj, value) => ((global::Edgar.GraphBasedGenerator.Grid2D.RoomTemplateGrid2D)obj).RepeatMode = value!, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "RepeatMode", + JsonPropertyName = null + }; + + properties[3] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info3); + + var info4 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues> + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.GraphBasedGenerator.Grid2D.RoomTemplateGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.GraphBasedGenerator.Grid2D.RoomTemplateGrid2D)obj).AllowedTransformations, + Setter = static (obj, value) => ((global::Edgar.GraphBasedGenerator.Grid2D.RoomTemplateGrid2D)obj).AllowedTransformations = value!, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "AllowedTransformations", + JsonPropertyName = null + }; + + properties[4] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo>(options, info4); + + return properties; + } + + // Intentionally not a static method because we create a delegate to it. Invoking delegates to instance + // methods is almost as fast as virtual calls. Static methods need to go through a shuffle thunk. + private void RoomTemplateGrid2DSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Edgar.GraphBasedGenerator.Grid2D.RoomTemplateGrid2D? value) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + + writer.WriteStartObject(); + + writer.WriteString(PropName_Name, ((global::Edgar.GraphBasedGenerator.Grid2D.RoomTemplateGrid2D)value).Name); + writer.WritePropertyName(PropName_Outline); + PolygonGrid2DSerializeHandler(writer, ((global::Edgar.GraphBasedGenerator.Grid2D.RoomTemplateGrid2D)value).Outline); + writer.WritePropertyName(PropName_Doors); + global::System.Text.Json.JsonSerializer.Serialize(writer, ((global::Edgar.GraphBasedGenerator.Grid2D.RoomTemplateGrid2D)value).Doors, IDoorModeGrid2D); + writer.WritePropertyName(PropName_RepeatMode); + global::System.Text.Json.JsonSerializer.Serialize(writer, ((global::Edgar.GraphBasedGenerator.Grid2D.RoomTemplateGrid2D)value).RepeatMode, NullableRoomTemplateRepeatMode); + writer.WritePropertyName(PropName_AllowedTransformations); + ListTransformationGrid2DSerializeHandler(writer, ((global::Edgar.GraphBasedGenerator.Grid2D.RoomTemplateGrid2D)value).AllowedTransformations); + + writer.WriteEndObject(); + } + } +} diff --git a/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.RoomTemplateRepeatMode.g.cs b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.RoomTemplateRepeatMode.g.cs new file mode 100644 index 00000000..deae1a35 --- /dev/null +++ b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.RoomTemplateRepeatMode.g.cs @@ -0,0 +1,34 @@ +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Edgar.NativeAotLib +{ + public partial class LevelDescriptionContext + { + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? _RoomTemplateRepeatMode; + + /// + /// Defines the source generated JSON serialization contract metadata for a given type. + /// + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo RoomTemplateRepeatMode + { + get => _RoomTemplateRepeatMode ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo)Options.GetTypeInfo(typeof(global::Edgar.GraphBasedGenerator.Common.RoomTemplateRepeatMode)); + } + + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Create_RoomTemplateRepeatMode(global::System.Text.Json.JsonSerializerOptions options) + { + if (!TryGetTypeInfoForRuntimeCustomConverter(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo)) + { + jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateValueInfo(options, global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.GetEnumConverter(options)); + } + + jsonTypeInfo.OriginatingResolver = this; + return jsonTypeInfo; + } + } +} diff --git a/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.SimpleDoorModeGrid2D.g.cs b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.SimpleDoorModeGrid2D.g.cs new file mode 100644 index 00000000..fcc6a6d0 --- /dev/null +++ b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.SimpleDoorModeGrid2D.g.cs @@ -0,0 +1,162 @@ +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Edgar.NativeAotLib +{ + public partial class LevelDescriptionContext + { + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? _SimpleDoorModeGrid2D; + + /// + /// Defines the source generated JSON serialization contract metadata for a given type. + /// + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo SimpleDoorModeGrid2D + { + get => _SimpleDoorModeGrid2D ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo)Options.GetTypeInfo(typeof(global::Edgar.GraphBasedGenerator.Grid2D.SimpleDoorModeGrid2D)); + } + + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Create_SimpleDoorModeGrid2D(global::System.Text.Json.JsonSerializerOptions options) + { + if (!TryGetTypeInfoForRuntimeCustomConverter(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo)) + { + var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues + { + ObjectCreator = null, + ObjectWithParameterizedConstructorCreator = static args => new global::Edgar.GraphBasedGenerator.Grid2D.SimpleDoorModeGrid2D((int)args[0], (int)args[1], (global::Edgar.GraphBasedGenerator.Common.Doors.IDoorSocket)args[2]), + PropertyMetadataInitializer = _ => SimpleDoorModeGrid2DPropInit(options), + ConstructorParameterMetadataInitializer = SimpleDoorModeGrid2DCtorParamInit, + SerializeHandler = SimpleDoorModeGrid2DSerializeHandler + }; + + jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo(options, objectInfo); + jsonTypeInfo.NumberHandling = null; + } + + jsonTypeInfo.OriginatingResolver = this; + return jsonTypeInfo; + } + + private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] SimpleDoorModeGrid2DPropInit(global::System.Text.Json.JsonSerializerOptions options) + { + var properties = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[3]; + + var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.GraphBasedGenerator.Grid2D.SimpleDoorModeGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.GraphBasedGenerator.Grid2D.SimpleDoorModeGrid2D)obj).DoorLength, + Setter = null, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "DoorLength", + JsonPropertyName = null + }; + + properties[0] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info0); + + var info1 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.GraphBasedGenerator.Grid2D.SimpleDoorModeGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.GraphBasedGenerator.Grid2D.SimpleDoorModeGrid2D)obj).CornerDistance, + Setter = null, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "CornerDistance", + JsonPropertyName = null + }; + + properties[1] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info1); + + var info2 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = true, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.GraphBasedGenerator.Grid2D.SimpleDoorModeGrid2D), + Converter = null, + Getter = static obj => ((global::Edgar.GraphBasedGenerator.Grid2D.SimpleDoorModeGrid2D)obj).DoorSocket, + Setter = null, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "DoorSocket", + JsonPropertyName = null + }; + + properties[2] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info2); + + return properties; + } + + // Intentionally not a static method because we create a delegate to it. Invoking delegates to instance + // methods is almost as fast as virtual calls. Static methods need to go through a shuffle thunk. + private void SimpleDoorModeGrid2DSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Edgar.GraphBasedGenerator.Grid2D.SimpleDoorModeGrid2D? value) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + + writer.WriteStartObject(); + + writer.WriteNumber(PropName_DoorLength, ((global::Edgar.GraphBasedGenerator.Grid2D.SimpleDoorModeGrid2D)value).DoorLength); + writer.WriteNumber(PropName_CornerDistance, ((global::Edgar.GraphBasedGenerator.Grid2D.SimpleDoorModeGrid2D)value).CornerDistance); + writer.WritePropertyName(PropName_DoorSocket); + IDoorSocketSerializeHandler(writer, ((global::Edgar.GraphBasedGenerator.Grid2D.SimpleDoorModeGrid2D)value).DoorSocket); + + writer.WriteEndObject(); + } + + private static global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[] SimpleDoorModeGrid2DCtorParamInit() + { + var parameters = new global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[3]; + + parameters[0] = new() + { + Name = "doorLength", + ParameterType = typeof(int), + Position = 0, + HasDefaultValue = false, + DefaultValue = default(int) + }; + + parameters[1] = new() + { + Name = "cornerDistance", + ParameterType = typeof(int), + Position = 1, + HasDefaultValue = false, + DefaultValue = default(int) + }; + + parameters[2] = new() + { + Name = "doorSocket", + ParameterType = typeof(global::Edgar.GraphBasedGenerator.Common.Doors.IDoorSocket), + Position = 2, + HasDefaultValue = true, + DefaultValue = default(global::Edgar.GraphBasedGenerator.Common.Doors.IDoorSocket) + }; + + return parameters; + } + } +} diff --git a/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.String.g.cs b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.String.g.cs new file mode 100644 index 00000000..87f2ad74 --- /dev/null +++ b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.String.g.cs @@ -0,0 +1,34 @@ +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Edgar.NativeAotLib +{ + public partial class LevelDescriptionContext + { + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? _String; + + /// + /// Defines the source generated JSON serialization contract metadata for a given type. + /// + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo String + { + get => _String ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo)Options.GetTypeInfo(typeof(string)); + } + + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Create_String(global::System.Text.Json.JsonSerializerOptions options) + { + if (!TryGetTypeInfoForRuntimeCustomConverter(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo)) + { + jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateValueInfo(options, global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.StringConverter); + } + + jsonTypeInfo.OriginatingResolver = this; + return jsonTypeInfo; + } + } +} diff --git a/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.TransformationGrid2D.g.cs b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.TransformationGrid2D.g.cs new file mode 100644 index 00000000..60dc9307 --- /dev/null +++ b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.TransformationGrid2D.g.cs @@ -0,0 +1,34 @@ +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Edgar.NativeAotLib +{ + public partial class LevelDescriptionContext + { + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? _TransformationGrid2D; + + /// + /// Defines the source generated JSON serialization contract metadata for a given type. + /// + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo TransformationGrid2D + { + get => _TransformationGrid2D ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo)Options.GetTypeInfo(typeof(global::Edgar.Geometry.TransformationGrid2D)); + } + + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Create_TransformationGrid2D(global::System.Text.Json.JsonSerializerOptions options) + { + if (!TryGetTypeInfoForRuntimeCustomConverter(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo)) + { + jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateValueInfo(options, global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.GetEnumConverter(options)); + } + + jsonTypeInfo.OriginatingResolver = this; + return jsonTypeInfo; + } + } +} diff --git a/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.Vector2Int.g.cs b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.Vector2Int.g.cs new file mode 100644 index 00000000..36b0ae0c --- /dev/null +++ b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.Vector2Int.g.cs @@ -0,0 +1,124 @@ +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Edgar.NativeAotLib +{ + public partial class LevelDescriptionContext + { + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? _Vector2Int; + + /// + /// Defines the source generated JSON serialization contract metadata for a given type. + /// + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Vector2Int + { + get => _Vector2Int ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo)Options.GetTypeInfo(typeof(global::Edgar.Geometry.Vector2Int)); + } + + private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Create_Vector2Int(global::System.Text.Json.JsonSerializerOptions options) + { + if (!TryGetTypeInfoForRuntimeCustomConverter(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo)) + { + var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues + { + ObjectCreator = null, + ObjectWithParameterizedConstructorCreator = static args => new global::Edgar.Geometry.Vector2Int((int)args[0], (int)args[1]), + PropertyMetadataInitializer = _ => Vector2IntPropInit(options), + ConstructorParameterMetadataInitializer = Vector2IntCtorParamInit, + SerializeHandler = Vector2IntSerializeHandler + }; + + jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo(options, objectInfo); + jsonTypeInfo.NumberHandling = null; + } + + jsonTypeInfo.OriginatingResolver = this; + return jsonTypeInfo; + } + + private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] Vector2IntPropInit(global::System.Text.Json.JsonSerializerOptions options) + { + var properties = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[2]; + + var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = false, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.Geometry.Vector2Int), + Converter = null, + Getter = static obj => ((global::Edgar.Geometry.Vector2Int)obj).X, + Setter = null, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "X", + JsonPropertyName = null + }; + + properties[0] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info0); + + var info1 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues + { + IsProperty = false, + IsPublic = true, + IsVirtual = false, + DeclaringType = typeof(global::Edgar.Geometry.Vector2Int), + Converter = null, + Getter = static obj => ((global::Edgar.Geometry.Vector2Int)obj).Y, + Setter = null, + IgnoreCondition = null, + HasJsonInclude = false, + IsExtensionData = false, + NumberHandling = null, + PropertyName = "Y", + JsonPropertyName = null + }; + + properties[1] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info1); + + return properties; + } + + // Intentionally not a static method because we create a delegate to it. Invoking delegates to instance + // methods is almost as fast as virtual calls. Static methods need to go through a shuffle thunk. + private void Vector2IntSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Edgar.Geometry.Vector2Int value) + { + writer.WriteStartObject(); + + + writer.WriteEndObject(); + } + + private static global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[] Vector2IntCtorParamInit() + { + var parameters = new global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[2]; + + parameters[0] = new() + { + Name = "x", + ParameterType = typeof(int), + Position = 0, + HasDefaultValue = false, + DefaultValue = default(int) + }; + + parameters[1] = new() + { + Name = "y", + ParameterType = typeof(int), + Position = 1, + HasDefaultValue = false, + DefaultValue = default(int) + }; + + return parameters; + } + } +} diff --git a/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.g.cs b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.g.cs new file mode 100644 index 00000000..0d1a151d --- /dev/null +++ b/Edgar.NativeAotLib/GeneratedFiles/System.Text.Json.SourceGeneration/System.Text.Json.SourceGeneration.JsonSourceGenerator/LevelDescriptionContext.g.cs @@ -0,0 +1,85 @@ +// + +#nullable enable annotations +#nullable disable warnings + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0612, CS0618 + +namespace Edgar.NativeAotLib +{ + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Text.Json.SourceGeneration", "8.0.9.3103")] + public partial class LevelDescriptionContext + { + private readonly static global::System.Text.Json.JsonSerializerOptions s_defaultOptions = new() + { + WriteIndented = true, + }; + + /// + /// The default associated with a default instance. + /// + public static global::Edgar.NativeAotLib.LevelDescriptionContext Default { get; } = new global::Edgar.NativeAotLib.LevelDescriptionContext(new global::System.Text.Json.JsonSerializerOptions(s_defaultOptions)); + + /// + /// The source-generated options associated with this context. + /// + protected override global::System.Text.Json.JsonSerializerOptions? GeneratedSerializerOptions { get; } = s_defaultOptions; + + /// + public LevelDescriptionContext() : base(null) + { + } + + /// + public LevelDescriptionContext(global::System.Text.Json.JsonSerializerOptions options) : base(options) + { + } + + private static bool TryGetTypeInfoForRuntimeCustomConverter(global::System.Text.Json.JsonSerializerOptions options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo) + { + global::System.Text.Json.Serialization.JsonConverter? converter = GetRuntimeConverterForType(typeof(TJsonMetadataType), options); + if (converter != null) + { + jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateValueInfo(options, converter); + return true; + } + + jsonTypeInfo = null; + return false; + } + + private static global::System.Text.Json.Serialization.JsonConverter? GetRuntimeConverterForType(global::System.Type type, global::System.Text.Json.JsonSerializerOptions options) + { + for (int i = 0; i < options.Converters.Count; i++) + { + global::System.Text.Json.Serialization.JsonConverter? converter = options.Converters[i]; + if (converter?.CanConvert(type) == true) + { + return ExpandConverter(type, converter, options, validateCanConvert: false); + } + } + + return null; + } + + private static global::System.Text.Json.Serialization.JsonConverter ExpandConverter(global::System.Type type, global::System.Text.Json.Serialization.JsonConverter converter, global::System.Text.Json.JsonSerializerOptions options, bool validateCanConvert = true) + { + if (validateCanConvert && !converter.CanConvert(type)) + { + throw new global::System.InvalidOperationException(string.Format("The converter '{0}' is not compatible with the type '{1}'.", converter.GetType(), type)); + } + + if (converter is global::System.Text.Json.Serialization.JsonConverterFactory factory) + { + converter = factory.CreateConverter(type, options); + if (converter is null || converter is global::System.Text.Json.Serialization.JsonConverterFactory) + { + throw new global::System.InvalidOperationException(string.Format("The converter '{0}' cannot return null or a JsonConverterFactory instance.", factory.GetType())); + } + } + + return converter; + } + } +} diff --git a/Edgar.NativeAotLib/SystemTextJsonUtils.cs b/Edgar.NativeAotLib/SystemTextJsonUtils.cs new file mode 100644 index 00000000..7c12406a --- /dev/null +++ b/Edgar.NativeAotLib/SystemTextJsonUtils.cs @@ -0,0 +1,67 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Edgar.GraphBasedGenerator.Grid2D; + +namespace Edgar.NativeAotLib +{ + public static class SystemTextJsonUtils + { + public static string SerializeToJson(LevelDescriptionGrid2D levelDescription) + { + var options = new JsonSerializerOptions() + { + ReferenceHandler = ReferenceHandler.Preserve, + WriteIndented = true, + TypeInfoResolver = LevelDescriptionContext.Default, + IncludeFields = true, + }; + + var json = JsonSerializer.Serialize(levelDescription, options); + + return json; + } + + public static string SerializeToJson(LayoutGrid2D layout) + { + var options = new JsonSerializerOptions() + { + ReferenceHandler = null, + WriteIndented = true, + TypeInfoResolver = LayoutContext.Default, + IncludeFields = true, + }; + + var json = JsonSerializer.Serialize(layout, options); + + return json; + } + + public static LevelDescriptionGrid2D DeserializeFromJson(string json) + { + var options = new JsonSerializerOptions() + { + ReferenceHandler = ReferenceHandler.Preserve, + WriteIndented = true, + TypeInfoResolver = LevelDescriptionContext.Default, + IncludeFields = true, + }; + + var levelDescription = JsonSerializer.Deserialize>(json, options); + + return levelDescription; + } + } + + [JsonSourceGenerationOptions(WriteIndented = true)] + [JsonSerializable(typeof(LevelDescriptionGrid2D))] + public partial class LevelDescriptionContext : JsonSerializerContext { + + } + + [JsonSourceGenerationOptions(WriteIndented = true)] + [JsonSerializable(typeof(LayoutGrid2D))] + public partial class LayoutContext : JsonSerializerContext + { + + } +} \ No newline at end of file diff --git a/EdgarDotNet.sln b/EdgarDotNet.sln index 92c34a5c..c517269c 100644 --- a/EdgarDotNet.sln +++ b/EdgarDotNet.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.29409.12 +# Visual Studio Version 17 +VisualStudioVersion = 17.7.34221.43 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Edgar", "src\Edgar\Edgar.csproj", "{8538B30D-B0C5-4BB8-8FA9-C9388E0758E7}" EndProject @@ -27,9 +27,15 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Edgar.UnityBuild", "src\Edg EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Legacy", "Legacy", "{7844F9A9-0452-4BC3-AA99-9BCFF7BC0BF6}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Edgar.Extras", "src\Edgar.Extras\Edgar.Extras.csproj", "{A1A78BBB-5016-4231-9D64-DF95C04B249D}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Edgar.Extras", "src\Edgar.Extras\Edgar.Extras.csproj", "{A1A78BBB-5016-4231-9D64-DF95C04B249D}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Edgar.ConsoleApp", "src\Edgar.ConsoleApp\Edgar.ConsoleApp.csproj", "{E0606725-84E7-49E3-8254-E50E36AEB3CE}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Edgar.ConsoleApp", "src\Edgar.ConsoleApp\Edgar.ConsoleApp.csproj", "{E0606725-84E7-49E3-8254-E50E36AEB3CE}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Edgar.NativeAot", "Edgar.NativeAot\Edgar.NativeAot.csproj", "{E226EFED-44B6-433A-8E57-F0497E43D3B6}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Edgar.NativeAotLib", "Edgar.NativeAotLib\Edgar.NativeAotLib.csproj", "{17C5CF6A-6F07-4AE3-A49D-290EE905162E}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Edgar.NativeAotHelpers", "Edgar.NativeAotHelpers\Edgar.NativeAotHelpers.csproj", "{65B4FBFA-01B3-43DB-A959-D4A03B30E4BE}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -185,6 +191,42 @@ Global {E0606725-84E7-49E3-8254-E50E36AEB3CE}.Release|x64.Build.0 = Release|Any CPU {E0606725-84E7-49E3-8254-E50E36AEB3CE}.Release|x86.ActiveCfg = Release|Any CPU {E0606725-84E7-49E3-8254-E50E36AEB3CE}.Release|x86.Build.0 = Release|Any CPU + {E226EFED-44B6-433A-8E57-F0497E43D3B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E226EFED-44B6-433A-8E57-F0497E43D3B6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E226EFED-44B6-433A-8E57-F0497E43D3B6}.Debug|x64.ActiveCfg = Debug|Any CPU + {E226EFED-44B6-433A-8E57-F0497E43D3B6}.Debug|x64.Build.0 = Debug|Any CPU + {E226EFED-44B6-433A-8E57-F0497E43D3B6}.Debug|x86.ActiveCfg = Debug|Any CPU + {E226EFED-44B6-433A-8E57-F0497E43D3B6}.Debug|x86.Build.0 = Debug|Any CPU + {E226EFED-44B6-433A-8E57-F0497E43D3B6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E226EFED-44B6-433A-8E57-F0497E43D3B6}.Release|Any CPU.Build.0 = Release|Any CPU + {E226EFED-44B6-433A-8E57-F0497E43D3B6}.Release|x64.ActiveCfg = Release|Any CPU + {E226EFED-44B6-433A-8E57-F0497E43D3B6}.Release|x64.Build.0 = Release|Any CPU + {E226EFED-44B6-433A-8E57-F0497E43D3B6}.Release|x86.ActiveCfg = Release|Any CPU + {E226EFED-44B6-433A-8E57-F0497E43D3B6}.Release|x86.Build.0 = Release|Any CPU + {17C5CF6A-6F07-4AE3-A49D-290EE905162E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {17C5CF6A-6F07-4AE3-A49D-290EE905162E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {17C5CF6A-6F07-4AE3-A49D-290EE905162E}.Debug|x64.ActiveCfg = Debug|Any CPU + {17C5CF6A-6F07-4AE3-A49D-290EE905162E}.Debug|x64.Build.0 = Debug|Any CPU + {17C5CF6A-6F07-4AE3-A49D-290EE905162E}.Debug|x86.ActiveCfg = Debug|Any CPU + {17C5CF6A-6F07-4AE3-A49D-290EE905162E}.Debug|x86.Build.0 = Debug|Any CPU + {17C5CF6A-6F07-4AE3-A49D-290EE905162E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {17C5CF6A-6F07-4AE3-A49D-290EE905162E}.Release|Any CPU.Build.0 = Release|Any CPU + {17C5CF6A-6F07-4AE3-A49D-290EE905162E}.Release|x64.ActiveCfg = Release|Any CPU + {17C5CF6A-6F07-4AE3-A49D-290EE905162E}.Release|x64.Build.0 = Release|Any CPU + {17C5CF6A-6F07-4AE3-A49D-290EE905162E}.Release|x86.ActiveCfg = Release|Any CPU + {17C5CF6A-6F07-4AE3-A49D-290EE905162E}.Release|x86.Build.0 = Release|Any CPU + {65B4FBFA-01B3-43DB-A959-D4A03B30E4BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {65B4FBFA-01B3-43DB-A959-D4A03B30E4BE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {65B4FBFA-01B3-43DB-A959-D4A03B30E4BE}.Debug|x64.ActiveCfg = Debug|Any CPU + {65B4FBFA-01B3-43DB-A959-D4A03B30E4BE}.Debug|x64.Build.0 = Debug|Any CPU + {65B4FBFA-01B3-43DB-A959-D4A03B30E4BE}.Debug|x86.ActiveCfg = Debug|Any CPU + {65B4FBFA-01B3-43DB-A959-D4A03B30E4BE}.Debug|x86.Build.0 = Debug|Any CPU + {65B4FBFA-01B3-43DB-A959-D4A03B30E4BE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {65B4FBFA-01B3-43DB-A959-D4A03B30E4BE}.Release|Any CPU.Build.0 = Release|Any CPU + {65B4FBFA-01B3-43DB-A959-D4A03B30E4BE}.Release|x64.ActiveCfg = Release|Any CPU + {65B4FBFA-01B3-43DB-A959-D4A03B30E4BE}.Release|x64.Build.0 = Release|Any CPU + {65B4FBFA-01B3-43DB-A959-D4A03B30E4BE}.Release|x86.ActiveCfg = Release|Any CPU + {65B4FBFA-01B3-43DB-A959-D4A03B30E4BE}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/Edgar.Tests/AotTests.cs b/src/Edgar.Tests/AotTests.cs new file mode 100644 index 00000000..9fad874a --- /dev/null +++ b/src/Edgar.Tests/AotTests.cs @@ -0,0 +1,46 @@ +using Edgar.Geometry; +using Edgar.GraphBasedGenerator.Grid2D; +using Edgar.Legacy.Utils; +using Edgar.Utils; +using NUnit.Framework; +using System.Collections.Generic; +using System.IO; + +namespace Edgar.Tests +{ + [TestFixture] + public class AotTests + { + [Test] + public void SerializeToJson() + { + var graph = GraphsDatabase.GetExample4(); + var roomTemplates = new List() + { + new RoomTemplateGrid2D(PolygonGrid2D.GetSquare(10), new SimpleDoorModeGrid2D(1, 1)), + }; + + var levelDescription = new LevelDescriptionGrid2D(); + foreach (var graphVertex in graph.Vertices) + { + levelDescription.AddRoom(graphVertex, new RoomDescriptionGrid2D(false, roomTemplates)); + } + + foreach (var graphEdge in graph.Edges) + { + levelDescription.AddConnection(graphEdge.From, graphEdge.To); + } + + var levelDescriptionJson2 = JsonUtils2.SerializeToJson(levelDescription); + File.WriteAllText("levelDescription2.json", levelDescriptionJson2); + } + + [Test] + public void DeserializeLayoutJson() + { + var json = File.ReadAllText( + "C:\\Personal projects\\DotNet\\Edgar-DotNet\\Edgar.NativeAot\\bin\\Debug\\net8.0\\layout.json"); + var layout = JsonUtils2.DeserializeFromJson(json); + } + } +} \ No newline at end of file diff --git a/src/Edgar.Tests/Edgar.Tests.csproj b/src/Edgar.Tests/Edgar.Tests.csproj index eea9b3cd..08b9677e 100644 --- a/src/Edgar.Tests/Edgar.Tests.csproj +++ b/src/Edgar.Tests/Edgar.Tests.csproj @@ -1,6 +1,6 @@  - netcoreapp3.1 + net6.0 {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 15.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) diff --git a/src/Edgar.UnityBuild/Program.cs b/src/Edgar.UnityBuild/Program.cs index a0638470..48d0288b 100644 --- a/src/Edgar.UnityBuild/Program.cs +++ b/src/Edgar.UnityBuild/Program.cs @@ -5,9 +5,9 @@ namespace Edgar.UnityBuild { - class Program + public class Program { - static void Main(string[] args) + public static void Main(string[] args) { var assemblyName = "EdgarSingleFile.dll"; var sourceDir = "EdgarSingleFile"; diff --git a/src/Edgar/Edgar.csproj b/src/Edgar/Edgar.csproj index 3d911001..89185c1b 100644 --- a/src/Edgar/Edgar.csproj +++ b/src/Edgar/Edgar.csproj @@ -38,6 +38,7 @@ + diff --git a/src/Edgar/Geometry/OrthogonalLineGrid2D.cs b/src/Edgar/Geometry/OrthogonalLineGrid2D.cs index 252a026b..00ef51f4 100644 --- a/src/Edgar/Geometry/OrthogonalLineGrid2D.cs +++ b/src/Edgar/Geometry/OrthogonalLineGrid2D.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Diagnostics.Contracts; +using System.Text.Json.Serialization; using Edgar.Legacy.GeneralAlgorithms.Algorithms.Common; using Newtonsoft.Json; @@ -15,7 +16,9 @@ public struct OrthogonalLineGrid2D : IEquatable public readonly Vector2Int To; // TODO: handle better - [JsonProperty] private readonly Direction degeneratedDirection; + // TODO: native AOT + [JsonProperty] + public readonly Direction degeneratedDirection; private static readonly List OrderedDirections = new List() {Direction.Right, Direction.Bottom, Direction.Left, Direction.Top}; @@ -56,7 +59,8 @@ public OrthogonalLineGrid2D(Vector2Int from, Vector2Int to) /// /// Thrown when given points do not form an orthogonal line. // TODO: remove - [JsonConstructor] + [Newtonsoft.Json.JsonConstructor] + [System.Text.Json.Serialization.JsonConstructor] public OrthogonalLineGrid2D(Vector2Int from, Vector2Int to, Direction degeneratedDirection) { if (from.X != to.X && from.Y != to.Y) diff --git a/src/Edgar/Geometry/PolygonGrid2D.cs b/src/Edgar/Geometry/PolygonGrid2D.cs index 2c18b206..5dfdb3f4 100644 --- a/src/Edgar/Geometry/PolygonGrid2D.cs +++ b/src/Edgar/Geometry/PolygonGrid2D.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; +using System.Text.Json.Serialization; using Edgar.Legacy.GeneralAlgorithms.Algorithms.Polygons; using Edgar.Legacy.GeneralAlgorithms.DataStructures.Common; using Edgar.Legacy.GeneralAlgorithms.DataStructures.Polygons; @@ -24,12 +25,16 @@ public class PolygonGrid2D public static readonly int[] PossibleRotations = {0, 90, 180, 270}; // TODO: handle better - [JsonProperty] private readonly List points; + // TODO: needs to be public for JSON serialization, also removed readonly for now + [JsonProperty] + public List points; private readonly int hash; // TODO: maybe should be struct rather than a class - [JsonIgnore] public RectangleGrid2D BoundingRectangle { get; } + [Newtonsoft.Json.JsonIgnore] + [System.Text.Json.Serialization.JsonIgnore] + public RectangleGrid2D BoundingRectangle { get; } /// /// Create a polygon with given points. @@ -46,6 +51,12 @@ public PolygonGrid2D(IEnumerable points) BoundingRectangle = GetBoundingRectabgle(); } + [System.Text.Json.Serialization.JsonConstructor] + public PolygonGrid2D() + { + + } + private void CheckIntegrity() { // Each polygon must have at least 4 vertices diff --git a/src/Edgar/Geometry/RectangleGrid2D.cs b/src/Edgar/Geometry/RectangleGrid2D.cs index c2dfedc3..810bfaca 100644 --- a/src/Edgar/Geometry/RectangleGrid2D.cs +++ b/src/Edgar/Geometry/RectangleGrid2D.cs @@ -1,5 +1,6 @@ using System; using System.Runtime.CompilerServices; +using System.Text.Json.Serialization; namespace Edgar.Geometry { @@ -44,6 +45,7 @@ public readonly struct RectangleGrid2D /// /// /// + [JsonConstructor] public RectangleGrid2D(Vector2Int a, Vector2Int b) { if (a.X == b.X || a.Y == b.Y) diff --git a/src/Edgar/Geometry/Vector2Int.cs b/src/Edgar/Geometry/Vector2Int.cs index 2b0b2291..c01e1f48 100644 --- a/src/Edgar/Geometry/Vector2Int.cs +++ b/src/Edgar/Geometry/Vector2Int.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Diagnostics.Contracts; +using System.Text.Json.Serialization; using Edgar.Legacy.GeneralAlgorithms.Algorithms.Math; using Edgar.Legacy.GeneralAlgorithms.DataStructures.Common; @@ -15,6 +16,7 @@ namespace Edgar.Geometry public readonly int Y; + [JsonConstructor] public Vector2Int(int x, int y) { X = x; diff --git a/src/Edgar/GraphBasedGenerator/Common/LevelDescriptionBase.cs b/src/Edgar/GraphBasedGenerator/Common/LevelDescriptionBase.cs index 0bf36e41..969ccecb 100644 --- a/src/Edgar/GraphBasedGenerator/Common/LevelDescriptionBase.cs +++ b/src/Edgar/GraphBasedGenerator/Common/LevelDescriptionBase.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; +using System.Text.Json.Serialization; using Edgar.GraphBasedGenerator.Common.RoomTemplates; using Edgar.Graphs; using Newtonsoft.Json; @@ -16,11 +17,16 @@ public abstract class LevelDescriptionBase : ILevelDesc /// public string Name { get; set; } - private Dictionary roomDescriptions = new Dictionary(); + // TODO: - [JsonProperty] private List> roomDescriptionsList; + public Dictionary roomDescriptions = new Dictionary(); - [JsonProperty] private readonly List passages = new List(); + [JsonProperty] + private List> roomDescriptionsList; + + // TODO: private, readonly + [JsonProperty] + public List passages = new List(); [OnDeserialized] private void OnDeserialized(StreamingContext context) @@ -237,7 +243,8 @@ private void CheckIfValid(IGraph graph) } } - private class Passage + // TODO: + public class Passage { public TRoom Room1 { get; } diff --git a/src/Edgar/GraphBasedGenerator/Grid2D/Doors/DoorLineGrid2D.cs b/src/Edgar/GraphBasedGenerator/Grid2D/Doors/DoorLineGrid2D.cs index ea77fe20..20d0d442 100644 --- a/src/Edgar/GraphBasedGenerator/Grid2D/Doors/DoorLineGrid2D.cs +++ b/src/Edgar/GraphBasedGenerator/Grid2D/Doors/DoorLineGrid2D.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Text.Json.Serialization; using Edgar.Geometry; using Edgar.GraphBasedGenerator.Common.Doors; using Newtonsoft.Json; @@ -15,6 +16,7 @@ namespace Edgar.GraphBasedGenerator.Grid2D /// public struct DoorLineGrid2D : IEquatable { + [JsonProperty] /// /// Set of points where doors can start. /// @@ -28,7 +30,7 @@ public struct DoorLineGrid2D : IEquatable /// /// Door socket. /// - [JsonIgnore] + [Newtonsoft.Json.JsonIgnore] public IDoorSocket DoorSocket { get; } public DoorType Type { get; } @@ -36,6 +38,7 @@ public struct DoorLineGrid2D : IEquatable /// See the property. /// See the property. /// See the property. + [System.Text.Json.Serialization.JsonConstructor] public DoorLineGrid2D(OrthogonalLineGrid2D line, int length, IDoorSocket doorSocket, DoorType type) { Line = line; diff --git a/src/Edgar/GraphBasedGenerator/Grid2D/Doors/IDoorModeGrid2D.cs b/src/Edgar/GraphBasedGenerator/Grid2D/Doors/IDoorModeGrid2D.cs index 7d3faedc..d67249ac 100644 --- a/src/Edgar/GraphBasedGenerator/Grid2D/Doors/IDoorModeGrid2D.cs +++ b/src/Edgar/GraphBasedGenerator/Grid2D/Doors/IDoorModeGrid2D.cs @@ -1,5 +1,6 @@ using Edgar.Geometry; using Edgar.GraphBasedGenerator.Common.Doors; +using System.Text.Json.Serialization; namespace Edgar.GraphBasedGenerator.Grid2D { @@ -7,6 +8,8 @@ namespace Edgar.GraphBasedGenerator.Grid2D /// Represents a door mode on the 2D (integer) grid. /// A door mode describes which door positions are available for a room template. /// + [JsonDerivedType(typeof(ManualDoorModeGrid2D), typeDiscriminator: "manual")] + [JsonDerivedType(typeof(SimpleDoorModeGrid2D), typeDiscriminator: "simple")] public interface IDoorModeGrid2D : IDoorMode { } diff --git a/src/Edgar/GraphBasedGenerator/Grid2D/Doors/ManualDoorModeGrid2D.cs b/src/Edgar/GraphBasedGenerator/Grid2D/Doors/ManualDoorModeGrid2D.cs index 79df904c..6a2327b2 100644 --- a/src/Edgar/GraphBasedGenerator/Grid2D/Doors/ManualDoorModeGrid2D.cs +++ b/src/Edgar/GraphBasedGenerator/Grid2D/Doors/ManualDoorModeGrid2D.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Text.Json.Serialization; using Edgar.Geometry; using Edgar.GraphBasedGenerator.Grid2D.Exceptions; using Edgar.Legacy.GeneralAlgorithms.Algorithms.Common; @@ -15,12 +16,12 @@ public class ManualDoorModeGrid2D : IDoorModeGrid2D /// /// List of available doors. /// - public List Doors { get; } + public List Doors { get; set; } /// /// List of available door lines. /// - public List DoorLines { get; } + public List DoorLines { get; set; } private static readonly OrthogonalLineIntersection LineIntersection = new OrthogonalLineIntersection(); @@ -36,6 +37,21 @@ public ManualDoorModeGrid2D(List doorLines) DoorLines = doorLines ?? throw new ArgumentNullException(nameof(doorLines)); } + // TODO: + //[JsonConstructor] + public ManualDoorModeGrid2D(List doors, List doorLines) + { + Doors = doors; + DoorLines = doorLines; + } + + // TODO: + [JsonConstructor] + public ManualDoorModeGrid2D() + { + + } + public List GetDoors(PolygonGrid2D roomShape) { if (Doors != null) diff --git a/src/Edgar/GraphBasedGenerator/Grid2D/LayoutRoomGrid2D.cs b/src/Edgar/GraphBasedGenerator/Grid2D/LayoutRoomGrid2D.cs index 9c2feb79..e6ec88bc 100644 --- a/src/Edgar/GraphBasedGenerator/Grid2D/LayoutRoomGrid2D.cs +++ b/src/Edgar/GraphBasedGenerator/Grid2D/LayoutRoomGrid2D.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using System.Text.Json.Serialization; using Edgar.Geometry; namespace Edgar.GraphBasedGenerator.Grid2D @@ -16,6 +17,7 @@ public class LayoutRoomGrid2D /// /// Description of the corresponding room. /// + [JsonIgnore] public RoomDescriptionGrid2D RoomDescription { get; } /// diff --git a/src/Edgar/GraphBasedGenerator/Grid2D/RoomDescriptionGrid2D.cs b/src/Edgar/GraphBasedGenerator/Grid2D/RoomDescriptionGrid2D.cs index 009ba6be..085c9892 100644 --- a/src/Edgar/GraphBasedGenerator/Grid2D/RoomDescriptionGrid2D.cs +++ b/src/Edgar/GraphBasedGenerator/Grid2D/RoomDescriptionGrid2D.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Text.Json.Serialization; using Edgar.GraphBasedGenerator.Common.RoomTemplates; namespace Edgar.GraphBasedGenerator.Grid2D @@ -12,12 +13,12 @@ public class RoomDescriptionGrid2D : IRoomDescription /// /// Whether the room is a corridor or not. /// - public bool IsCorridor { get; } + public bool IsCorridor { get; set; } /// /// Room templates available for the room. /// - public List RoomTemplates { get; } + public List RoomTemplates { get; set; } /// See the property. /// See the property. @@ -32,5 +33,12 @@ public RoomDescriptionGrid2D(bool isCorridor, List roomTempl IsCorridor = isCorridor; RoomTemplates = roomTemplates; } + + // TODO: + [JsonConstructor] + public RoomDescriptionGrid2D() + { + + } } } \ No newline at end of file diff --git a/src/Edgar/GraphBasedGenerator/Grid2D/RoomTemplateGrid2D.cs b/src/Edgar/GraphBasedGenerator/Grid2D/RoomTemplateGrid2D.cs index 6beca0c8..29af2e75 100644 --- a/src/Edgar/GraphBasedGenerator/Grid2D/RoomTemplateGrid2D.cs +++ b/src/Edgar/GraphBasedGenerator/Grid2D/RoomTemplateGrid2D.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using System.Text.Json.Serialization; using Edgar.Geometry; using Edgar.GraphBasedGenerator.Common; @@ -15,12 +16,12 @@ public class RoomTemplateGrid2D /// /// Used mainly for debugging purposes. /// - public string Name { get; } + public string Name { get; set; } /// /// Outline of the room template. /// - public PolygonGrid2D Outline { get; } + public PolygonGrid2D Outline { get; set; } /// /// Available door positions of the room template. @@ -28,7 +29,7 @@ public class RoomTemplateGrid2D /// /// See or for available door modes. /// - public IDoorModeGrid2D Doors { get; } + public IDoorModeGrid2D Doors { get; set; } /// /// Settings regarding if the room template can be used multiple times in a level. @@ -36,7 +37,7 @@ public class RoomTemplateGrid2D /// /// See . /// - public RoomTemplateRepeatMode? RepeatMode { get; } + public RoomTemplateRepeatMode? RepeatMode { get; set; } /// /// How can the room template be transformed. @@ -48,7 +49,7 @@ public class RoomTemplateGrid2D /// /// See . /// - public List AllowedTransformations { get; } + public List AllowedTransformations { get; set; } /// See the property. /// See the property. @@ -66,5 +67,12 @@ public RoomTemplateGrid2D(PolygonGrid2D outline, IDoorModeGrid2D doors, string n {TransformationGrid2D.Identity}; ; } + + // TODO: reference handling problem again + [JsonConstructor] + public RoomTemplateGrid2D() + { + + } } } \ No newline at end of file diff --git a/src/Edgar/Utils/JsonUtils2.cs b/src/Edgar/Utils/JsonUtils2.cs new file mode 100644 index 00000000..4cd41a57 --- /dev/null +++ b/src/Edgar/Utils/JsonUtils2.cs @@ -0,0 +1,44 @@ +using Edgar.GraphBasedGenerator.Grid2D; +using System.Text.Json.Serialization; +using System.Text.Json; +using Edgar.Legacy.Core.MapLayouts; +using System.Collections.Generic; + +namespace Edgar.Utils +{ + public static class JsonUtils2 + { + public static string SerializeToJson(LevelDescriptionGrid2D levelDescription) + { + var options = new JsonSerializerOptions() + { + ReferenceHandler = ReferenceHandler.Preserve, + WriteIndented = true, + IncludeFields = true, + }; + + var json = JsonSerializer.Serialize(levelDescription, options); + + return json; + } + + public static LayoutGrid2DModel DeserializeFromJson(string json) + { + var options = new JsonSerializerOptions() + { + ReferenceHandler = null, + WriteIndented = true, + IncludeFields = true, + }; + + var layout = JsonSerializer.Deserialize>(json, options); + + return layout; + } + + public class LayoutGrid2DModel + { + public List> Rooms { get; set; } + } + } +} \ No newline at end of file