diff --git a/CHANGELOG.md b/CHANGELOG.md index 51e57e34e4..fca7fba25c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ ### Changed - Schema compilation error messages are now concatenated within the `GenerateCode` class before shown in the Console, creating only one error message instead of several. [#1107](https://github.com/spatialos/gdk-for-unity/pull/1107) +- Changed some reactive components for events and commands that were not correctly encapsulated with the `USE_LEGACY_REACTIVE_COMPONENTS` symbol. [#1113](https://github.com/spatialos/gdk-for-unity/pull/1113) ### Fixed diff --git a/test-project/Assets/Generated/Source/improbable/dependentschema/DependentComponentProviders.cs b/test-project/Assets/Generated/Source/improbable/dependentschema/DependentComponentProviders.cs index 71472fda28..fb225f0089 100644 --- a/test-project/Assets/Generated/Source/improbable/dependentschema/DependentComponentProviders.cs +++ b/test-project/Assets/Generated/Source/improbable/dependentschema/DependentComponentProviders.cs @@ -13,11 +13,10 @@ public partial class DependentComponent { internal static class ReferenceTypeProviders { -#if USE_LEGACY_REACTIVE_COMPONENTS - public static class UpdatesProvider + public static class AProvider { - private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary Storage = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -25,27 +24,27 @@ public static uint Allocate(global::Unity.Entities.World world) { var handle = GetNextHandle(); - Storage.Add(handle, default(List)); + Storage.Add(handle, default(global::Improbable.TestSchema.ExhaustiveRepeatedData)); WorldMapping.Add(handle, world); return handle; } - public static List Get(uint handle) + public static global::Improbable.TestSchema.ExhaustiveRepeatedData Get(uint handle) { if (!Storage.TryGetValue(handle, out var value)) { - throw new ArgumentException($"UpdatesProvider does not contain handle {handle}"); + throw new ArgumentException($"AProvider does not contain handle {handle}"); } return value; } - public static void Set(uint handle, List value) + public static void Set(uint handle, global::Improbable.TestSchema.ExhaustiveRepeatedData value) { if (!Storage.ContainsKey(handle)) { - throw new ArgumentException($"UpdatesProvider does not contain handle {handle}"); + throw new ArgumentException($"AProvider does not contain handle {handle}"); } Storage[handle] = value; @@ -80,12 +79,11 @@ private static uint GetNextHandle() } } -#endif - public static class AProvider + public static class CProvider { - private static readonly Dictionary Storage = new Dictionary(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary Storage = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -93,27 +91,27 @@ public static uint Allocate(global::Unity.Entities.World world) { var handle = GetNextHandle(); - Storage.Add(handle, default(global::Improbable.TestSchema.ExhaustiveRepeatedData)); + Storage.Add(handle, default(global::Improbable.TestSchema.SomeEnum?)); WorldMapping.Add(handle, world); return handle; } - public static global::Improbable.TestSchema.ExhaustiveRepeatedData Get(uint handle) + public static global::Improbable.TestSchema.SomeEnum? Get(uint handle) { if (!Storage.TryGetValue(handle, out var value)) { - throw new ArgumentException($"AProvider does not contain handle {handle}"); + throw new ArgumentException($"CProvider does not contain handle {handle}"); } return value; } - public static void Set(uint handle, global::Improbable.TestSchema.ExhaustiveRepeatedData value) + public static void Set(uint handle, global::Improbable.TestSchema.SomeEnum? value) { if (!Storage.ContainsKey(handle)) { - throw new ArgumentException($"AProvider does not contain handle {handle}"); + throw new ArgumentException($"CProvider does not contain handle {handle}"); } Storage[handle] = value; @@ -149,10 +147,10 @@ private static uint GetNextHandle() } - public static class CProvider + public static class DProvider { - private static readonly Dictionary Storage = new Dictionary(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary> Storage = new Dictionary>(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -160,27 +158,27 @@ public static uint Allocate(global::Unity.Entities.World world) { var handle = GetNextHandle(); - Storage.Add(handle, default(global::Improbable.TestSchema.SomeEnum?)); + Storage.Add(handle, default(global::System.Collections.Generic.List)); WorldMapping.Add(handle, world); return handle; } - public static global::Improbable.TestSchema.SomeEnum? Get(uint handle) + public static global::System.Collections.Generic.List Get(uint handle) { if (!Storage.TryGetValue(handle, out var value)) { - throw new ArgumentException($"CProvider does not contain handle {handle}"); + throw new ArgumentException($"DProvider does not contain handle {handle}"); } return value; } - public static void Set(uint handle, global::Improbable.TestSchema.SomeEnum? value) + public static void Set(uint handle, global::System.Collections.Generic.List value) { if (!Storage.ContainsKey(handle)) { - throw new ArgumentException($"CProvider does not contain handle {handle}"); + throw new ArgumentException($"DProvider does not contain handle {handle}"); } Storage[handle] = value; @@ -216,10 +214,10 @@ private static uint GetNextHandle() } - public static class DProvider + public static class EProvider { - private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary> Storage = new Dictionary>(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -227,27 +225,27 @@ public static uint Allocate(global::Unity.Entities.World world) { var handle = GetNextHandle(); - Storage.Add(handle, default(global::System.Collections.Generic.List)); + Storage.Add(handle, default(global::System.Collections.Generic.Dictionary)); WorldMapping.Add(handle, world); return handle; } - public static global::System.Collections.Generic.List Get(uint handle) + public static global::System.Collections.Generic.Dictionary Get(uint handle) { if (!Storage.TryGetValue(handle, out var value)) { - throw new ArgumentException($"DProvider does not contain handle {handle}"); + throw new ArgumentException($"EProvider does not contain handle {handle}"); } return value; } - public static void Set(uint handle, global::System.Collections.Generic.List value) + public static void Set(uint handle, global::System.Collections.Generic.Dictionary value) { if (!Storage.ContainsKey(handle)) { - throw new ArgumentException($"DProvider does not contain handle {handle}"); + throw new ArgumentException($"EProvider does not contain handle {handle}"); } Storage[handle] = value; @@ -283,10 +281,11 @@ private static uint GetNextHandle() } - public static class EProvider +#if USE_LEGACY_REACTIVE_COMPONENTS + public static class UpdatesProvider { - private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary> Storage = new Dictionary>(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -294,27 +293,27 @@ public static uint Allocate(global::Unity.Entities.World world) { var handle = GetNextHandle(); - Storage.Add(handle, default(global::System.Collections.Generic.Dictionary)); + Storage.Add(handle, default(List)); WorldMapping.Add(handle, world); return handle; } - public static global::System.Collections.Generic.Dictionary Get(uint handle) + public static List Get(uint handle) { if (!Storage.TryGetValue(handle, out var value)) { - throw new ArgumentException($"EProvider does not contain handle {handle}"); + throw new ArgumentException($"UpdatesProvider does not contain handle {handle}"); } return value; } - public static void Set(uint handle, global::System.Collections.Generic.Dictionary value) + public static void Set(uint handle, List value) { if (!Storage.ContainsKey(handle)) { - throw new ArgumentException($"EProvider does not contain handle {handle}"); + throw new ArgumentException($"UpdatesProvider does not contain handle {handle}"); } Storage[handle] = value; @@ -349,7 +348,7 @@ private static uint GetNextHandle() } } - +#endif } } } diff --git a/test-project/Assets/Generated/Source/improbable/dependentschema/DependentDataComponentProviders.cs b/test-project/Assets/Generated/Source/improbable/dependentschema/DependentDataComponentProviders.cs index 79c4ee8774..61e3415ffb 100644 --- a/test-project/Assets/Generated/Source/improbable/dependentschema/DependentDataComponentProviders.cs +++ b/test-project/Assets/Generated/Source/improbable/dependentschema/DependentDataComponentProviders.cs @@ -13,79 +13,10 @@ public partial class DependentDataComponent { internal static class ReferenceTypeProviders { -#if USE_LEGACY_REACTIVE_COMPONENTS - public static class UpdatesProvider - { - private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); - - private static uint nextHandle = 0; - - public static uint Allocate(global::Unity.Entities.World world) - { - var handle = GetNextHandle(); - - Storage.Add(handle, default(List)); - WorldMapping.Add(handle, world); - - return handle; - } - - public static List Get(uint handle) - { - if (!Storage.TryGetValue(handle, out var value)) - { - throw new ArgumentException($"UpdatesProvider does not contain handle {handle}"); - } - - return value; - } - - public static void Set(uint handle, List value) - { - if (!Storage.ContainsKey(handle)) - { - throw new ArgumentException($"UpdatesProvider does not contain handle {handle}"); - } - - Storage[handle] = value; - } - - public static void Free(uint handle) - { - Storage.Remove(handle); - WorldMapping.Remove(handle); - } - - public static void CleanDataInWorld(global::Unity.Entities.World world) - { - var handles = WorldMapping.Where(pair => pair.Value == world).Select(pair => pair.Key).ToList(); - - foreach (var handle in handles) - { - Free(handle); - } - } - - private static uint GetNextHandle() - { - nextHandle++; - - while (Storage.ContainsKey(nextHandle)) - { - nextHandle++; - } - - return nextHandle; - } - } - -#endif - public static class Field1Provider { private static readonly Dictionary Storage = new Dictionary(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -152,7 +83,7 @@ private static uint GetNextHandle() public static class Field2Provider { private static readonly Dictionary Storage = new Dictionary(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -219,7 +150,7 @@ private static uint GetNextHandle() public static class Field3Provider { private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -286,7 +217,7 @@ private static uint GetNextHandle() public static class Field4Provider { private static readonly Dictionary Storage = new Dictionary(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -353,7 +284,7 @@ private static uint GetNextHandle() public static class Field5Provider { private static readonly Dictionary Storage = new Dictionary(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -420,7 +351,7 @@ private static uint GetNextHandle() public static class Field6Provider { private static readonly Dictionary Storage = new Dictionary(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -487,7 +418,7 @@ private static uint GetNextHandle() public static class Field7Provider { private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -554,7 +485,7 @@ private static uint GetNextHandle() public static class Field8Provider { private static readonly Dictionary Storage = new Dictionary(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -621,7 +552,7 @@ private static uint GetNextHandle() public static class Field9Provider { private static readonly Dictionary Storage = new Dictionary(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -688,7 +619,7 @@ private static uint GetNextHandle() public static class Field10Provider { private static readonly Dictionary Storage = new Dictionary(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -755,7 +686,7 @@ private static uint GetNextHandle() public static class Field11Provider { private static readonly Dictionary Storage = new Dictionary(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -822,7 +753,7 @@ private static uint GetNextHandle() public static class Field12Provider { private static readonly Dictionary Storage = new Dictionary(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -889,7 +820,7 @@ private static uint GetNextHandle() public static class Field13Provider { private static readonly Dictionary Storage = new Dictionary(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -956,7 +887,7 @@ private static uint GetNextHandle() public static class Field14Provider { private static readonly Dictionary Storage = new Dictionary(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -1023,7 +954,7 @@ private static uint GetNextHandle() public static class Field15Provider { private static readonly Dictionary Storage = new Dictionary(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -1090,7 +1021,7 @@ private static uint GetNextHandle() public static class Field16Provider { private static readonly Dictionary Storage = new Dictionary(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -1157,7 +1088,7 @@ private static uint GetNextHandle() public static class Field17Provider { private static readonly Dictionary Storage = new Dictionary(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -1224,7 +1155,7 @@ private static uint GetNextHandle() public static class Field18Provider { private static readonly Dictionary Storage = new Dictionary(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -1288,10 +1219,78 @@ private static uint GetNextHandle() } +#if USE_LEGACY_REACTIVE_COMPONENTS + public static class UpdatesProvider + { + private static readonly Dictionary> Storage = new Dictionary>(); + private static readonly Dictionary WorldMapping = new Dictionary(); + + private static uint nextHandle = 0; + + public static uint Allocate(global::Unity.Entities.World world) + { + var handle = GetNextHandle(); + + Storage.Add(handle, default(List)); + WorldMapping.Add(handle, world); + + return handle; + } + + public static List Get(uint handle) + { + if (!Storage.TryGetValue(handle, out var value)) + { + throw new ArgumentException($"UpdatesProvider does not contain handle {handle}"); + } + + return value; + } + + public static void Set(uint handle, List value) + { + if (!Storage.ContainsKey(handle)) + { + throw new ArgumentException($"UpdatesProvider does not contain handle {handle}"); + } + + Storage[handle] = value; + } + + public static void Free(uint handle) + { + Storage.Remove(handle); + WorldMapping.Remove(handle); + } + + public static void CleanDataInWorld(global::Unity.Entities.World world) + { + var handles = WorldMapping.Where(pair => pair.Value == world).Select(pair => pair.Key).ToList(); + + foreach (var handle in handles) + { + Free(handle); + } + } + + private static uint GetNextHandle() + { + nextHandle++; + + while (Storage.ContainsKey(nextHandle)) + { + nextHandle++; + } + + return nextHandle; + } + } + + public static class FooEventProvider { private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -1354,10 +1353,11 @@ private static uint GetNextHandle() } } + public static class BarCommandSenderProvider { private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -1420,10 +1420,11 @@ private static uint GetNextHandle() } } + public static class BarCommandRequestsProvider { private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -1486,10 +1487,11 @@ private static uint GetNextHandle() } } + public static class BarCommandResponderProvider { private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -1552,10 +1554,11 @@ private static uint GetNextHandle() } } + public static class BarCommandResponsesProvider { private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -1618,7 +1621,7 @@ private static uint GetNextHandle() } } - +#endif } } } diff --git a/test-project/Assets/Generated/Source/improbable/tests/DependencyTestChildProviders.cs b/test-project/Assets/Generated/Source/improbable/tests/DependencyTestChildProviders.cs index cb38aad404..de21b7d8b2 100644 --- a/test-project/Assets/Generated/Source/improbable/tests/DependencyTestChildProviders.cs +++ b/test-project/Assets/Generated/Source/improbable/tests/DependencyTestChildProviders.cs @@ -17,7 +17,7 @@ internal static class ReferenceTypeProviders public static class UpdatesProvider { private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -81,7 +81,6 @@ private static uint GetNextHandle() } #endif - } } } diff --git a/test-project/Assets/Generated/Source/improbable/tests/DependencyTestGrandchildProviders.cs b/test-project/Assets/Generated/Source/improbable/tests/DependencyTestGrandchildProviders.cs index e8baf397b0..d7ed6a03f8 100644 --- a/test-project/Assets/Generated/Source/improbable/tests/DependencyTestGrandchildProviders.cs +++ b/test-project/Assets/Generated/Source/improbable/tests/DependencyTestGrandchildProviders.cs @@ -17,7 +17,7 @@ internal static class ReferenceTypeProviders public static class UpdatesProvider { private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -81,7 +81,6 @@ private static uint GetNextHandle() } #endif - } } } diff --git a/test-project/Assets/Generated/Source/improbable/tests/DependencyTestProviders.cs b/test-project/Assets/Generated/Source/improbable/tests/DependencyTestProviders.cs index 2092c8d94b..2b75ac16c3 100644 --- a/test-project/Assets/Generated/Source/improbable/tests/DependencyTestProviders.cs +++ b/test-project/Assets/Generated/Source/improbable/tests/DependencyTestProviders.cs @@ -17,7 +17,7 @@ internal static class ReferenceTypeProviders public static class UpdatesProvider { private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -81,7 +81,6 @@ private static uint GetNextHandle() } #endif - } } } diff --git a/test-project/Assets/Generated/Source/improbable/testschema/ExhaustiveEntityProviders.cs b/test-project/Assets/Generated/Source/improbable/testschema/ExhaustiveEntityProviders.cs index a504522c52..e8e9b49115 100644 --- a/test-project/Assets/Generated/Source/improbable/testschema/ExhaustiveEntityProviders.cs +++ b/test-project/Assets/Generated/Source/improbable/testschema/ExhaustiveEntityProviders.cs @@ -13,11 +13,10 @@ public partial class ExhaustiveEntity { internal static class ReferenceTypeProviders { -#if USE_LEGACY_REACTIVE_COMPONENTS - public static class UpdatesProvider + public static class Field1Provider { - private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary Storage = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -25,27 +24,27 @@ public static uint Allocate(global::Unity.Entities.World world) { var handle = GetNextHandle(); - Storage.Add(handle, default(List)); + Storage.Add(handle, default(global::Improbable.Gdk.Core.EntitySnapshot)); WorldMapping.Add(handle, world); return handle; } - public static List Get(uint handle) + public static global::Improbable.Gdk.Core.EntitySnapshot Get(uint handle) { if (!Storage.TryGetValue(handle, out var value)) { - throw new ArgumentException($"UpdatesProvider does not contain handle {handle}"); + throw new ArgumentException($"Field1Provider does not contain handle {handle}"); } return value; } - public static void Set(uint handle, List value) + public static void Set(uint handle, global::Improbable.Gdk.Core.EntitySnapshot value) { if (!Storage.ContainsKey(handle)) { - throw new ArgumentException($"UpdatesProvider does not contain handle {handle}"); + throw new ArgumentException($"Field1Provider does not contain handle {handle}"); } Storage[handle] = value; @@ -80,12 +79,11 @@ private static uint GetNextHandle() } } -#endif - public static class Field1Provider + public static class Field2Provider { - private static readonly Dictionary Storage = new Dictionary(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary Storage = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -93,27 +91,27 @@ public static uint Allocate(global::Unity.Entities.World world) { var handle = GetNextHandle(); - Storage.Add(handle, default(global::Improbable.Gdk.Core.EntitySnapshot)); + Storage.Add(handle, default(global::Improbable.Gdk.Core.EntitySnapshot?)); WorldMapping.Add(handle, world); return handle; } - public static global::Improbable.Gdk.Core.EntitySnapshot Get(uint handle) + public static global::Improbable.Gdk.Core.EntitySnapshot? Get(uint handle) { if (!Storage.TryGetValue(handle, out var value)) { - throw new ArgumentException($"Field1Provider does not contain handle {handle}"); + throw new ArgumentException($"Field2Provider does not contain handle {handle}"); } return value; } - public static void Set(uint handle, global::Improbable.Gdk.Core.EntitySnapshot value) + public static void Set(uint handle, global::Improbable.Gdk.Core.EntitySnapshot? value) { if (!Storage.ContainsKey(handle)) { - throw new ArgumentException($"Field1Provider does not contain handle {handle}"); + throw new ArgumentException($"Field2Provider does not contain handle {handle}"); } Storage[handle] = value; @@ -149,10 +147,10 @@ private static uint GetNextHandle() } - public static class Field2Provider + public static class Field3Provider { - private static readonly Dictionary Storage = new Dictionary(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary> Storage = new Dictionary>(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -160,27 +158,27 @@ public static uint Allocate(global::Unity.Entities.World world) { var handle = GetNextHandle(); - Storage.Add(handle, default(global::Improbable.Gdk.Core.EntitySnapshot?)); + Storage.Add(handle, default(global::System.Collections.Generic.List)); WorldMapping.Add(handle, world); return handle; } - public static global::Improbable.Gdk.Core.EntitySnapshot? Get(uint handle) + public static global::System.Collections.Generic.List Get(uint handle) { if (!Storage.TryGetValue(handle, out var value)) { - throw new ArgumentException($"Field2Provider does not contain handle {handle}"); + throw new ArgumentException($"Field3Provider does not contain handle {handle}"); } return value; } - public static void Set(uint handle, global::Improbable.Gdk.Core.EntitySnapshot? value) + public static void Set(uint handle, global::System.Collections.Generic.List value) { if (!Storage.ContainsKey(handle)) { - throw new ArgumentException($"Field2Provider does not contain handle {handle}"); + throw new ArgumentException($"Field3Provider does not contain handle {handle}"); } Storage[handle] = value; @@ -216,10 +214,10 @@ private static uint GetNextHandle() } - public static class Field3Provider + public static class Field4Provider { - private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary> Storage = new Dictionary>(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -227,27 +225,27 @@ public static uint Allocate(global::Unity.Entities.World world) { var handle = GetNextHandle(); - Storage.Add(handle, default(global::System.Collections.Generic.List)); + Storage.Add(handle, default(global::System.Collections.Generic.Dictionary)); WorldMapping.Add(handle, world); return handle; } - public static global::System.Collections.Generic.List Get(uint handle) + public static global::System.Collections.Generic.Dictionary Get(uint handle) { if (!Storage.TryGetValue(handle, out var value)) { - throw new ArgumentException($"Field3Provider does not contain handle {handle}"); + throw new ArgumentException($"Field4Provider does not contain handle {handle}"); } return value; } - public static void Set(uint handle, global::System.Collections.Generic.List value) + public static void Set(uint handle, global::System.Collections.Generic.Dictionary value) { if (!Storage.ContainsKey(handle)) { - throw new ArgumentException($"Field3Provider does not contain handle {handle}"); + throw new ArgumentException($"Field4Provider does not contain handle {handle}"); } Storage[handle] = value; @@ -283,10 +281,10 @@ private static uint GetNextHandle() } - public static class Field4Provider + public static class Field5Provider { - private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary> Storage = new Dictionary>(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -294,27 +292,27 @@ public static uint Allocate(global::Unity.Entities.World world) { var handle = GetNextHandle(); - Storage.Add(handle, default(global::System.Collections.Generic.Dictionary)); + Storage.Add(handle, default(global::System.Collections.Generic.Dictionary)); WorldMapping.Add(handle, world); return handle; } - public static global::System.Collections.Generic.Dictionary Get(uint handle) + public static global::System.Collections.Generic.Dictionary Get(uint handle) { if (!Storage.TryGetValue(handle, out var value)) { - throw new ArgumentException($"Field4Provider does not contain handle {handle}"); + throw new ArgumentException($"Field5Provider does not contain handle {handle}"); } return value; } - public static void Set(uint handle, global::System.Collections.Generic.Dictionary value) + public static void Set(uint handle, global::System.Collections.Generic.Dictionary value) { if (!Storage.ContainsKey(handle)) { - throw new ArgumentException($"Field4Provider does not contain handle {handle}"); + throw new ArgumentException($"Field5Provider does not contain handle {handle}"); } Storage[handle] = value; @@ -350,10 +348,11 @@ private static uint GetNextHandle() } - public static class Field5Provider +#if USE_LEGACY_REACTIVE_COMPONENTS + public static class UpdatesProvider { - private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary> Storage = new Dictionary>(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -361,27 +360,27 @@ public static uint Allocate(global::Unity.Entities.World world) { var handle = GetNextHandle(); - Storage.Add(handle, default(global::System.Collections.Generic.Dictionary)); + Storage.Add(handle, default(List)); WorldMapping.Add(handle, world); return handle; } - public static global::System.Collections.Generic.Dictionary Get(uint handle) + public static List Get(uint handle) { if (!Storage.TryGetValue(handle, out var value)) { - throw new ArgumentException($"Field5Provider does not contain handle {handle}"); + throw new ArgumentException($"UpdatesProvider does not contain handle {handle}"); } return value; } - public static void Set(uint handle, global::System.Collections.Generic.Dictionary value) + public static void Set(uint handle, List value) { if (!Storage.ContainsKey(handle)) { - throw new ArgumentException($"Field5Provider does not contain handle {handle}"); + throw new ArgumentException($"UpdatesProvider does not contain handle {handle}"); } Storage[handle] = value; @@ -416,7 +415,7 @@ private static uint GetNextHandle() } } - +#endif } } } diff --git a/test-project/Assets/Generated/Source/improbable/testschema/ExhaustiveMapKeyProviders.cs b/test-project/Assets/Generated/Source/improbable/testschema/ExhaustiveMapKeyProviders.cs index 2c2b44d745..559c90de32 100644 --- a/test-project/Assets/Generated/Source/improbable/testschema/ExhaustiveMapKeyProviders.cs +++ b/test-project/Assets/Generated/Source/improbable/testschema/ExhaustiveMapKeyProviders.cs @@ -13,79 +13,10 @@ public partial class ExhaustiveMapKey { internal static class ReferenceTypeProviders { -#if USE_LEGACY_REACTIVE_COMPONENTS - public static class UpdatesProvider - { - private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); - - private static uint nextHandle = 0; - - public static uint Allocate(global::Unity.Entities.World world) - { - var handle = GetNextHandle(); - - Storage.Add(handle, default(List)); - WorldMapping.Add(handle, world); - - return handle; - } - - public static List Get(uint handle) - { - if (!Storage.TryGetValue(handle, out var value)) - { - throw new ArgumentException($"UpdatesProvider does not contain handle {handle}"); - } - - return value; - } - - public static void Set(uint handle, List value) - { - if (!Storage.ContainsKey(handle)) - { - throw new ArgumentException($"UpdatesProvider does not contain handle {handle}"); - } - - Storage[handle] = value; - } - - public static void Free(uint handle) - { - Storage.Remove(handle); - WorldMapping.Remove(handle); - } - - public static void CleanDataInWorld(global::Unity.Entities.World world) - { - var handles = WorldMapping.Where(pair => pair.Value == world).Select(pair => pair.Key).ToList(); - - foreach (var handle in handles) - { - Free(handle); - } - } - - private static uint GetNextHandle() - { - nextHandle++; - - while (Storage.ContainsKey(nextHandle)) - { - nextHandle++; - } - - return nextHandle; - } - } - -#endif - public static class Field1Provider { private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -152,7 +83,7 @@ private static uint GetNextHandle() public static class Field2Provider { private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -219,7 +150,7 @@ private static uint GetNextHandle() public static class Field3Provider { private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -286,7 +217,7 @@ private static uint GetNextHandle() public static class Field4Provider { private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -353,7 +284,7 @@ private static uint GetNextHandle() public static class Field5Provider { private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -420,7 +351,7 @@ private static uint GetNextHandle() public static class Field6Provider { private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -487,7 +418,7 @@ private static uint GetNextHandle() public static class Field7Provider { private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -554,7 +485,7 @@ private static uint GetNextHandle() public static class Field8Provider { private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -621,7 +552,7 @@ private static uint GetNextHandle() public static class Field9Provider { private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -688,7 +619,7 @@ private static uint GetNextHandle() public static class Field10Provider { private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -755,7 +686,7 @@ private static uint GetNextHandle() public static class Field11Provider { private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -822,7 +753,7 @@ private static uint GetNextHandle() public static class Field12Provider { private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -889,7 +820,7 @@ private static uint GetNextHandle() public static class Field13Provider { private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -956,7 +887,7 @@ private static uint GetNextHandle() public static class Field14Provider { private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -1023,7 +954,7 @@ private static uint GetNextHandle() public static class Field15Provider { private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -1090,7 +1021,7 @@ private static uint GetNextHandle() public static class Field16Provider { private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -1157,7 +1088,7 @@ private static uint GetNextHandle() public static class Field17Provider { private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -1224,7 +1155,7 @@ private static uint GetNextHandle() public static class Field18Provider { private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -1288,6 +1219,74 @@ private static uint GetNextHandle() } +#if USE_LEGACY_REACTIVE_COMPONENTS + public static class UpdatesProvider + { + private static readonly Dictionary> Storage = new Dictionary>(); + private static readonly Dictionary WorldMapping = new Dictionary(); + + private static uint nextHandle = 0; + + public static uint Allocate(global::Unity.Entities.World world) + { + var handle = GetNextHandle(); + + Storage.Add(handle, default(List)); + WorldMapping.Add(handle, world); + + return handle; + } + + public static List Get(uint handle) + { + if (!Storage.TryGetValue(handle, out var value)) + { + throw new ArgumentException($"UpdatesProvider does not contain handle {handle}"); + } + + return value; + } + + public static void Set(uint handle, List value) + { + if (!Storage.ContainsKey(handle)) + { + throw new ArgumentException($"UpdatesProvider does not contain handle {handle}"); + } + + Storage[handle] = value; + } + + public static void Free(uint handle) + { + Storage.Remove(handle); + WorldMapping.Remove(handle); + } + + public static void CleanDataInWorld(global::Unity.Entities.World world) + { + var handles = WorldMapping.Where(pair => pair.Value == world).Select(pair => pair.Key).ToList(); + + foreach (var handle in handles) + { + Free(handle); + } + } + + private static uint GetNextHandle() + { + nextHandle++; + + while (Storage.ContainsKey(nextHandle)) + { + nextHandle++; + } + + return nextHandle; + } + } + +#endif } } } diff --git a/test-project/Assets/Generated/Source/improbable/testschema/ExhaustiveMapValueProviders.cs b/test-project/Assets/Generated/Source/improbable/testschema/ExhaustiveMapValueProviders.cs index d96344bd64..71d1259a8d 100644 --- a/test-project/Assets/Generated/Source/improbable/testschema/ExhaustiveMapValueProviders.cs +++ b/test-project/Assets/Generated/Source/improbable/testschema/ExhaustiveMapValueProviders.cs @@ -13,79 +13,10 @@ public partial class ExhaustiveMapValue { internal static class ReferenceTypeProviders { -#if USE_LEGACY_REACTIVE_COMPONENTS - public static class UpdatesProvider - { - private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); - - private static uint nextHandle = 0; - - public static uint Allocate(global::Unity.Entities.World world) - { - var handle = GetNextHandle(); - - Storage.Add(handle, default(List)); - WorldMapping.Add(handle, world); - - return handle; - } - - public static List Get(uint handle) - { - if (!Storage.TryGetValue(handle, out var value)) - { - throw new ArgumentException($"UpdatesProvider does not contain handle {handle}"); - } - - return value; - } - - public static void Set(uint handle, List value) - { - if (!Storage.ContainsKey(handle)) - { - throw new ArgumentException($"UpdatesProvider does not contain handle {handle}"); - } - - Storage[handle] = value; - } - - public static void Free(uint handle) - { - Storage.Remove(handle); - WorldMapping.Remove(handle); - } - - public static void CleanDataInWorld(global::Unity.Entities.World world) - { - var handles = WorldMapping.Where(pair => pair.Value == world).Select(pair => pair.Key).ToList(); - - foreach (var handle in handles) - { - Free(handle); - } - } - - private static uint GetNextHandle() - { - nextHandle++; - - while (Storage.ContainsKey(nextHandle)) - { - nextHandle++; - } - - return nextHandle; - } - } - -#endif - public static class Field1Provider { private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -152,7 +83,7 @@ private static uint GetNextHandle() public static class Field2Provider { private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -219,7 +150,7 @@ private static uint GetNextHandle() public static class Field3Provider { private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -286,7 +217,7 @@ private static uint GetNextHandle() public static class Field4Provider { private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -353,7 +284,7 @@ private static uint GetNextHandle() public static class Field5Provider { private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -420,7 +351,7 @@ private static uint GetNextHandle() public static class Field6Provider { private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -487,7 +418,7 @@ private static uint GetNextHandle() public static class Field7Provider { private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -554,7 +485,7 @@ private static uint GetNextHandle() public static class Field8Provider { private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -621,7 +552,7 @@ private static uint GetNextHandle() public static class Field9Provider { private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -688,7 +619,7 @@ private static uint GetNextHandle() public static class Field10Provider { private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -755,7 +686,7 @@ private static uint GetNextHandle() public static class Field11Provider { private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -822,7 +753,7 @@ private static uint GetNextHandle() public static class Field12Provider { private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -889,7 +820,7 @@ private static uint GetNextHandle() public static class Field13Provider { private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -956,7 +887,7 @@ private static uint GetNextHandle() public static class Field14Provider { private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -1023,7 +954,7 @@ private static uint GetNextHandle() public static class Field15Provider { private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -1090,7 +1021,7 @@ private static uint GetNextHandle() public static class Field16Provider { private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -1157,7 +1088,7 @@ private static uint GetNextHandle() public static class Field17Provider { private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -1224,7 +1155,7 @@ private static uint GetNextHandle() public static class Field18Provider { private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -1288,6 +1219,74 @@ private static uint GetNextHandle() } +#if USE_LEGACY_REACTIVE_COMPONENTS + public static class UpdatesProvider + { + private static readonly Dictionary> Storage = new Dictionary>(); + private static readonly Dictionary WorldMapping = new Dictionary(); + + private static uint nextHandle = 0; + + public static uint Allocate(global::Unity.Entities.World world) + { + var handle = GetNextHandle(); + + Storage.Add(handle, default(List)); + WorldMapping.Add(handle, world); + + return handle; + } + + public static List Get(uint handle) + { + if (!Storage.TryGetValue(handle, out var value)) + { + throw new ArgumentException($"UpdatesProvider does not contain handle {handle}"); + } + + return value; + } + + public static void Set(uint handle, List value) + { + if (!Storage.ContainsKey(handle)) + { + throw new ArgumentException($"UpdatesProvider does not contain handle {handle}"); + } + + Storage[handle] = value; + } + + public static void Free(uint handle) + { + Storage.Remove(handle); + WorldMapping.Remove(handle); + } + + public static void CleanDataInWorld(global::Unity.Entities.World world) + { + var handles = WorldMapping.Where(pair => pair.Value == world).Select(pair => pair.Key).ToList(); + + foreach (var handle in handles) + { + Free(handle); + } + } + + private static uint GetNextHandle() + { + nextHandle++; + + while (Storage.ContainsKey(nextHandle)) + { + nextHandle++; + } + + return nextHandle; + } + } + +#endif } } } diff --git a/test-project/Assets/Generated/Source/improbable/testschema/ExhaustiveOptionalProviders.cs b/test-project/Assets/Generated/Source/improbable/testschema/ExhaustiveOptionalProviders.cs index e3faaa19f6..fab11dc67c 100644 --- a/test-project/Assets/Generated/Source/improbable/testschema/ExhaustiveOptionalProviders.cs +++ b/test-project/Assets/Generated/Source/improbable/testschema/ExhaustiveOptionalProviders.cs @@ -13,79 +13,10 @@ public partial class ExhaustiveOptional { internal static class ReferenceTypeProviders { -#if USE_LEGACY_REACTIVE_COMPONENTS - public static class UpdatesProvider - { - private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); - - private static uint nextHandle = 0; - - public static uint Allocate(global::Unity.Entities.World world) - { - var handle = GetNextHandle(); - - Storage.Add(handle, default(List)); - WorldMapping.Add(handle, world); - - return handle; - } - - public static List Get(uint handle) - { - if (!Storage.TryGetValue(handle, out var value)) - { - throw new ArgumentException($"UpdatesProvider does not contain handle {handle}"); - } - - return value; - } - - public static void Set(uint handle, List value) - { - if (!Storage.ContainsKey(handle)) - { - throw new ArgumentException($"UpdatesProvider does not contain handle {handle}"); - } - - Storage[handle] = value; - } - - public static void Free(uint handle) - { - Storage.Remove(handle); - WorldMapping.Remove(handle); - } - - public static void CleanDataInWorld(global::Unity.Entities.World world) - { - var handles = WorldMapping.Where(pair => pair.Value == world).Select(pair => pair.Key).ToList(); - - foreach (var handle in handles) - { - Free(handle); - } - } - - private static uint GetNextHandle() - { - nextHandle++; - - while (Storage.ContainsKey(nextHandle)) - { - nextHandle++; - } - - return nextHandle; - } - } - -#endif - public static class Field1Provider { private static readonly Dictionary Storage = new Dictionary(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -152,7 +83,7 @@ private static uint GetNextHandle() public static class Field2Provider { private static readonly Dictionary Storage = new Dictionary(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -219,7 +150,7 @@ private static uint GetNextHandle() public static class Field3Provider { private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -286,7 +217,7 @@ private static uint GetNextHandle() public static class Field4Provider { private static readonly Dictionary Storage = new Dictionary(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -353,7 +284,7 @@ private static uint GetNextHandle() public static class Field5Provider { private static readonly Dictionary Storage = new Dictionary(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -420,7 +351,7 @@ private static uint GetNextHandle() public static class Field6Provider { private static readonly Dictionary Storage = new Dictionary(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -487,7 +418,7 @@ private static uint GetNextHandle() public static class Field7Provider { private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -554,7 +485,7 @@ private static uint GetNextHandle() public static class Field8Provider { private static readonly Dictionary Storage = new Dictionary(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -621,7 +552,7 @@ private static uint GetNextHandle() public static class Field9Provider { private static readonly Dictionary Storage = new Dictionary(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -688,7 +619,7 @@ private static uint GetNextHandle() public static class Field10Provider { private static readonly Dictionary Storage = new Dictionary(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -755,7 +686,7 @@ private static uint GetNextHandle() public static class Field11Provider { private static readonly Dictionary Storage = new Dictionary(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -822,7 +753,7 @@ private static uint GetNextHandle() public static class Field12Provider { private static readonly Dictionary Storage = new Dictionary(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -889,7 +820,7 @@ private static uint GetNextHandle() public static class Field13Provider { private static readonly Dictionary Storage = new Dictionary(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -956,7 +887,7 @@ private static uint GetNextHandle() public static class Field14Provider { private static readonly Dictionary Storage = new Dictionary(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -1023,7 +954,7 @@ private static uint GetNextHandle() public static class Field15Provider { private static readonly Dictionary Storage = new Dictionary(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -1090,7 +1021,7 @@ private static uint GetNextHandle() public static class Field16Provider { private static readonly Dictionary Storage = new Dictionary(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -1157,7 +1088,7 @@ private static uint GetNextHandle() public static class Field17Provider { private static readonly Dictionary Storage = new Dictionary(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -1224,7 +1155,7 @@ private static uint GetNextHandle() public static class Field18Provider { private static readonly Dictionary Storage = new Dictionary(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -1288,6 +1219,74 @@ private static uint GetNextHandle() } +#if USE_LEGACY_REACTIVE_COMPONENTS + public static class UpdatesProvider + { + private static readonly Dictionary> Storage = new Dictionary>(); + private static readonly Dictionary WorldMapping = new Dictionary(); + + private static uint nextHandle = 0; + + public static uint Allocate(global::Unity.Entities.World world) + { + var handle = GetNextHandle(); + + Storage.Add(handle, default(List)); + WorldMapping.Add(handle, world); + + return handle; + } + + public static List Get(uint handle) + { + if (!Storage.TryGetValue(handle, out var value)) + { + throw new ArgumentException($"UpdatesProvider does not contain handle {handle}"); + } + + return value; + } + + public static void Set(uint handle, List value) + { + if (!Storage.ContainsKey(handle)) + { + throw new ArgumentException($"UpdatesProvider does not contain handle {handle}"); + } + + Storage[handle] = value; + } + + public static void Free(uint handle) + { + Storage.Remove(handle); + WorldMapping.Remove(handle); + } + + public static void CleanDataInWorld(global::Unity.Entities.World world) + { + var handles = WorldMapping.Where(pair => pair.Value == world).Select(pair => pair.Key).ToList(); + + foreach (var handle in handles) + { + Free(handle); + } + } + + private static uint GetNextHandle() + { + nextHandle++; + + while (Storage.ContainsKey(nextHandle)) + { + nextHandle++; + } + + return nextHandle; + } + } + +#endif } } } diff --git a/test-project/Assets/Generated/Source/improbable/testschema/ExhaustiveRepeatedProviders.cs b/test-project/Assets/Generated/Source/improbable/testschema/ExhaustiveRepeatedProviders.cs index 29eacd6834..a63ab41d6a 100644 --- a/test-project/Assets/Generated/Source/improbable/testschema/ExhaustiveRepeatedProviders.cs +++ b/test-project/Assets/Generated/Source/improbable/testschema/ExhaustiveRepeatedProviders.cs @@ -13,79 +13,10 @@ public partial class ExhaustiveRepeated { internal static class ReferenceTypeProviders { -#if USE_LEGACY_REACTIVE_COMPONENTS - public static class UpdatesProvider - { - private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); - - private static uint nextHandle = 0; - - public static uint Allocate(global::Unity.Entities.World world) - { - var handle = GetNextHandle(); - - Storage.Add(handle, default(List)); - WorldMapping.Add(handle, world); - - return handle; - } - - public static List Get(uint handle) - { - if (!Storage.TryGetValue(handle, out var value)) - { - throw new ArgumentException($"UpdatesProvider does not contain handle {handle}"); - } - - return value; - } - - public static void Set(uint handle, List value) - { - if (!Storage.ContainsKey(handle)) - { - throw new ArgumentException($"UpdatesProvider does not contain handle {handle}"); - } - - Storage[handle] = value; - } - - public static void Free(uint handle) - { - Storage.Remove(handle); - WorldMapping.Remove(handle); - } - - public static void CleanDataInWorld(global::Unity.Entities.World world) - { - var handles = WorldMapping.Where(pair => pair.Value == world).Select(pair => pair.Key).ToList(); - - foreach (var handle in handles) - { - Free(handle); - } - } - - private static uint GetNextHandle() - { - nextHandle++; - - while (Storage.ContainsKey(nextHandle)) - { - nextHandle++; - } - - return nextHandle; - } - } - -#endif - public static class Field1Provider { private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -152,7 +83,7 @@ private static uint GetNextHandle() public static class Field2Provider { private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -219,7 +150,7 @@ private static uint GetNextHandle() public static class Field3Provider { private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -286,7 +217,7 @@ private static uint GetNextHandle() public static class Field4Provider { private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -353,7 +284,7 @@ private static uint GetNextHandle() public static class Field5Provider { private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -420,7 +351,7 @@ private static uint GetNextHandle() public static class Field6Provider { private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -487,7 +418,7 @@ private static uint GetNextHandle() public static class Field7Provider { private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -554,7 +485,7 @@ private static uint GetNextHandle() public static class Field8Provider { private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -621,7 +552,7 @@ private static uint GetNextHandle() public static class Field9Provider { private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -688,7 +619,7 @@ private static uint GetNextHandle() public static class Field10Provider { private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -755,7 +686,7 @@ private static uint GetNextHandle() public static class Field11Provider { private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -822,7 +753,7 @@ private static uint GetNextHandle() public static class Field12Provider { private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -889,7 +820,7 @@ private static uint GetNextHandle() public static class Field13Provider { private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -956,7 +887,7 @@ private static uint GetNextHandle() public static class Field14Provider { private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -1023,7 +954,7 @@ private static uint GetNextHandle() public static class Field15Provider { private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -1090,7 +1021,7 @@ private static uint GetNextHandle() public static class Field16Provider { private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -1157,7 +1088,7 @@ private static uint GetNextHandle() public static class Field17Provider { private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -1224,7 +1155,7 @@ private static uint GetNextHandle() public static class Field18Provider { private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -1288,6 +1219,74 @@ private static uint GetNextHandle() } +#if USE_LEGACY_REACTIVE_COMPONENTS + public static class UpdatesProvider + { + private static readonly Dictionary> Storage = new Dictionary>(); + private static readonly Dictionary WorldMapping = new Dictionary(); + + private static uint nextHandle = 0; + + public static uint Allocate(global::Unity.Entities.World world) + { + var handle = GetNextHandle(); + + Storage.Add(handle, default(List)); + WorldMapping.Add(handle, world); + + return handle; + } + + public static List Get(uint handle) + { + if (!Storage.TryGetValue(handle, out var value)) + { + throw new ArgumentException($"UpdatesProvider does not contain handle {handle}"); + } + + return value; + } + + public static void Set(uint handle, List value) + { + if (!Storage.ContainsKey(handle)) + { + throw new ArgumentException($"UpdatesProvider does not contain handle {handle}"); + } + + Storage[handle] = value; + } + + public static void Free(uint handle) + { + Storage.Remove(handle); + WorldMapping.Remove(handle); + } + + public static void CleanDataInWorld(global::Unity.Entities.World world) + { + var handles = WorldMapping.Where(pair => pair.Value == world).Select(pair => pair.Key).ToList(); + + foreach (var handle in handles) + { + Free(handle); + } + } + + private static uint GetNextHandle() + { + nextHandle++; + + while (Storage.ContainsKey(nextHandle)) + { + nextHandle++; + } + + return nextHandle; + } + } + +#endif } } } diff --git a/test-project/Assets/Generated/Source/improbable/testschema/ExhaustiveSingularProviders.cs b/test-project/Assets/Generated/Source/improbable/testschema/ExhaustiveSingularProviders.cs index ddd4f800c6..4925b4852f 100644 --- a/test-project/Assets/Generated/Source/improbable/testschema/ExhaustiveSingularProviders.cs +++ b/test-project/Assets/Generated/Source/improbable/testschema/ExhaustiveSingularProviders.cs @@ -13,11 +13,10 @@ public partial class ExhaustiveSingular { internal static class ReferenceTypeProviders { -#if USE_LEGACY_REACTIVE_COMPONENTS - public static class UpdatesProvider + public static class Field3Provider { - private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary Storage = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -25,27 +24,27 @@ public static uint Allocate(global::Unity.Entities.World world) { var handle = GetNextHandle(); - Storage.Add(handle, default(List)); + Storage.Add(handle, default(byte[])); WorldMapping.Add(handle, world); return handle; } - public static List Get(uint handle) + public static byte[] Get(uint handle) { if (!Storage.TryGetValue(handle, out var value)) { - throw new ArgumentException($"UpdatesProvider does not contain handle {handle}"); + throw new ArgumentException($"Field3Provider does not contain handle {handle}"); } return value; } - public static void Set(uint handle, List value) + public static void Set(uint handle, byte[] value) { if (!Storage.ContainsKey(handle)) { - throw new ArgumentException($"UpdatesProvider does not contain handle {handle}"); + throw new ArgumentException($"Field3Provider does not contain handle {handle}"); } Storage[handle] = value; @@ -80,12 +79,11 @@ private static uint GetNextHandle() } } -#endif - public static class Field3Provider + public static class Field7Provider { - private static readonly Dictionary Storage = new Dictionary(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary Storage = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -93,27 +91,27 @@ public static uint Allocate(global::Unity.Entities.World world) { var handle = GetNextHandle(); - Storage.Add(handle, default(byte[])); + Storage.Add(handle, default(string)); WorldMapping.Add(handle, world); return handle; } - public static byte[] Get(uint handle) + public static string Get(uint handle) { if (!Storage.TryGetValue(handle, out var value)) { - throw new ArgumentException($"Field3Provider does not contain handle {handle}"); + throw new ArgumentException($"Field7Provider does not contain handle {handle}"); } return value; } - public static void Set(uint handle, byte[] value) + public static void Set(uint handle, string value) { if (!Storage.ContainsKey(handle)) { - throw new ArgumentException($"Field3Provider does not contain handle {handle}"); + throw new ArgumentException($"Field7Provider does not contain handle {handle}"); } Storage[handle] = value; @@ -149,10 +147,11 @@ private static uint GetNextHandle() } - public static class Field7Provider +#if USE_LEGACY_REACTIVE_COMPONENTS + public static class UpdatesProvider { - private static readonly Dictionary Storage = new Dictionary(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary> Storage = new Dictionary>(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; @@ -160,27 +159,27 @@ public static uint Allocate(global::Unity.Entities.World world) { var handle = GetNextHandle(); - Storage.Add(handle, default(string)); + Storage.Add(handle, default(List)); WorldMapping.Add(handle, world); return handle; } - public static string Get(uint handle) + public static List Get(uint handle) { if (!Storage.TryGetValue(handle, out var value)) { - throw new ArgumentException($"Field7Provider does not contain handle {handle}"); + throw new ArgumentException($"UpdatesProvider does not contain handle {handle}"); } return value; } - public static void Set(uint handle, string value) + public static void Set(uint handle, List value) { if (!Storage.ContainsKey(handle)) { - throw new ArgumentException($"Field7Provider does not contain handle {handle}"); + throw new ArgumentException($"UpdatesProvider does not contain handle {handle}"); } Storage[handle] = value; @@ -215,7 +214,7 @@ private static uint GetNextHandle() } } - +#endif } } } diff --git a/workers/unity/Packages/io.improbable.gdk.tools/.CodeGenerator/GdkCodeGenerator/Templates/UnityReferenceTypeProviderContent.tt b/workers/unity/Packages/io.improbable.gdk.tools/.CodeGenerator/GdkCodeGenerator/Templates/UnityReferenceTypeProviderContent.tt index 563bdb0778..95312b518a 100644 --- a/workers/unity/Packages/io.improbable.gdk.tools/.CodeGenerator/GdkCodeGenerator/Templates/UnityReferenceTypeProviderContent.tt +++ b/workers/unity/Packages/io.improbable.gdk.tools/.CodeGenerator/GdkCodeGenerator/Templates/UnityReferenceTypeProviderContent.tt @@ -3,7 +3,7 @@ public static class <#= Name #>Provider { private static readonly Dictionary> Storage = new Dictionary>(); - private static readonly Dictionary WorldMapping = new Dictionary(); + private static readonly Dictionary WorldMapping = new Dictionary(); private static uint nextHandle = 0; diff --git a/workers/unity/Packages/io.improbable.gdk.tools/.CodeGenerator/GdkCodeGenerator/Templates/UnityReferenceTypeProviderGenerator.tt b/workers/unity/Packages/io.improbable.gdk.tools/.CodeGenerator/GdkCodeGenerator/Templates/UnityReferenceTypeProviderGenerator.tt index 1bfc3f11c7..0a26686dea 100644 --- a/workers/unity/Packages/io.improbable.gdk.tools/.CodeGenerator/GdkCodeGenerator/Templates/UnityReferenceTypeProviderGenerator.tt +++ b/workers/unity/Packages/io.improbable.gdk.tools/.CodeGenerator/GdkCodeGenerator/Templates/UnityReferenceTypeProviderGenerator.tt @@ -22,26 +22,29 @@ namespace <#= qualifiedNamespace #> { internal static class ReferenceTypeProviders { -#if USE_LEGACY_REACTIVE_COMPONENTS - <#= CommonGeneratorUtils.IndentEveryNewline(generator.Generate("Updates", $"List<{componentNamespace}.Update>"), 3) #> -#endif - <# foreach (var fieldDetails in fieldDetailsList) { #> <# if (!fieldDetails.IsBlittable) { #> <#= CommonGeneratorUtils.IndentEveryNewline(generator.Generate(fieldDetails.PascalCaseName, fieldDetails.Type), 3) #> <# } #> <# } #> +#if USE_LEGACY_REACTIVE_COMPONENTS + <#= CommonGeneratorUtils.IndentEveryNewline(generator.Generate("Updates", $"List<{componentNamespace}.Update>"), 3) #> <# foreach(var eventDetails in eventDetailsList) { #> + <#= CommonGeneratorUtils.IndentEveryNewline(generator.Generate(eventDetails.EventName, $"List<{eventDetails.FqnPayloadType}>"), 3) #> <# } #> <# foreach (var commandDetails in commandDetailsList) { #> + <#= CommonGeneratorUtils.IndentEveryNewline(generator.Generate($"{commandDetails.CommandName}Sender", $"List<{componentNamespace}.{commandDetails.CommandName}.Request>"), 3) #> + <#= CommonGeneratorUtils.IndentEveryNewline(generator.Generate($"{commandDetails.CommandName}Requests", $"List<{componentNamespace}.{commandDetails.CommandName}.ReceivedRequest>"), 3) #> + <#= CommonGeneratorUtils.IndentEveryNewline(generator.Generate($"{commandDetails.CommandName}Responder", $"List<{componentNamespace}.{commandDetails.CommandName}.Response>"), 3) #> - <#= CommonGeneratorUtils.IndentEveryNewline(generator.Generate($"{commandDetails.CommandName}Responses", $"List<{componentNamespace}.{commandDetails.CommandName}.ReceivedResponse>"), 3) #> + <#= CommonGeneratorUtils.IndentEveryNewline(generator.Generate($"{commandDetails.CommandName}Responses", $"List<{componentNamespace}.{commandDetails.CommandName}.ReceivedResponse>"), 3) #> <# } #> +#endif } } }