Пример #1
0
 public static void SerializeSnapshot(global::Improbable.TestSchema.ExhaustiveEntity.Snapshot snapshot, global::Improbable.Worker.CInterop.SchemaObject obj)
 {
     {
         obj.AddEntity(1, snapshot.Field1);
     }
     {
         if (snapshot.Field2.HasValue)
         {
             obj.AddEntity(2, snapshot.Field2.Value);
         }
     }
     {
         foreach (var value in snapshot.Field3)
         {
             obj.AddEntity(3, value);
         }
     }
     {
         foreach (var keyValuePair in snapshot.Field4)
         {
             var mapObj = obj.AddObject(4);
             mapObj.AddEntity(1, keyValuePair.Key);
             mapObj.AddString(2, keyValuePair.Value);
         }
     }
     {
         foreach (var keyValuePair in snapshot.Field5)
         {
             var mapObj = obj.AddObject(5);
             mapObj.AddString(1, keyValuePair.Key);
             mapObj.AddEntity(2, keyValuePair.Value);
         }
     }
 }
 public static void Serialize(ExhaustiveEntityData instance, global::Improbable.Worker.CInterop.SchemaObject obj)
 {
     {
         obj.AddEntity(1, instance.Field1);
     }
     {
         if (instance.Field2.HasValue)
         {
             obj.AddEntity(2, instance.Field2.Value);
         }
     }
     {
         foreach (var value in instance.Field3)
         {
             obj.AddEntity(3, value);
         }
     }
     {
         foreach (var keyValuePair in instance.Field4)
         {
             var mapObj = obj.AddObject(4);
             mapObj.AddEntity(1, keyValuePair.Key);
             mapObj.AddString(2, keyValuePair.Value);
         }
     }
     {
         foreach (var keyValuePair in instance.Field5)
         {
             var mapObj = obj.AddObject(5);
             mapObj.AddString(1, keyValuePair.Key);
             mapObj.AddEntity(2, keyValuePair.Value);
         }
     }
 }
Пример #3
0
 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);
         }
     }
 }