Esempio n. 1
0
        public override void ApplyPatchTo(ISnapshot snap, INetworkObjectSerializerManager serializerManager)
        {
            var baseEntity = snap.GetEntity(Key);

            foreach (var compPatch in ComponentPatchList)
            {
                compPatch.ApplyPatchTo(baseEntity, serializerManager);
            }
        }
Esempio n. 2
0
        public override void OnDiffComponent(IGameEntity leftEntity, IGameComponent leftComponent,
                                             IGameEntity rightEntity, IGameComponent rightComponent)
        {
            var localEntity    = snapshot.GetEntity(leftEntity.EntityKey);
            var localComponent = localEntity.AddComponent(rightComponent.GetComponentId());

            var comp = localComponent as IInterpolatableComponent;

            // ReSharper disable once PossibleNullReferenceException
            comp.Interpolate(leftComponent, rightComponent,
                             interpolationInfo);
        }