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