Exemplo n.º 1
0
 public virtual void Update(SerializableNotification notification)
 {
     foreach (var component in Components)
     {
         component?.OnUpdate(notification);
     }
 }
Exemplo n.º 2
0
 public void OnUpdate(SerializableNotification notification)
 {
     if (!IsServerSide)
     {
         ResourceManager.UpdateHub.Push(notification, DefaultChannels.Network);
     }
 }
Exemplo n.º 3
0
 public void OnUpdate(SerializableNotification notification)
 {
     if (notification is ChunkNotification chunkNotification)
     {
         chunkNotification.ChunkColumnIndex = Index;
         globalChunkCache.OnUpdate(notification);
     }
 }
Exemplo n.º 4
0
 public void Update(SerializableNotification notification)
 {
     if (notification is ChunkNotification chunkNotification &&
         cache.TryGetValue(new Index3(chunkNotification.ChunkColumnIndex, chunkNotification.Planet),
                           out var cacheItem))
     {
         cacheItem.ChunkColumn.Update(notification);
     }
 }
Exemplo n.º 5
0
 public void Update(SerializableNotification notification)
 {
     if (notification is IChunkNotification chunkNotification)
     {
         Chunks
         .FirstOrDefault(c => c.Index == chunkNotification.ChunkPos)?
         .Update(notification);
     }
 }
Exemplo n.º 6
0
 public void Update(SerializableNotification notification)
 {
     if (notification is ChunkNotification chunkNotification)
     {
         Blocks[chunkNotification.FlatIndex]   = chunkNotification.Block;
         MetaData[chunkNotification.FlatIndex] = chunkNotification.Meta;
         ChangeCounter++;
         Changed?.Invoke(this, ChangeCounter);
     }
 }
Exemplo n.º 7
0
        => base.Deserialize(reader, definitionManager);     // Entity

        public override void OnUpdate(SerializableNotification notification)
        {
            base.OnUpdate(notification);

            var entityNotification = new EntityNotification
            {
                Entity       = this,
                Type         = EntityNotification.ActionType.Update,
                Notification = notification as PropertyChangedNotification
            };

            Simulation?.OnUpdate(entityNotification);
        }
Exemplo n.º 8
0
        => base.Deserialize(reader);     // Entity

        public override void OnUpdate(SerializableNotification notification)
        {
            base.OnUpdate(notification);

            var entityNotification = entityNotificationPool.Get();

            entityNotification.Entity       = this;
            entityNotification.Type         = EntityNotification.ActionType.Update;
            entityNotification.Notification = notification as PropertyChangedNotification;

            Simulation?.OnUpdate(entityNotification);
            entityNotification.Release();
        }
Exemplo n.º 9
0
        public void Update(SerializableNotification notification)
        {
            if (notification is BlockChangedNotification blockChanged)
            {
                var flatIndex = GetFlatIndex(blockChanged.BlockInfo.Position);
                Blocks[flatIndex]   = blockChanged.BlockInfo.Block;
                MetaData[flatIndex] = blockChanged.BlockInfo.Meta;
                Changed?.Invoke(this);
            }
            else if (notification is BlocksChangedNotification blocksChanged)
            {
                foreach (var block in blocksChanged.BlockInfos)
                {
                    var flatIndex = GetFlatIndex(block.Position);
                    Blocks[flatIndex]   = block.Block;
                    MetaData[flatIndex] = block.Meta;
                }

                Changed?.Invoke(this);
            }
        }
Exemplo n.º 10
0
 protected virtual void Update(SerializableNotification notification)
 {
     Entity?.OnUpdate(notification);
 }
Exemplo n.º 11
0
 public virtual void OnUpdate(SerializableNotification notification)
 {
 }
Exemplo n.º 12
0
 public void OnUpdate(SerializableNotification notification)
 => chunkColumn?.OnUpdate(notification);
Exemplo n.º 13
0
 public void Update(SerializableNotification notification) => throw new NotImplementedException();
Exemplo n.º 14
0
 public void OnUpdate(SerializableNotification notification)
 => updateHub?.Push(notification, DefaultChannels.Network);
Exemplo n.º 15
0
 public void OnUpdate(SerializableNotification notification)
 {
     globalChunkCache.OnUpdate(notification);
 }