Esempio n. 1
0
        public override void Deserialize(MyObjectBuilder_EntityComponent bbase)
        {
            var ob = (MyObjectBuilder_ConstructableComponent)bbase;

            if (!string.IsNullOrEmpty(ob.SPacked))
            {
                try
                {
                    var stream = new MemStream(Convert.FromBase64String(ob.SPacked));
                    if (_stockpile == null)
                    {
                        _stockpile = new ConstructionStockpile();
                    }
                    _stockpile.Items.Clear();
                    var count = (int)stream.Read7BitEncoded();
                    for (var i = 0; i < count; i++)
                    {
                        _stockpile.AddItem(Controller.Decode((int)stream.Read7BitEncoded()),
                                           (int)stream.Read7BitEncoded());
                    }
                }
                catch (Exception e)
                {
                    this.GetLogger().Warning($"Failed to deserialize packed stockpile data {e}");
                }
            }
            else
            {
                _stockpile?.Clear();
            }

            BuildIntegrity = ob.BInteg;
        }
        public override void Deserialize(MyObjectBuilder_EntityComponent builder)
        {
            base.Deserialize(builder);

            var ob = builder as MyObjectBuilder_MrzEquipmentSpawnerComponent;

            _spawned = ob.Spawned;
        }
        public override void Deserialize(MyObjectBuilder_EntityComponent builder)
        {
            base.Deserialize(builder);

            var ob = builder as MyObjectBuilder_MrzDailyQuestComponent;

            _lastTrigger = ob.LastTrigger;

            if (ob.ActiveQuests == null || ob.ActiveQuests.Count == 0)
            {
                return;
            }

            foreach (var quest in ob.ActiveQuests)
            {
                _activeQuests.Add(MyStringHash.GetOrCompute(quest));
            }
        }
        public override void Deserialize(MyObjectBuilder_EntityComponent bbase)
        {
            base.Deserialize(bbase);
            var ob = (MyObjectBuilder_BendyComponent)bbase;

            _movableNodeData.Clear();
            if (ob.Overrides != null)
            {
                foreach (var k in ob.Overrides)
                {
                    _movableNodeData[k.Index] = k;
                }
            }

            if (Entity != null && Entity.InScene)
            {
                ReloadNodesAndEdges();
            }
        }
Esempio n. 5
0
 public override void Deserialize(MyObjectBuilder_EntityComponent builder)
 {
     base.Deserialize(builder);
     _nodeSwitchData = ((MyObjectBuilder_RailSegmentComponent)builder).Switched;
     ApplySwitchTable();
 }
Esempio n. 6
0
 public override void Deserialize(MyObjectBuilder_EntityComponent builder)
 {
     base.Deserialize(builder);
     (builder as MyObjectBuilder_EquiEntityControllerComponent)?.CopyTo(_saveData);
 }