Ejemplo n.º 1
0
        public static SecondEventPayload ToNative(global::Improbable.Gdk.Tests.NonblittableTypes.SecondEventPayload spatialType)
        {
            var nativeType = new SecondEventPayload();

            nativeType.Field1 = spatialType.field1;
            nativeType.Field2 = spatialType.field2;
            return(nativeType);
        }
Ejemplo n.º 2
0
 public static void Serialize(SecondEventPayload instance, global::Improbable.Worker.Core.SchemaObject obj)
 {
     obj.AddFloat(1, instance.Field1);
     foreach (var value in instance.Field2)
     {
         obj.AddDouble(2, value);
     }
 }
Ejemplo n.º 3
0
            public static SecondEventPayload Deserialize(global::Improbable.Worker.Core.SchemaObject obj)
            {
                var instance = new SecondEventPayload();

                instance.Field1 = obj.GetFloat(1);
                var field2 = instance.Field2 = new global::System.Collections.Generic.List <double>();

                for (var i = 0; i < obj.GetDoubleCount(2); i++)
                {
                    field2.Add(obj.IndexDouble(2, (uint)i));
                }

                return(instance);
            }