public Snapshot ToComponentSnapshot(global::Unity.Entities.World world) { var componentDataSchema = new ComponentData(new SchemaComponentData(61)); Serialization.SerializeComponent(this, componentDataSchema.SchemaData.Value.GetFields(), world); var snapshot = Serialization.DeserializeSnapshot(componentDataSchema.SchemaData.Value.GetFields()); componentDataSchema.SchemaData?.Destroy(); componentDataSchema.SchemaData = null; return(snapshot); }
public static global::Improbable.Restricted.Worker.Component Deserialize(global::Improbable.Worker.CInterop.SchemaObject obj, global::Unity.Entities.World world) { var component = new global::Improbable.Restricted.Worker.Component(); component.workerIdHandle = global::Improbable.Gdk.Core.ReferenceProvider <string> .Create(); component.WorkerId = obj.GetString(1); component.workerTypeHandle = global::Improbable.Gdk.Core.ReferenceProvider <string> .Create(); component.WorkerType = obj.GetString(2); component.Connection = global::Improbable.Restricted.Connection.Serialization.Deserialize(obj.GetObject(3)); return(component); }
public static Improbable.Gdk.Tests.ComponentsWithNoFields.ComponentWithNoFieldsWithEvents.Snapshot DeserializeSnapshot(global::Improbable.Worker.CInterop.SchemaObject obj, global::Unity.Entities.World world) { var component = new Improbable.Gdk.Tests.ComponentsWithNoFields.ComponentWithNoFieldsWithEvents.Snapshot(); return(component); }
public static void SerializeComponent(global::Improbable.DependentSchema.DependentComponent.Component component, global::Improbable.Worker.CInterop.SchemaObject obj, global::Unity.Entities.World world) { global::Improbable.TestSchema.ExhaustiveRepeatedData.Serialization.Serialize(component.A, obj.AddObject(1)); obj.AddEnum(2, (uint)component.B); if (component.C.HasValue) { obj.AddEnum(3, (uint)component.C.Value); } foreach (var value in component.D) { global::Improbable.TestSchema.SomeType.Serialization.Serialize(value, obj.AddObject(4)); } foreach (var keyValuePair in component.E) { var mapObj = obj.AddObject(5); mapObj.AddEnum(1, (uint)keyValuePair.Key); global::Improbable.TestSchema.SomeType.Serialization.Serialize(keyValuePair.Value, mapObj.AddObject(2)); } }
public static void SerializeComponent(Improbable.EntityAcl.Component component, global::Improbable.Worker.CInterop.SchemaObject obj, global::Unity.Entities.World world) { { global::Improbable.WorkerRequirementSet.Serialization.Serialize(component.ReadAcl, obj.AddObject(1)); } { foreach (var keyValuePair in component.ComponentWriteAcl) { var mapObj = obj.AddObject(2); mapObj.AddUint32(1, keyValuePair.Key); global::Improbable.WorkerRequirementSet.Serialization.Serialize(keyValuePair.Value, mapObj.AddObject(2)); } } }
public static void SerializeComponent(global::Improbable.TestSchema.ExhaustiveEntity.Component component, global::Improbable.Worker.CInterop.SchemaObject obj, global::Unity.Entities.World world) { { obj.AddEntity(1, component.Field1); } { if (component.Field2.HasValue) { obj.AddEntity(2, component.Field2.Value); } } { foreach (var value in component.Field3) { obj.AddEntity(3, value); } } { foreach (var keyValuePair in component.Field4) { var mapObj = obj.AddObject(4); mapObj.AddEntity(1, keyValuePair.Key); mapObj.AddString(2, keyValuePair.Value); } } { foreach (var keyValuePair in component.Field5) { var mapObj = obj.AddObject(5); mapObj.AddString(1, keyValuePair.Key); mapObj.AddEntity(2, keyValuePair.Value); } } }
public static Improbable.Gdk.Tests.NonblittableTypes.NonBlittableComponent.Snapshot DeserializeSnapshot(global::Improbable.Worker.Core.SchemaObject obj, global::Unity.Entities.World world) { var component = new Improbable.Gdk.Tests.NonblittableTypes.NonBlittableComponent.Snapshot(); { component.BoolField = obj.GetBool(1); } { component.IntField = obj.GetInt32(2); } { component.LongField = obj.GetInt64(3); } { component.FloatField = obj.GetFloat(4); } { component.DoubleField = obj.GetDouble(5); } { component.StringField = obj.GetString(6); } { if (obj.GetInt32Count(7) == 1) { component.OptionalField = new int?(obj.GetInt32(7)); } } { component.ListField = new global::System.Collections.Generic.List <int>(); var list = component.ListField; var listLength = obj.GetInt32Count(8); for (var i = 0; i < listLength; i++) { list.Add(obj.IndexInt32(8, (uint)i)); } } { component.MapField = new global::System.Collections.Generic.Dictionary <int, string>(); var map = component.MapField; var mapSize = obj.GetObjectCount(9); for (var i = 0; i < mapSize; i++) { var mapObj = obj.IndexObject(9, (uint)i); var key = mapObj.GetInt32(1); var value = mapObj.GetString(2); map.Add(key, value); } } return(component); }
public static void SerializeComponent(global::Improbable.Restricted.System.Component component, global::Improbable.Worker.CInterop.SchemaObject obj, global::Unity.Entities.World world) { }
public static Improbable.Gdk.Tests.BlittableTypes.BlittableComponent.Snapshot DeserializeSnapshot(global::Improbable.Worker.Core.SchemaObject obj, global::Unity.Entities.World world) { var component = new Improbable.Gdk.Tests.BlittableTypes.BlittableComponent.Snapshot(); { component.BoolField = obj.GetBool(1); } { component.IntField = obj.GetInt32(2); } { component.LongField = obj.GetInt64(3); } { component.FloatField = obj.GetFloat(4); } { component.DoubleField = obj.GetDouble(5); } return(component); }
public static global::Improbable.Restricted.PlayerClient.Component Deserialize(global::Improbable.Worker.CInterop.SchemaObject obj, global::Unity.Entities.World world) { var component = new global::Improbable.Restricted.PlayerClient.Component(); component.playerIdentityHandle = global::Improbable.Gdk.Core.ReferenceProvider <global::Improbable.Restricted.PlayerIdentity> .Create(); component.PlayerIdentity = global::Improbable.Restricted.PlayerIdentity.Serialization.Deserialize(obj.GetObject(1)); return(component); }
public static global::Improbable.Restricted.System.Component Deserialize(global::Improbable.Worker.CInterop.SchemaObject obj, global::Unity.Entities.World world) { var component = new global::Improbable.Restricted.System.Component(); return(component); }
public static void SerializeComponent(global::Improbable.Restricted.PlayerClient.Component component, global::Improbable.Worker.CInterop.SchemaObject obj, global::Unity.Entities.World world) { global::Improbable.Restricted.PlayerIdentity.Serialization.Serialize(component.PlayerIdentity, obj.AddObject(1)); }
public static SpatialOSConnection Deserialize(global::Improbable.Worker.Core.SchemaObject obj, global::Unity.Entities.World world) { var component = new SpatialOSConnection(); return(component); }
public static void SerializeComponent(global::Improbable.Persistence.Component component, global::Improbable.Worker.CInterop.SchemaObject obj, global::Unity.Entities.World world) { }
public static void SerializeComponent(Improbable.PlayerLifecycle.PlayerHeartbeatClient.Component component, global::Improbable.Worker.CInterop.SchemaObject obj, global::Unity.Entities.World world) { }
public static void SerializeComponent(global::Improbable.Gdk.PlayerLifecycle.OwningWorker.Component component, global::Improbable.Worker.CInterop.SchemaObject obj, global::Unity.Entities.World world) { obj.AddString(1, component.WorkerId); }
public static Improbable.PlayerLifecycle.PlayerHeartbeatClient.Component Deserialize(global::Improbable.Worker.CInterop.SchemaObject obj, global::Unity.Entities.World world) { var component = new Improbable.PlayerLifecycle.PlayerHeartbeatClient.Component(); return(component); }
public static global::Improbable.Gdk.PlayerLifecycle.OwningWorker.Component Deserialize(global::Improbable.Worker.CInterop.SchemaObject obj, global::Unity.Entities.World world) { var component = new global::Improbable.Gdk.PlayerLifecycle.OwningWorker.Component(); component.workerIdHandle = global::Improbable.Gdk.Core.ReferenceProvider <string> .Create(); component.WorkerId = obj.GetString(1); return(component); }
public static Improbable.Gdk.Tests.ComponentsWithNoFields.ComponentWithNoFieldsWithCommands.Component Deserialize(global::Improbable.Worker.Core.SchemaObject obj, global::Unity.Entities.World world) { var component = new Improbable.Gdk.Tests.ComponentsWithNoFields.ComponentWithNoFieldsWithCommands.Component(); return(component); }
public static void SerializeComponent(global::Improbable.TestSchema.RecursiveComponent.Component component, global::Improbable.Worker.CInterop.SchemaObject obj, global::Unity.Entities.World world) { global::Improbable.TestSchema.TypeA.Serialization.Serialize(component.A, obj.AddObject(1)); global::Improbable.TestSchema.TypeB.Serialization.Serialize(component.B, obj.AddObject(2)); global::Improbable.TestSchema.TypeC.Serialization.Serialize(component.C, obj.AddObject(3)); }
public static SpatialOSComponentWithNoFieldsWithEvents Deserialize(global::Improbable.Worker.Core.SchemaObject obj, global::Unity.Entities.World world) { var component = new SpatialOSComponentWithNoFieldsWithEvents(); return(component); }
public static global::Improbable.TestSchema.RecursiveComponent.Component Deserialize(global::Improbable.Worker.CInterop.SchemaObject obj, global::Unity.Entities.World world) { var component = new global::Improbable.TestSchema.RecursiveComponent.Component(); component.aHandle = global::Improbable.TestSchema.RecursiveComponent.ReferenceTypeProviders.AProvider.Allocate(world); component.A = global::Improbable.TestSchema.TypeA.Serialization.Deserialize(obj.GetObject(1)); component.bHandle = global::Improbable.TestSchema.RecursiveComponent.ReferenceTypeProviders.BProvider.Allocate(world); component.B = global::Improbable.TestSchema.TypeB.Serialization.Deserialize(obj.GetObject(2)); component.cHandle = global::Improbable.TestSchema.RecursiveComponent.ReferenceTypeProviders.CProvider.Allocate(world); component.C = global::Improbable.TestSchema.TypeC.Serialization.Deserialize(obj.GetObject(3)); return(component); }
public static global::Improbable.TestSchema.ExhaustiveEntity.Component Deserialize(global::Improbable.Worker.CInterop.SchemaObject obj, global::Unity.Entities.World world) { var component = new global::Improbable.TestSchema.ExhaustiveEntity.Component(); component.field1Handle = global::Improbable.TestSchema.ExhaustiveEntity.ReferenceTypeProviders.Field1Provider.Allocate(world); { component.Field1 = obj.GetEntity(1); } component.field2Handle = global::Improbable.TestSchema.ExhaustiveEntity.ReferenceTypeProviders.Field2Provider.Allocate(world); { if (obj.GetEntityCount(2) == 1) { component.Field2 = new global::Improbable.Gdk.Core.EntitySnapshot?(obj.GetEntity(2)); } } component.field3Handle = global::Improbable.TestSchema.ExhaustiveEntity.ReferenceTypeProviders.Field3Provider.Allocate(world); { component.Field3 = new global::System.Collections.Generic.List <global::Improbable.Gdk.Core.EntitySnapshot>(); var list = component.Field3; var listLength = obj.GetEntityCount(3); for (var i = 0; i < listLength; i++) { list.Add(obj.IndexEntity(3, (uint)i)); } } component.field4Handle = global::Improbable.TestSchema.ExhaustiveEntity.ReferenceTypeProviders.Field4Provider.Allocate(world); { component.Field4 = new global::System.Collections.Generic.Dictionary <global::Improbable.Gdk.Core.EntitySnapshot, string>(); var map = component.Field4; var mapSize = obj.GetObjectCount(4); for (var i = 0; i < mapSize; i++) { var mapObj = obj.IndexObject(4, (uint)i); var key = mapObj.GetEntity(1); var value = mapObj.GetString(2); map.Add(key, value); } } component.field5Handle = global::Improbable.TestSchema.ExhaustiveEntity.ReferenceTypeProviders.Field5Provider.Allocate(world); { component.Field5 = new global::System.Collections.Generic.Dictionary <string, global::Improbable.Gdk.Core.EntitySnapshot>(); var map = component.Field5; var mapSize = obj.GetObjectCount(5); for (var i = 0; i < mapSize; i++) { var mapObj = obj.IndexObject(5, (uint)i); var key = mapObj.GetString(1); var value = mapObj.GetEntity(2); map.Add(key, value); } } return(component); }
public static void SerializeComponent(global::Improbable.Interest.Component component, global::Improbable.Worker.CInterop.SchemaObject obj, global::Unity.Entities.World world) { foreach (var keyValuePair in component.ComponentInterest) { var mapObj = obj.AddObject(1); mapObj.AddUint32(1, keyValuePair.Key); global::Improbable.ComponentInterest.Serialization.Serialize(keyValuePair.Value, mapObj.AddObject(2)); } }
public static Improbable.EntityAcl.Component Deserialize(global::Improbable.Worker.CInterop.SchemaObject obj, global::Unity.Entities.World world) { var component = new Improbable.EntityAcl.Component(); component.readAclHandle = Improbable.EntityAcl.ReferenceTypeProviders.ReadAclProvider.Allocate(world); { component.ReadAcl = global::Improbable.WorkerRequirementSet.Serialization.Deserialize(obj.GetObject(1)); } component.componentWriteAclHandle = Improbable.EntityAcl.ReferenceTypeProviders.ComponentWriteAclProvider.Allocate(world); { component.ComponentWriteAcl = new global::System.Collections.Generic.Dictionary <uint, global::Improbable.WorkerRequirementSet>(); var map = component.ComponentWriteAcl; var mapSize = obj.GetObjectCount(2); for (var i = 0; i < mapSize; i++) { var mapObj = obj.IndexObject(2, (uint)i); var key = mapObj.GetUint32(1); var value = global::Improbable.WorkerRequirementSet.Serialization.Deserialize(mapObj.GetObject(2)); map.Add(key, value); } } return(component); }
public static global::Improbable.Interest.Component Deserialize(global::Improbable.Worker.CInterop.SchemaObject obj, global::Unity.Entities.World world) { var component = new global::Improbable.Interest.Component(); component.componentInterestHandle = global::Improbable.Gdk.Core.ReferenceProvider <global::System.Collections.Generic.Dictionary <uint, global::Improbable.ComponentInterest> > .Create(); { var map = new global::System.Collections.Generic.Dictionary <uint, global::Improbable.ComponentInterest>(); var mapSize = obj.GetObjectCount(1); component.ComponentInterest = map; for (var i = 0; i < mapSize; i++) { var mapObj = obj.IndexObject(1, (uint)i); var key = mapObj.GetUint32(1); var value = global::Improbable.ComponentInterest.Serialization.Deserialize(mapObj.GetObject(2)); map.Add(key, value); } } return(component); }
public static global::Improbable.DependentSchema.DependentComponent.Component Deserialize(global::Improbable.Worker.CInterop.SchemaObject obj, global::Unity.Entities.World world) { var component = new global::Improbable.DependentSchema.DependentComponent.Component(); component.aHandle = global::Improbable.Gdk.Core.ReferenceProvider <global::Improbable.TestSchema.ExhaustiveRepeatedData> .Create(); component.A = global::Improbable.TestSchema.ExhaustiveRepeatedData.Serialization.Deserialize(obj.GetObject(1)); component.B = (global::Improbable.TestSchema.SomeEnum)obj.GetEnum(2); component.cHandle = global::Improbable.Gdk.Core.ReferenceProvider <global::Improbable.TestSchema.SomeEnum?> .Create(); if (obj.GetEnumCount(3) == 1) { component.C = new global::Improbable.TestSchema.SomeEnum?((global::Improbable.TestSchema.SomeEnum)obj.GetEnum(3)); } component.dHandle = global::Improbable.Gdk.Core.ReferenceProvider <global::System.Collections.Generic.List <global::Improbable.TestSchema.SomeType> > .Create(); { component.D = new global::System.Collections.Generic.List <global::Improbable.TestSchema.SomeType>(); var list = component.D; var listLength = obj.GetObjectCount(4); for (var i = 0; i < listLength; i++) { list.Add(global::Improbable.TestSchema.SomeType.Serialization.Deserialize(obj.IndexObject(4, (uint)i))); } } component.eHandle = global::Improbable.Gdk.Core.ReferenceProvider <global::System.Collections.Generic.Dictionary <global::Improbable.TestSchema.SomeEnum, global::Improbable.TestSchema.SomeType> > .Create(); { var map = new global::System.Collections.Generic.Dictionary <global::Improbable.TestSchema.SomeEnum, global::Improbable.TestSchema.SomeType>(); var mapSize = obj.GetObjectCount(5); component.E = map; for (var i = 0; i < mapSize; i++) { var mapObj = obj.IndexObject(5, (uint)i); var key = (global::Improbable.TestSchema.SomeEnum)mapObj.GetEnum(1); var value = global::Improbable.TestSchema.SomeType.Serialization.Deserialize(mapObj.GetObject(2)); map.Add(key, value); } } return(component); }
public static Improbable.Gdk.Tests.AlternateSchemaSyntax.Connection.Component Deserialize(global::Improbable.Worker.Core.SchemaObject obj, global::Unity.Entities.World world) { var component = new Improbable.Gdk.Tests.AlternateSchemaSyntax.Connection.Component(); return(component); }
public static void SerializeComponent(Improbable.Gdk.Tests.ComponentsWithNoFields.ComponentWithNoFieldsWithEvents.Component component, global::Improbable.Worker.CInterop.SchemaObject obj, global::Unity.Entities.World world) { }
public static void SerializeComponent(global::Improbable.Restricted.Worker.Component component, global::Improbable.Worker.CInterop.SchemaObject obj, global::Unity.Entities.World world) { obj.AddString(1, component.WorkerId); obj.AddString(2, component.WorkerType); global::Improbable.Restricted.Connection.Serialization.Serialize(component.Connection, obj.AddObject(3)); }