Exemplo n.º 1
0
            public override void OnComponentUpdate(ComponentUpdateOp op)
            {
                if (!IsValidEntityId(op.EntityId, "OnComponentUpdate", out var entity))
                {
                    return;
                }

                if (entityManager.HasComponent <NotAuthoritative <Generated.Improbable.Gdk.Tests.ComponentsWithNoFields.ComponentWithNoFieldsWithCommands.Component> >(entity))
                {
                    var data = entityManager.GetComponentData <Generated.Improbable.Gdk.Tests.ComponentsWithNoFields.ComponentWithNoFieldsWithCommands.Component>(entity);

                    var update = Generated.Improbable.Gdk.Tests.ComponentsWithNoFields.ComponentWithNoFieldsWithCommands.Serialization.GetAndApplyUpdate(op.Update.SchemaData.Value.GetFields(), ref data);

                    List <Generated.Improbable.Gdk.Tests.ComponentsWithNoFields.ComponentWithNoFieldsWithCommands.Update> updates;
                    if (entityManager.HasComponent <Generated.Improbable.Gdk.Tests.ComponentsWithNoFields.ComponentWithNoFieldsWithCommands.ReceivedUpdates>(entity))
                    {
                        updates = entityManager.GetComponentData <Generated.Improbable.Gdk.Tests.ComponentsWithNoFields.ComponentWithNoFieldsWithCommands.ReceivedUpdates>(entity).Updates;
                    }
                    else
                    {
                        var updatesComponent = new Generated.Improbable.Gdk.Tests.ComponentsWithNoFields.ComponentWithNoFieldsWithCommands.ReceivedUpdates
                        {
                            handle = ReferenceTypeProviders.UpdatesProvider.Allocate(World)
                        };
                        ReferenceTypeProviders.UpdatesProvider.Set(updatesComponent.handle, new List <Generated.Improbable.Gdk.Tests.ComponentsWithNoFields.ComponentWithNoFieldsWithCommands.Update>());
                        updates = updatesComponent.Updates;
                        entityManager.AddComponentData(entity, updatesComponent);
                    }

                    updates.Add(update);

                    data.DirtyBit = false;
                    entityManager.SetComponentData(entity, data);
                }
            }
            public override void OnComponentUpdate(ComponentUpdateOp op)
            {
                var entity = TryGetEntityFromEntityId(op.EntityId);

                if (entityManager.HasComponent <NotAuthoritative <Improbable.Gdk.Tests.ExhaustiveOptional.Component> >(entity))
                {
                    var data = entityManager.GetComponentData <Improbable.Gdk.Tests.ExhaustiveOptional.Component>(entity);
                    Improbable.Gdk.Tests.ExhaustiveOptional.Serialization.ApplyUpdate(op.Update.SchemaData.Value, ref data);
                    data.DirtyBit = false;
                    entityManager.SetComponentData(entity, data);
                }

                var update = Improbable.Gdk.Tests.ExhaustiveOptional.Serialization.DeserializeUpdate(op.Update.SchemaData.Value);

                List <Improbable.Gdk.Tests.ExhaustiveOptional.Update> updates;

                if (entityManager.HasComponent <Improbable.Gdk.Tests.ExhaustiveOptional.ReceivedUpdates>(entity))
                {
                    updates = entityManager.GetComponentData <Improbable.Gdk.Tests.ExhaustiveOptional.ReceivedUpdates>(entity).Updates;
                }
                else
                {
                    var updatesComponent = new Improbable.Gdk.Tests.ExhaustiveOptional.ReceivedUpdates
                    {
                        handle = ReferenceTypeProviders.UpdatesProvider.Allocate(World)
                    };
                    ReferenceTypeProviders.UpdatesProvider.Set(updatesComponent.handle, new List <Improbable.Gdk.Tests.ExhaustiveOptional.Update>());
                    updates = updatesComponent.Updates;
                    entityManager.AddComponentData(entity, updatesComponent);
                }

                updates.Add(update);
            }
            public void AddUpdateToDiff(ComponentUpdateOp op, ViewDiff diff, uint updateId)
            {
                var update = global::Improbable.Gdk.Tests.BlittableTypes.BlittableComponent.Serialization.DeserializeUpdate(op.Update.SchemaData.Value);

                diff.AddComponentUpdate(update, op.EntityId, op.Update.ComponentId, updateId);
                var eventsObject = op.Update.SchemaData.Value.GetEvents();

                {
                    var eventCount = eventsObject.GetObjectCount(1);
                    if (eventCount > 0)
                    {
                        for (uint i = 0; i < eventCount; i++)
                        {
                            var payload = global::Improbable.Gdk.Tests.BlittableTypes.FirstEventPayload.Serialization.Deserialize(eventsObject.IndexObject(1, i));
                            var e       = new FirstEvent.Event(payload);
                            diff.AddEvent(e, op.EntityId, op.Update.ComponentId, updateId);
                        }
                    }
                }

                {
                    var eventCount = eventsObject.GetObjectCount(2);
                    if (eventCount > 0)
                    {
                        for (uint i = 0; i < eventCount; i++)
                        {
                            var payload = global::Improbable.Gdk.Tests.BlittableTypes.SecondEventPayload.Serialization.Deserialize(eventsObject.IndexObject(2, i));
                            var e       = new SecondEvent.Event(payload);
                            diff.AddEvent(e, op.EntityId, op.Update.ComponentId, updateId);
                        }
                    }
                }
            }
Exemplo n.º 4
0
 public void OnCheckOutComponentUpdated(ComponentUpdateOp <Improbable.Demo.CheckOutColor> op)
 {
     if (op.Update.Get().ping.Count > 0)
     {
         connection.SendCommandRequest(op.EntityId, new CheckOutColor.Commands.SendColorId.Request(thisWorkerColorId), 300);
     }
 }
Exemplo n.º 5
0
 static void OnControllerUpdated(ComponentUpdateOp <MappingController.Update> op)
 {
     if (op.Update.recordingIndex.HasValue)
     {
         recordingIndices[op.EntityId.Id] = op.Update.recordingIndex.Value;
     }
 }
Exemplo n.º 6
0
 public void OnTurretInfoComponentUpdated(ComponentUpdateOp <Improbable.Demo.TurretInfo> op)
 {
     if (op.Update.Get().rotation.HasValue)
     {
         checkOutTurretRotations[op.EntityId] = op.Update.Get().rotation.Value;
     }
 }
Exemplo n.º 7
0
    private void OnPlayerUpdate(ComponentUpdateOp <Automaton.Player.Player> op)
    {
        if (op.EntityId != _entityId)
        {
            return;
        }
        IComponentUpdate <Automaton.Player.Player> update = op.Update;

        Automaton.Player.Player.Update u = update.Get();
        if (u.heartbeat.Count > 0)
        {
            _lastHeartbeat = Environment.TickCount;
        }
        if (u.killedPlayer.Count > 0)
        {
            foreach (var kp in u.killedPlayer)
            {
                var    killedEntity = kp.killed;
                Player player       = _game.GetPlayer(killedEntity);
                if (player == null)
                {
                    Console.WriteLine("Failed to find player ({0}) to kill", killedEntity);
                }
                else
                {
                    _score.AddKill();
                    player._score.AddDeath();
                }
            }
        }
    }
            public override void OnComponentUpdate(ComponentUpdateOp op)
            {
                if (!IsValidEntityId(op.EntityId, "OnComponentUpdate", out var entity))
                {
                    return;
                }

                var data = entityManager.GetComponentData <SpatialOSExhaustiveSingular>(entity);

                var update = global::Generated.Improbable.Gdk.Tests.SpatialOSExhaustiveSingular.Serialization.GetAndApplyUpdate(op.Update.SchemaData.Value.GetFields(), ref data);

                List <SpatialOSExhaustiveSingular.Update> updates;

                if (entityManager.HasComponent <SpatialOSExhaustiveSingular.ReceivedUpdates>(entity))
                {
                    updates = entityManager.GetComponentData <SpatialOSExhaustiveSingular.ReceivedUpdates>(entity).Updates;
                }
                else
                {
                    var updatesComponent = new SpatialOSExhaustiveSingular.ReceivedUpdates
                    {
                        handle = ReferenceTypeProviders.UpdatesProvider.Allocate(World)
                    };
                    ReferenceTypeProviders.UpdatesProvider.Set(updatesComponent.handle, new List <SpatialOSExhaustiveSingular.Update>());
                    updates = updatesComponent.Updates;
                    entityManager.AddComponentData(entity, updatesComponent);
                }

                updates.Add(update);

                data.DirtyBit = false;
                entityManager.SetComponentData(entity, data);
            }
            public void AddUpdateToDiff(ComponentUpdateOp op, ViewDiff diff, uint updateId)
            {
                var update = Improbable.Gdk.Health.HealthComponent.Serialization.DeserializeUpdate(op.Update.SchemaData.Value);

                diff.AddComponentUpdate(update, op.EntityId, op.Update.ComponentId, updateId);
                var eventsObject = op.Update.SchemaData.Value.GetEvents();

                {
                    var eventCount = eventsObject.GetObjectCount(1);
                    if (eventCount > 0)
                    {
                        for (uint i = 0; i < eventCount; i++)
                        {
                            var payload = global::Improbable.Gdk.Health.HealthModifiedInfo.Serialization.Deserialize(eventsObject.IndexObject(1, i));
                            var e       = new HealthModified.Event(payload);
                            diff.AddEvent(e, op.EntityId, op.Update.ComponentId, updateId);
                        }
                    }
                }

                {
                    var eventCount = eventsObject.GetObjectCount(2);
                    if (eventCount > 0)
                    {
                        for (uint i = 0; i < eventCount; i++)
                        {
                            var payload = global::Improbable.Common.Empty.Serialization.Deserialize(eventsObject.IndexObject(2, i));
                            var e       = new Respawn.Event(payload);
                            diff.AddEvent(e, op.EntityId, op.Update.ComponentId, updateId);
                        }
                    }
                }
            }
Exemplo n.º 10
0
 private void UpdateComponent(ComponentUpdateOp <T> update)
 {
     if (!HasAuthority(update.EntityId) && _components.ContainsKey(update.EntityId))
     {
         update.Update.ApplyTo(_components[update.EntityId]);
         _hasUpdated = true;
     }
 }
Exemplo n.º 11
0
        static void OnComponentUpdated(ComponentUpdateOp <ExplorationPhysics.Update> op)
        {
            var data = components[op.EntityId.Id];

            op.Update.ApplyTo(ref data);

            components[op.EntityId.Id] = data;
        }
Exemplo n.º 12
0
        static void OnComponentUpdated(ComponentUpdateOp <Identification.Update> op)
        {
            var data = components[op.EntityId.Id];

            op.Update.ApplyTo(ref data);

            components[op.EntityId.Id] = data;
        }
 public void AddUpdateToDiff(ComponentUpdateOp op, ViewDiff diff, uint updateId)
 {
     if (op.Update.SchemaData.Value.GetFields().GetUniqueFieldIdCount() + op.Update.SchemaData.Value.GetClearedFieldCount() > 0)
     {
         var update = global::Improbable.Position.Serialization.DeserializeUpdate(op.Update.SchemaData.Value);
         diff.AddComponentUpdate(update, op.EntityId, op.Update.ComponentId, updateId);
     }
 }
Exemplo n.º 14
0
        private void UpdateComponent(EntityId entityId, Position.Update update)
        {
            var componentUpdateOps = new ComponentUpdateOp <Position>
            {
                EntityId = entityId,
                Update   = update
            };

            _updateComponentCallback(componentUpdateOps);
        }
Exemplo n.º 15
0
        internal void OnComponentUpdate(ComponentUpdateOp op)
        {
            if (!componentSpecificDispatchers.TryGetValue(op.Update.ComponentId, out var specificDispatcher))
            {
                throw new UnknownComponentIdException(
                          string.Format(Errors.UnknownComponentIdError, op.GetType(), op.Update.ComponentId));
            }

            specificDispatcher.OnComponentUpdate(op);
        }
Exemplo n.º 16
0
        public static WrappedOp <ComponentUpdateOp> CreateComponentUpdateOp(long entityId, uint componentId)
        {
            var schemaComponentUpdate = new SchemaComponentUpdate(componentId);
            var op = new ComponentUpdateOp
            {
                Update   = new ComponentUpdate(schemaComponentUpdate),
                EntityId = new EntityId(entityId)
            };

            return(new WrappedOp <ComponentUpdateOp>(op));
        }
Exemplo n.º 17
0
        private void OnComponentUpdate(ComponentUpdateOp op)
        {
            if (!componentSpecificDispatchers.TryGetValue(op.Update.ComponentId, out var specificDispatcher))
            {
                worker.LogDispatcher.HandleLog(LogType.Error,
                                               new LogEvent(UnknownComponentIdError).WithField("Op Type", op.GetType())
                                               .WithField("ComponentId", op.Update.ComponentId));
                return;
            }

            specificDispatcher.OnComponentUpdate(op);
        }
            public void AddUpdateToDiff(ComponentUpdateOp op, ViewDiff diff, uint updateId)
            {
                var update = global::Improbable.DependentSchema.DependentDataComponent.Serialization.DeserializeUpdate(op.Update.SchemaData.Value);

                diff.AddComponentUpdate(update, op.EntityId, op.Update.ComponentId, updateId);
                var eventsObject = op.Update.SchemaData.Value.GetEvents();

                {
                    var eventCount = eventsObject.GetObjectCount(1);
                    if (eventCount > 0)
                    {
                        for (uint i = 0; i < eventCount; i++)
                        {
                            var payload = global::Improbable.TestSchema.SomeType.Serialization.Deserialize(eventsObject.IndexObject(1, i));
                            var e       = new FooEvent.Event(payload);
                            diff.AddEvent(e, op.EntityId, op.Update.ComponentId, updateId);
                        }
                    }
                }
            }
            public void AddUpdateToDiff(ComponentUpdateOp op, ViewDiff diff, uint updateId)
            {
                var update = Improbable.Gdk.Tests.ComponentsWithNoFields.ComponentWithNoFieldsWithEvents.Serialization.DeserializeUpdate(op.Update.SchemaData.Value);

                diff.AddComponentUpdate(update, op.EntityId, op.Update.ComponentId, updateId);
                var eventsObject = op.Update.SchemaData.Value.GetEvents();

                {
                    var eventCount = eventsObject.GetObjectCount(1);
                    if (eventCount > 0)
                    {
                        for (uint i = 0; i < eventCount; i++)
                        {
                            var payload = global::Improbable.Gdk.Tests.ComponentsWithNoFields.Empty.Serialization.Deserialize(eventsObject.IndexObject(1, i));
                            var e       = new Evt.Event(payload);
                            diff.AddEvent(e, op.EntityId, op.Update.ComponentId, updateId);
                        }
                    }
                }
            }
            public void AddUpdateToDiff(ComponentUpdateOp op, ViewDiff diff, uint updateId)
            {
                var update = global::Improbable.Gdk.Tests.AlternateSchemaSyntax.Connection.Serialization.DeserializeUpdate(op.Update.SchemaData.Value);

                diff.AddComponentUpdate(update, op.EntityId, op.Update.ComponentId, updateId);
                var eventsObject = op.Update.SchemaData.Value.GetEvents();

                {
                    var eventCount = eventsObject.GetObjectCount(1);
                    if (eventCount > 0)
                    {
                        for (uint i = 0; i < eventCount; i++)
                        {
                            var payload = global::Improbable.Gdk.Tests.AlternateSchemaSyntax.RandomDataType.Serialization.Deserialize(eventsObject.IndexObject(1, i));
                            var e       = new MyEvent.Event(payload);
                            diff.AddEvent(e, op.EntityId, op.Update.ComponentId, updateId);
                        }
                    }
                }
            }
            public void OnComponentUpdate(ComponentUpdateOp <global::Improbable.Gdk.Tests.NestedComponent> op)
            {
                Unity.Entities.Entity entity;
                if (!view.TryGetEntity(op.EntityId.Id, out entity))
                {
                    LogDispatcher.HandleLog(LogType.Error, new LogEvent("Entity not found during OnComponentUpdate.")
                                            .WithField(LoggingUtils.LoggerName, LoggerName)
                                            .WithField(LoggingUtils.EntityId, op.EntityId.Id)
                                            .WithField(MutableView.Component, "SpatialOSNestedComponent"));
                    return;
                }

                var componentData = view.GetComponent <SpatialOSNestedComponent>(entity);
                var update        = op.Update.Get();

                if (view.HasComponent <NotAuthoritative <SpatialOSNestedComponent> >(entity))
                {
                    if (update.nestedType.HasValue)
                    {
                        componentData.NestedType = global::Generated.Improbable.Gdk.Tests.TypeName.ToNative(update.nestedType.Value);
                    }
                }

                componentData.DirtyBit = false;

                view.SetComponentData(entity, componentData);

                var componentFieldsUpdated = false;
                var gdkUpdate = new SpatialOSNestedComponent.Update();

                if (update.nestedType.HasValue)
                {
                    componentFieldsUpdated = true;
                    gdkUpdate.NestedType   = new Option <global::Generated.Improbable.Gdk.Tests.TypeName>(global::Generated.Improbable.Gdk.Tests.TypeName.ToNative(update.nestedType.Value));
                }

                if (componentFieldsUpdated)
                {
                    view.AddComponentsUpdated(entity, gdkUpdate, UpdatesPool);
                }
            }
Exemplo n.º 22
0
            public override void OnComponentUpdate(ComponentUpdateOp op)
            {
                var entity = TryGetEntityFromEntityId(op.EntityId);

                Profiler.BeginSample("NestedComponent");
                if (entityManager.HasComponent <NotAuthoritative <Improbable.Gdk.Tests.NestedComponent.Component> >(entity))
                {
                    var data = entityManager.GetComponentData <Improbable.Gdk.Tests.NestedComponent.Component>(entity);
                    Improbable.Gdk.Tests.NestedComponent.Serialization.ApplyUpdate(op.Update.SchemaData.Value, ref data);
                    data.DirtyBit = false;
                    entityManager.SetComponentData(entity, data);
                }

                var update = Improbable.Gdk.Tests.NestedComponent.Serialization.DeserializeUpdate(op.Update.SchemaData.Value);

                List <Improbable.Gdk.Tests.NestedComponent.Update> updates;

                if (entityManager.HasComponent <Improbable.Gdk.Tests.NestedComponent.ReceivedUpdates>(entity))
                {
                    updates = entityManager.GetComponentData <Improbable.Gdk.Tests.NestedComponent.ReceivedUpdates>(entity).Updates;
                }
                else
                {
                    updates = Improbable.Gdk.Tests.NestedComponent.Update.Pool.Count > 0 ? Improbable.Gdk.Tests.NestedComponent.Update.Pool.Pop() : new List <Improbable.Gdk.Tests.NestedComponent.Update>();
                    var updatesComponent = new Improbable.Gdk.Tests.NestedComponent.ReceivedUpdates
                    {
                        handle = ReferenceTypeProviders.UpdatesProvider.Allocate(World)
                    };
                    ReferenceTypeProviders.UpdatesProvider.Set(updatesComponent.handle, updates);
                    entityManager.AddComponentData(entity, updatesComponent);
                }

                updates.Add(update);

                Profiler.EndSample();
            }
            public override void OnComponentUpdate(ComponentUpdateOp op)
            {
                var entity = TryGetEntityFromEntityId(op.EntityId);

                if (entityManager.HasComponent <NotAuthoritative <Improbable.Gdk.Tests.ComponentsWithNoFields.ComponentWithNoFieldsWithEvents.Component> >(entity))
                {
                    var data = entityManager.GetComponentData <Improbable.Gdk.Tests.ComponentsWithNoFields.ComponentWithNoFieldsWithEvents.Component>(entity);
                    Improbable.Gdk.Tests.ComponentsWithNoFields.ComponentWithNoFieldsWithEvents.Serialization.ApplyUpdate(op.Update.SchemaData.Value, ref data);
                    data.DirtyBit = false;
                    entityManager.SetComponentData(entity, data);
                }

                var update = Improbable.Gdk.Tests.ComponentsWithNoFields.ComponentWithNoFieldsWithEvents.Serialization.DeserializeUpdate(op.Update.SchemaData.Value);

                List <Improbable.Gdk.Tests.ComponentsWithNoFields.ComponentWithNoFieldsWithEvents.Update> updates;

                if (entityManager.HasComponent <Improbable.Gdk.Tests.ComponentsWithNoFields.ComponentWithNoFieldsWithEvents.ReceivedUpdates>(entity))
                {
                    updates = entityManager.GetComponentData <Improbable.Gdk.Tests.ComponentsWithNoFields.ComponentWithNoFieldsWithEvents.ReceivedUpdates>(entity).Updates;
                }
                else
                {
                    var updatesComponent = new Improbable.Gdk.Tests.ComponentsWithNoFields.ComponentWithNoFieldsWithEvents.ReceivedUpdates
                    {
                        handle = ReferenceTypeProviders.UpdatesProvider.Allocate(World)
                    };
                    ReferenceTypeProviders.UpdatesProvider.Set(updatesComponent.handle, new List <Improbable.Gdk.Tests.ComponentsWithNoFields.ComponentWithNoFieldsWithEvents.Update>());
                    updates = updatesComponent.Updates;
                    entityManager.AddComponentData(entity, updatesComponent);
                }

                updates.Add(update);

                var eventsObject = op.Update.SchemaData.Value.GetEvents();
                {
                    var eventCount = eventsObject.GetObjectCount(1);
                    if (eventCount > 0)
                    {
                        // Create component to hold received events
                        ReceivedEvents.Evt eventsReceived;
                        List <global::Improbable.Gdk.Tests.ComponentsWithNoFields.Empty> eventList;
                        if (!entityManager.HasComponent <ReceivedEvents.Evt>(entity))
                        {
                            eventsReceived = new ReceivedEvents.Evt()
                            {
                                handle = ReferenceTypeProviders.EvtProvider.Allocate(World)
                            };
                            eventList = new List <global::Improbable.Gdk.Tests.ComponentsWithNoFields.Empty>((int)eventCount);
                            ReferenceTypeProviders.EvtProvider.Set(eventsReceived.handle, eventList);
                            entityManager.AddComponentData(entity, eventsReceived);
                        }
                        else
                        {
                            eventsReceived = entityManager.GetComponentData <ReceivedEvents.Evt>(entity);
                            eventList      = eventsReceived.Events;
                        }

                        // Deserialize events onto component
                        for (var i = 0; i < eventCount; i++)
                        {
                            var e = global::Improbable.Gdk.Tests.ComponentsWithNoFields.Empty.Serialization.Deserialize(eventsObject.GetObject(1));
                            eventList.Add(e);
                        }
                    }
                }
            }
            public void OnComponentUpdate(ComponentUpdateOp <global::Improbable.Gdk.Tests.ExhaustiveOptional> op)
            {
                Unity.Entities.Entity entity;
                if (!view.TryGetEntity(op.EntityId.Id, out entity))
                {
                    LogDispatcher.HandleLog(LogType.Error, new LogEvent("Entity not found during OnComponentUpdate.")
                                            .WithField(LoggingUtils.LoggerName, LoggerName)
                                            .WithField(LoggingUtils.EntityId, op.EntityId.Id)
                                            .WithField(MutableView.Component, "SpatialOSExhaustiveOptional"));
                    return;
                }

                var componentData = view.GetComponentObject <SpatialOSExhaustiveOptional>(entity);
                var update        = op.Update.Get();

                if (view.HasComponent <NotAuthoritative <SpatialOSExhaustiveOptional> >(entity))
                {
                    if (update.field2.HasValue)
                    {
                        componentData.Field2 = update.field2.Value.HasValue ? new global::System.Nullable <float>(update.field2.Value.Value) : new global::System.Nullable <float>();
                    }
                    if (update.field4.HasValue)
                    {
                        componentData.Field4 = update.field4.Value.HasValue ? new global::System.Nullable <int>(update.field4.Value.Value) : new global::System.Nullable <int>();
                    }
                    if (update.field5.HasValue)
                    {
                        componentData.Field5 = update.field5.Value.HasValue ? new global::System.Nullable <long>(update.field5.Value.Value) : new global::System.Nullable <long>();
                    }
                    if (update.field6.HasValue)
                    {
                        componentData.Field6 = update.field6.Value.HasValue ? new global::System.Nullable <double>(update.field6.Value.Value) : new global::System.Nullable <double>();
                    }
                    if (update.field8.HasValue)
                    {
                        componentData.Field8 = update.field8.Value.HasValue ? new global::System.Nullable <uint>(update.field8.Value.Value) : new global::System.Nullable <uint>();
                    }
                    if (update.field9.HasValue)
                    {
                        componentData.Field9 = update.field9.Value.HasValue ? new global::System.Nullable <ulong>(update.field9.Value.Value) : new global::System.Nullable <ulong>();
                    }
                    if (update.field10.HasValue)
                    {
                        componentData.Field10 = update.field10.Value.HasValue ? new global::System.Nullable <int>(update.field10.Value.Value) : new global::System.Nullable <int>();
                    }
                    if (update.field11.HasValue)
                    {
                        componentData.Field11 = update.field11.Value.HasValue ? new global::System.Nullable <long>(update.field11.Value.Value) : new global::System.Nullable <long>();
                    }
                    if (update.field12.HasValue)
                    {
                        componentData.Field12 = update.field12.Value.HasValue ? new global::System.Nullable <uint>(update.field12.Value.Value) : new global::System.Nullable <uint>();
                    }
                    if (update.field13.HasValue)
                    {
                        componentData.Field13 = update.field13.Value.HasValue ? new global::System.Nullable <ulong>(update.field13.Value.Value) : new global::System.Nullable <ulong>();
                    }
                    if (update.field14.HasValue)
                    {
                        componentData.Field14 = update.field14.Value.HasValue ? new global::System.Nullable <int>(update.field14.Value.Value) : new global::System.Nullable <int>();
                    }
                    if (update.field15.HasValue)
                    {
                        componentData.Field15 = update.field15.Value.HasValue ? new global::System.Nullable <long>(update.field15.Value.Value) : new global::System.Nullable <long>();
                    }
                    if (update.field16.HasValue)
                    {
                        componentData.Field16 = update.field16.Value.HasValue ? new global::System.Nullable <long>(update.field16.Value.Value.Id) : new global::System.Nullable <long>();
                    }
                    if (update.field17.HasValue)
                    {
                        componentData.Field17 = update.field17.Value.HasValue ? new global::System.Nullable <global::Generated.Improbable.Gdk.Tests.SomeType>(global::Generated.Improbable.Gdk.Tests.SomeType.ToNative(update.field17.Value.Value)) : new global::System.Nullable <global::Generated.Improbable.Gdk.Tests.SomeType>();
                    }
                }

                componentData.DirtyBit = false;

                view.SetComponentObject(entity, componentData);

                var componentFieldsUpdated = false;
                var gdkUpdate = new SpatialOSExhaustiveOptional.Update();

                if (update.field2.HasValue)
                {
                    componentFieldsUpdated = true;
                    gdkUpdate.Field2       = new Option <global::System.Nullable <float> >(update.field2.Value.HasValue ? new global::System.Nullable <float>(update.field2.Value.Value) : new global::System.Nullable <float>());
                }
                if (update.field4.HasValue)
                {
                    componentFieldsUpdated = true;
                    gdkUpdate.Field4       = new Option <global::System.Nullable <int> >(update.field4.Value.HasValue ? new global::System.Nullable <int>(update.field4.Value.Value) : new global::System.Nullable <int>());
                }
                if (update.field5.HasValue)
                {
                    componentFieldsUpdated = true;
                    gdkUpdate.Field5       = new Option <global::System.Nullable <long> >(update.field5.Value.HasValue ? new global::System.Nullable <long>(update.field5.Value.Value) : new global::System.Nullable <long>());
                }
                if (update.field6.HasValue)
                {
                    componentFieldsUpdated = true;
                    gdkUpdate.Field6       = new Option <global::System.Nullable <double> >(update.field6.Value.HasValue ? new global::System.Nullable <double>(update.field6.Value.Value) : new global::System.Nullable <double>());
                }
                if (update.field8.HasValue)
                {
                    componentFieldsUpdated = true;
                    gdkUpdate.Field8       = new Option <global::System.Nullable <uint> >(update.field8.Value.HasValue ? new global::System.Nullable <uint>(update.field8.Value.Value) : new global::System.Nullable <uint>());
                }
                if (update.field9.HasValue)
                {
                    componentFieldsUpdated = true;
                    gdkUpdate.Field9       = new Option <global::System.Nullable <ulong> >(update.field9.Value.HasValue ? new global::System.Nullable <ulong>(update.field9.Value.Value) : new global::System.Nullable <ulong>());
                }
                if (update.field10.HasValue)
                {
                    componentFieldsUpdated = true;
                    gdkUpdate.Field10      = new Option <global::System.Nullable <int> >(update.field10.Value.HasValue ? new global::System.Nullable <int>(update.field10.Value.Value) : new global::System.Nullable <int>());
                }
                if (update.field11.HasValue)
                {
                    componentFieldsUpdated = true;
                    gdkUpdate.Field11      = new Option <global::System.Nullable <long> >(update.field11.Value.HasValue ? new global::System.Nullable <long>(update.field11.Value.Value) : new global::System.Nullable <long>());
                }
                if (update.field12.HasValue)
                {
                    componentFieldsUpdated = true;
                    gdkUpdate.Field12      = new Option <global::System.Nullable <uint> >(update.field12.Value.HasValue ? new global::System.Nullable <uint>(update.field12.Value.Value) : new global::System.Nullable <uint>());
                }
                if (update.field13.HasValue)
                {
                    componentFieldsUpdated = true;
                    gdkUpdate.Field13      = new Option <global::System.Nullable <ulong> >(update.field13.Value.HasValue ? new global::System.Nullable <ulong>(update.field13.Value.Value) : new global::System.Nullable <ulong>());
                }
                if (update.field14.HasValue)
                {
                    componentFieldsUpdated = true;
                    gdkUpdate.Field14      = new Option <global::System.Nullable <int> >(update.field14.Value.HasValue ? new global::System.Nullable <int>(update.field14.Value.Value) : new global::System.Nullable <int>());
                }
                if (update.field15.HasValue)
                {
                    componentFieldsUpdated = true;
                    gdkUpdate.Field15      = new Option <global::System.Nullable <long> >(update.field15.Value.HasValue ? new global::System.Nullable <long>(update.field15.Value.Value) : new global::System.Nullable <long>());
                }
                if (update.field16.HasValue)
                {
                    componentFieldsUpdated = true;
                    gdkUpdate.Field16      = new Option <global::System.Nullable <long> >(update.field16.Value.HasValue ? new global::System.Nullable <long>(update.field16.Value.Value.Id) : new global::System.Nullable <long>());
                }
                if (update.field17.HasValue)
                {
                    componentFieldsUpdated = true;
                    gdkUpdate.Field17      = new Option <global::System.Nullable <global::Generated.Improbable.Gdk.Tests.SomeType> >(update.field17.Value.HasValue ? new global::System.Nullable <global::Generated.Improbable.Gdk.Tests.SomeType>(global::Generated.Improbable.Gdk.Tests.SomeType.ToNative(update.field17.Value.Value)) : new global::System.Nullable <global::Generated.Improbable.Gdk.Tests.SomeType>());
                }

                if (componentFieldsUpdated)
                {
                    view.AddComponentsUpdated(entity, gdkUpdate, UpdatesPool);
                }
            }
Exemplo n.º 25
0
 static void OnControllerUpdate(ComponentUpdateOp <CommunicationController.Update> op) => componentUpdateOps.Enqueue(op);
Exemplo n.º 26
0
 public abstract void OnComponentUpdate(ComponentUpdateOp op);
            public void AddUpdateToDiff(ComponentUpdateOp op, ViewDiff diff, uint updateId)
            {
                var update = Improbable.PlayerLifecycle.PlayerCreator.Serialization.DeserializeUpdate(op.Update.SchemaData.Value);

                diff.AddComponentUpdate(update, op.EntityId, op.Update.ComponentId, updateId);
            }
Exemplo n.º 28
0
 static void OnComponentUpdated(ComponentUpdateOp <TriggerController.Update> op)
 {
     componentUpdateOps.Enqueue(op);
 }
Exemplo n.º 29
0
            public void AddUpdateToDiff(ComponentUpdateOp op, ViewDiff diff, uint updateId)
            {
                var update = global::Improbable.Gdk.Tests.ExhaustiveOptional.Serialization.DeserializeUpdate(op.Update.SchemaData.Value);

                diff.AddComponentUpdate(update, op.EntityId, op.Update.ComponentId, updateId);
            }
            public void AddUpdateToDiff(ComponentUpdateOp op, ViewDiff diff, uint updateId)
            {
                var update = global::Com.Infalliblecode.PlayerTransform.Serialization.DeserializeUpdate(op.Update.SchemaData.Value);

                diff.AddComponentUpdate(update, op.EntityId, op.Update.ComponentId, updateId);
            }