public override void ExecuteReplication(Connection connection) { var componentDataArray = ReplicationComponentGroup.GetComponentArray <SpatialOSExhaustiveOptional>(); var spatialEntityIdData = ReplicationComponentGroup.GetComponentDataArray <SpatialEntityId>(); for (var i = 0; i < componentDataArray.Length; i++) { var componentData = componentDataArray[i]; var entityId = spatialEntityIdData[i].EntityId; var hasPendingEvents = false; if (componentData.DirtyBit || hasPendingEvents) { var update = new global::Improbable.Gdk.Tests.ExhaustiveOptional.Update(); update.SetField2(componentData.Field2.HasValue ? new global::Improbable.Collections.Option <float>(componentData.Field2.Value) : new global::Improbable.Collections.Option <float>()); update.SetField4(componentData.Field4.HasValue ? new global::Improbable.Collections.Option <int>(componentData.Field4.Value) : new global::Improbable.Collections.Option <int>()); update.SetField5(componentData.Field5.HasValue ? new global::Improbable.Collections.Option <long>(componentData.Field5.Value) : new global::Improbable.Collections.Option <long>()); update.SetField6(componentData.Field6.HasValue ? new global::Improbable.Collections.Option <double>(componentData.Field6.Value) : new global::Improbable.Collections.Option <double>()); update.SetField8(componentData.Field8.HasValue ? new global::Improbable.Collections.Option <uint>(componentData.Field8.Value) : new global::Improbable.Collections.Option <uint>()); update.SetField9(componentData.Field9.HasValue ? new global::Improbable.Collections.Option <ulong>(componentData.Field9.Value) : new global::Improbable.Collections.Option <ulong>()); update.SetField10(componentData.Field10.HasValue ? new global::Improbable.Collections.Option <int>(componentData.Field10.Value) : new global::Improbable.Collections.Option <int>()); update.SetField11(componentData.Field11.HasValue ? new global::Improbable.Collections.Option <long>(componentData.Field11.Value) : new global::Improbable.Collections.Option <long>()); update.SetField12(componentData.Field12.HasValue ? new global::Improbable.Collections.Option <uint>(componentData.Field12.Value) : new global::Improbable.Collections.Option <uint>()); update.SetField13(componentData.Field13.HasValue ? new global::Improbable.Collections.Option <ulong>(componentData.Field13.Value) : new global::Improbable.Collections.Option <ulong>()); update.SetField14(componentData.Field14.HasValue ? new global::Improbable.Collections.Option <int>(componentData.Field14.Value) : new global::Improbable.Collections.Option <int>()); update.SetField15(componentData.Field15.HasValue ? new global::Improbable.Collections.Option <long>(componentData.Field15.Value) : new global::Improbable.Collections.Option <long>()); update.SetField16(componentData.Field16.HasValue ? new global::Improbable.Collections.Option <global::Improbable.EntityId>(new global::Improbable.EntityId(componentData.Field16.Value)) : new global::Improbable.Collections.Option <global::Improbable.EntityId>()); update.SetField17(componentData.Field17.HasValue ? new global::Improbable.Collections.Option <global::Improbable.Gdk.Tests.SomeType>(global::Generated.Improbable.Gdk.Tests.SomeType.ToSpatial(componentData.Field17.Value)) : new global::Improbable.Collections.Option <global::Improbable.Gdk.Tests.SomeType>()); SendComponentUpdate(connection, entityId, update); componentData.DirtyBit = false; view.SetComponentObject(entityId, componentData); } } }
public override void ExecuteReplication(Connection connection) { var componentDataArray = ReplicationComponentGroup.GetComponentArray <SpatialOSNonBlittableComponent>(); var spatialEntityIdData = ReplicationComponentGroup.GetComponentDataArray <SpatialEntityId>(); for (var i = 0; i < componentDataArray.Length; i++) { var componentData = componentDataArray[i]; var entityId = spatialEntityIdData[i].EntityId; var hasPendingEvents = false; var firstEventEvents = EntityIdToFirstEventEvents[entityId]; hasPendingEvents |= firstEventEvents.Count() > 0; var secondEventEvents = EntityIdToSecondEventEvents[entityId]; hasPendingEvents |= secondEventEvents.Count() > 0; if (componentData.DirtyBit || hasPendingEvents) { var update = new global::Improbable.Gdk.Tests.NonblittableTypes.NonBlittableComponent.Update(); update.SetBoolField(componentData.BoolField); update.SetIntField(componentData.IntField); update.SetLongField(componentData.LongField); update.SetFloatField(componentData.FloatField); update.SetDoubleField(componentData.DoubleField); update.SetStringField(componentData.StringField); update.SetOptionalField(componentData.OptionalField.HasValue ? new global::Improbable.Collections.Option <int>(componentData.OptionalField.Value) : new global::Improbable.Collections.Option <int>()); update.SetListField(new global::Improbable.Collections.List <int>(componentData.ListField)); update.SetMapField(new global::Improbable.Collections.Map <int, string>(componentData.MapField.ToDictionary(entry => entry.Key, entry => entry.Value))); foreach (var nativeEvent in firstEventEvents) { var spatialEvent = global::Generated.Improbable.Gdk.Tests.NonblittableTypes.FirstEventPayload.ToSpatial(nativeEvent); update.firstEvent.Add(spatialEvent); } foreach (var nativeEvent in secondEventEvents) { var spatialEvent = global::Generated.Improbable.Gdk.Tests.NonblittableTypes.SecondEventPayload.ToSpatial(nativeEvent); update.secondEvent.Add(spatialEvent); } SendComponentUpdate(connection, entityId, update); componentData.DirtyBit = false; view.SetComponentObject(entityId, componentData); firstEventEvents.Clear(); secondEventEvents.Clear(); } } }
public override void ExecuteReplication(Connection connection) { var componentDataArray = ReplicationComponentGroup.GetComponentArray <SpatialOSExhaustiveSingular>(); var spatialEntityIdData = ReplicationComponentGroup.GetComponentDataArray <SpatialEntityId>(); for (var i = 0; i < componentDataArray.Length; i++) { var componentData = componentDataArray[i]; var entityId = spatialEntityIdData[i].EntityId; var hasPendingEvents = false; if (componentData.DirtyBit || hasPendingEvents) { var update = new global::Improbable.Gdk.Tests.ExhaustiveSingular.Update(); update.SetField1(componentData.Field1); update.SetField2(componentData.Field2); update.SetField4(componentData.Field4); update.SetField5(componentData.Field5); update.SetField6(componentData.Field6); update.SetField7(componentData.Field7); update.SetField8(componentData.Field8); update.SetField9(componentData.Field9); update.SetField10(componentData.Field10); update.SetField11(componentData.Field11); update.SetField12(componentData.Field12); update.SetField13(componentData.Field13); update.SetField14(componentData.Field14); update.SetField15(componentData.Field15); update.SetField16(new global::Improbable.EntityId(componentData.Field16)); update.SetField17(global::Generated.Improbable.Gdk.Tests.SomeType.ToSpatial(componentData.Field17)); SendComponentUpdate(connection, entityId, update); componentData.DirtyBit = false; view.SetComponentObject(entityId, componentData); } } }
public override void ExecuteReplication(Connection connection) { var componentDataArray = ReplicationComponentGroup.GetComponentArray <SpatialOSExhaustiveMapKey>(); var spatialEntityIdData = ReplicationComponentGroup.GetComponentDataArray <SpatialEntityId>(); for (var i = 0; i < componentDataArray.Length; i++) { var componentData = componentDataArray[i]; var entityId = spatialEntityIdData[i].EntityId; var hasPendingEvents = false; if (componentData.DirtyBit || hasPendingEvents) { var update = new global::Improbable.Gdk.Tests.ExhaustiveMapKey.Update(); update.SetField2(new global::Improbable.Collections.Map <float, string>(componentData.Field2.ToDictionary(entry => entry.Key, entry => entry.Value))); update.SetField4(new global::Improbable.Collections.Map <int, string>(componentData.Field4.ToDictionary(entry => entry.Key, entry => entry.Value))); update.SetField5(new global::Improbable.Collections.Map <long, string>(componentData.Field5.ToDictionary(entry => entry.Key, entry => entry.Value))); update.SetField6(new global::Improbable.Collections.Map <double, string>(componentData.Field6.ToDictionary(entry => entry.Key, entry => entry.Value))); update.SetField7(new global::Improbable.Collections.Map <string, string>(componentData.Field7.ToDictionary(entry => entry.Key, entry => entry.Value))); update.SetField8(new global::Improbable.Collections.Map <uint, string>(componentData.Field8.ToDictionary(entry => entry.Key, entry => entry.Value))); update.SetField9(new global::Improbable.Collections.Map <ulong, string>(componentData.Field9.ToDictionary(entry => entry.Key, entry => entry.Value))); update.SetField10(new global::Improbable.Collections.Map <int, string>(componentData.Field10.ToDictionary(entry => entry.Key, entry => entry.Value))); update.SetField11(new global::Improbable.Collections.Map <long, string>(componentData.Field11.ToDictionary(entry => entry.Key, entry => entry.Value))); update.SetField12(new global::Improbable.Collections.Map <uint, string>(componentData.Field12.ToDictionary(entry => entry.Key, entry => entry.Value))); update.SetField13(new global::Improbable.Collections.Map <ulong, string>(componentData.Field13.ToDictionary(entry => entry.Key, entry => entry.Value))); update.SetField14(new global::Improbable.Collections.Map <int, string>(componentData.Field14.ToDictionary(entry => entry.Key, entry => entry.Value))); update.SetField15(new global::Improbable.Collections.Map <long, string>(componentData.Field15.ToDictionary(entry => entry.Key, entry => entry.Value))); update.SetField16(new global::Improbable.Collections.Map <global::Improbable.EntityId, string>(componentData.Field16.ToDictionary(entry => new global::Improbable.EntityId(entry.Key), entry => entry.Value))); update.SetField17(new global::Improbable.Collections.Map <global::Improbable.Gdk.Tests.SomeType, string>(componentData.Field17.ToDictionary(entry => global::Generated.Improbable.Gdk.Tests.SomeType.ToSpatial(entry.Key), entry => entry.Value))); SendComponentUpdate(connection, entityId, update); componentData.DirtyBit = false; view.SetComponentObject(entityId, componentData); } } }
public override void ExecuteReplication(Connection connection) { var componentDataArray = ReplicationComponentGroup.GetComponentArray <SpatialOSExhaustiveRepeated>(); var spatialEntityIdData = ReplicationComponentGroup.GetComponentDataArray <SpatialEntityId>(); for (var i = 0; i < componentDataArray.Length; i++) { var componentData = componentDataArray[i]; var entityId = spatialEntityIdData[i].EntityId; var hasPendingEvents = false; if (componentData.DirtyBit || hasPendingEvents) { var update = new global::Improbable.Gdk.Tests.ExhaustiveRepeated.Update(); update.SetField2(new global::Improbable.Collections.List <float>(componentData.Field2)); update.SetField4(new global::Improbable.Collections.List <int>(componentData.Field4)); update.SetField5(new global::Improbable.Collections.List <long>(componentData.Field5)); update.SetField6(new global::Improbable.Collections.List <double>(componentData.Field6)); update.SetField7(new global::Improbable.Collections.List <string>(componentData.Field7)); update.SetField8(new global::Improbable.Collections.List <uint>(componentData.Field8)); update.SetField9(new global::Improbable.Collections.List <ulong>(componentData.Field9)); update.SetField10(new global::Improbable.Collections.List <int>(componentData.Field10)); update.SetField11(new global::Improbable.Collections.List <long>(componentData.Field11)); update.SetField12(new global::Improbable.Collections.List <uint>(componentData.Field12)); update.SetField13(new global::Improbable.Collections.List <ulong>(componentData.Field13)); update.SetField14(new global::Improbable.Collections.List <int>(componentData.Field14)); update.SetField15(new global::Improbable.Collections.List <long>(componentData.Field15)); update.SetField16(new global::Improbable.Collections.List <global::Improbable.EntityId>(componentData.Field16.Select(nativeInternalObject => new global::Improbable.EntityId(nativeInternalObject)))); update.SetField17(new global::Improbable.Collections.List <global::Improbable.Gdk.Tests.SomeType>(componentData.Field17.Select(nativeInternalObject => global::Generated.Improbable.Gdk.Tests.SomeType.ToSpatial(nativeInternalObject)))); SendComponentUpdate(connection, entityId, update); componentData.DirtyBit = false; view.SetComponentObject(entityId, componentData); } } }