Exemplo n.º 1
0
        /// <summary>
        /// Reads the state of the object from an <see cref="IValueReader"/>. Values should be read in the exact
        /// same order as they were written.
        /// </summary>
        /// <param name="reader">The <see cref="IValueReader"/> to read the values from.</param>
        void IPersistable.ReadState(IValueReader reader)
        {
            PersistableHelper.Read(this, reader);

            // Manually handle the WaveNoise sprite
            var grhIndex = reader.ReadGrhIndex(_valueKeyWaveNoise);

            _waveNoise.SetGrh(grhIndex);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Reads the state of the object from an <see cref="IValueReader"/>. Values should be read in the exact
        /// same order as they were written.
        /// </summary>
        /// <param name="reader">The <see cref="IValueReader"/> to read the values from.</param>
        public virtual void ReadState(IValueReader reader)
        {
            var grhIndex = reader.ReadGrhIndex(_grhIndexKeyName);

            if (!grhIndex.IsInvalid)
            {
                _grh.SetGrh(grhIndex);
            }

            PersistableHelper.Read(this, reader);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Reads the state of the object from an <see cref="IValueReader"/>. Values should be read in the exact
        /// same order as they were written.
        /// </summary>
        /// <param name="reader">The <see cref="IValueReader"/> to read the values from.</param>
        void IPersistable.ReadState(IValueReader reader)
        {
            PersistableHelper.Read(this, reader);

            /*
             * _id = reader.ReadActionDisplayID(_keyID);
             *
             * var hasSound = reader.ReadBool(_keyHasSound);
             * var soundID = reader.ReadSoundID(_keySoundID);
             * _sound = (hasSound ? soundID : (SoundID?)null);
             *
             * _script = reader.ReadString(_keyScript);
             * _grhIndex = reader.ReadGrhIndex(_keyGrhIndex);
             * _particleEffect = reader.ReadString(_keyParticleEffect);*/
        }
Exemplo n.º 4
0
        /// <summary>
        /// Reads the state of the object from an <see cref="IValueReader"/>. Values should be read in the exact
        /// same order as they were written.
        /// </summary>
        /// <param name="reader">The <see cref="IValueReader"/> to read the values from.</param>
        public void ReadState(IValueReader reader)
        {
            PersistableHelper.Read(this, reader);

            // Equipped bodies

            int count = reader.ReadByte("EquippedBodiesCount");

            _equippedBodies.Clear();

            for (var i = 0; i < count; i++)
            {
                var s = reader.ReadString("EquippedBody_" + i);
                _equippedBodies.Add(s);
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// Reads the state of the object from an <see cref="IValueReader"/>. Values should be read in the exact
        /// same order as they were written.
        /// </summary>
        /// <param name="reader">The <see cref="IValueReader"/> to read the values from.</param>
        public void ReadState(IValueReader reader)
        {
            reader = reader.ReadNode(_particleEffectNodeName);

            // Clear the emitters
            foreach (var e in _emitters.ToImmutable())
            {
                e.Dispose();
            }

            Debug.Assert(_emitters.IsEmpty());
            _emitters.Clear();

            // Read the effect properties
            PersistableHelper.Read(this, reader);

            // Read the emitters
            var readEmitters = reader.ReadManyNodes(_emittersNodeName, r => ParticleEmitterFactory.Read(r, this));

            Debug.Assert(readEmitters.All(x => x.Owner == this));
        }
 /// <summary>
 /// Reads the state of the object from an <see cref="IValueReader"/>.
 /// </summary>
 /// <param name="reader">The <see cref="IValueReader"/> to read the values from.</param>
 public virtual void ReadState(IValueReader reader)
 {
     PersistableHelper.Read(this, reader);
 }
Exemplo n.º 7
0
 /// <summary>
 /// Reads the state of the object from an <see cref="IValueReader"/>. Values should be read in the exact
 /// same order as they were written.
 /// </summary>
 /// <param name="reader">The <see cref="IValueReader"/> to read the values from.</param>
 public virtual void ReadState(IValueReader reader)
 {
     Checked = reader.ReadBool(_checkedValueKey);
     PersistableHelper.Read(this, reader);
 }
Exemplo n.º 8
0
 /// <summary>
 /// Reads the state of the object from an <see cref="IValueReader"/>. Values should be read in the exact
 /// same order as they were written.
 /// </summary>
 /// <param name="reader">The <see cref="IValueReader"/> to read the values from.</param>
 public virtual void ReadState(IValueReader reader)
 {
     Multiline = reader.ReadBool(_multilineValueKey);
     Text      = reader.ReadString(_textValueKey);
     PersistableHelper.Read(this, reader);
 }
Exemplo n.º 9
0
Arquivo: Tool.cs Projeto: wtfcolt/game
        /// <summary>
        /// Reads the state of the object from an <see cref="IValueReader"/>. Values should be read in the exact
        /// same order as they were written.
        /// </summary>
        /// <param name="reader">The <see cref="IValueReader"/> to read the values from.</param>
        public void ReadState(IValueReader reader)
        {
            PersistableHelper.Read(this, reader);

            ReadCustomToolState(reader);
        }
Exemplo n.º 10
0
 /// <summary>
 /// Reads the state of the object from an <see cref="IValueReader"/>. Values should be read in the exact
 /// same order as they were written.
 /// </summary>
 /// <param name="reader">The <see cref="IValueReader"/> to read the values from.</param>
 public virtual void ReadState(IValueReader reader)
 {
     Location = reader.ReadSystemPoint(_locationValueKey);
     Size     = reader.ReadSize(_sizeValueKey);
     PersistableHelper.Read(this, reader);
 }
Exemplo n.º 11
0
 /// <summary>
 /// Reads the state of the object from an <see cref="IValueReader"/>. Values should be read in the exact
 /// same order as they were written.
 /// </summary>
 /// <param name="reader">The <see cref="IValueReader"/> to read the values from.</param>
 void IPersistable.ReadState(IValueReader reader)
 {
     PersistableHelper.Read(this, reader);
 }