当前位置: 首页>>代码示例>>C#>>正文


C# IValueWriter.Write方法代码示例

本文整理汇总了C#中IValueWriter.Write方法的典型用法代码示例。如果您正苦于以下问题:C# IValueWriter.Write方法的具体用法?C# IValueWriter.Write怎么用?C# IValueWriter.Write使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IValueWriter的用法示例。


在下文中一共展示了IValueWriter.Write方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Write

 public void Write(IValueWriter writer)
 {
     writer.Write(_grhIndexValueKey, GrhIndex);
     writer.Write(_sourceValueKey, SourceName);
     writer.Write(_destValueKey, DestName);
     writer.Write(_offsetValueKey, Offset);
     writer.Write(_originValueKey, Origin);
 }
开发者ID:wtfcolt,项目名称:game,代码行数:8,代码来源:SkeletonBodyItemInfo.cs

示例2: WriteState

        /// <summary>
        /// Writes the state of the object to an <see cref="IValueWriter"/>.
        /// </summary>
        /// <param name="writer">The <see cref="IValueWriter"/> to write the values to.</param>
        public void WriteState(IValueWriter writer)
        {
            // Write the primary values
            writer.Write(_nameKeyName, Name);
            writer.Write(_blendModeKeyName, BlendMode);
            writer.Write(_budgetKeyName, Budget);
            writer.Write(_emitterLifeKeyName, EmitterLife);
            writer.Write(_particleLifeKeyName, ParticleLife);
            writer.Write(_originKeyName, Origin);
            writer.Write(_releaseAmountKeyName, ReleaseAmount);
            writer.Write(_releaseColorKeyName, ReleaseColor);
            writer.Write(_releaseRateKeyName, ReleaseRate);
            writer.Write(_releaseRotationKeyName, ReleaseRotation);
            writer.Write(_releaseScaleKeyName, ReleaseScale);
            writer.Write(_releaseSpeedKeyName, ReleaseSpeed);
            writer.Write(_grhIndexKeyName, Sprite.GrhData != null ? Sprite.GrhData.GrhIndex : GrhIndex.Invalid);

            // Write the custom values
            writer.WriteStartNode(_customValuesNodeName);
            {
                WriteCustomValues(writer);
            }
            writer.WriteEndNode(_customValuesNodeName);

            // Write the modifier collection
            ParticleModifiers.Write(_particleModifiersNodeName, writer);
            EmitterModifiers.Write(_emitterModifiersNodeName, writer);
        }
开发者ID:mateuscezar,项目名称:netgore,代码行数:32,代码来源:ParticleEmitter.cs

示例3: WriteCustomValues

 /// <summary>
 /// When overridden in the derived class, writes the values unique to this derived type to the
 /// <paramref name="writer"/>.
 /// </summary>
 /// <param name="writer">The <see cref="IValueWriter"/> to write to.</param>
 protected override void WriteCustomValues(IValueWriter writer)
 {
     writer.Write(_automaticSizeValueKey, AutomaticSize);
     writer.WriteStartNode(_textureNodeName);
     writer.Write(_textureNameValueKey, TextureName);
     writer.Write(_textureSourceValueKey, OriginalSourceRect);
     writer.WriteEndNode(_textureNodeName);
 }
开发者ID:Furt,项目名称:netgore,代码行数:13,代码来源:StationaryGrhData.cs

示例4: WriteCustomValues

 /// <summary>
 /// When overridden in the derived class, writes all custom state values to the <paramref name="writer"/>.
 /// </summary>
 /// <param name="writer">The <see cref="IValueWriter"/> to write the state values to.</param>
 protected override void WriteCustomValues(IValueWriter writer)
 {
     writer.Write(_heightKeyName, Height);
     writer.Write(_widthKeyName, Width);
     writer.Write(_perimeterKeyName, Perimeter);
 }
开发者ID:wtfcolt,项目名称:game,代码行数:10,代码来源:RectEmitter.cs

示例5: WriteCustomValues

 /// <summary>
 /// When overridden in the derived class, writes all custom state values to the <paramref name="writer"/>.
 /// </summary>
 /// <param name="writer">The <see cref="IValueWriter"/> to write the state values to.</param>
 protected override void WriteCustomValues(IValueWriter writer)
 {
     writer.Write("SerializedValue", SerializedValue);
 }
开发者ID:wtfcolt,项目名称:game,代码行数:8,代码来源:ParticleModifierTests.cs

示例6: SaveLighting

 void SaveLighting(IValueWriter w)
 {
     w.WriteStartNode(_lightingNodeName);
     {
         w.Write("Ambient", AmbientLight);
         w.WriteManyNodes(_lightsNodeName, _lights.ToArray(), (wr, l) => l.WriteState(wr));
     }
     w.WriteEndNode(_lightingNodeName);
 }
开发者ID:mateuscezar,项目名称:netgore,代码行数:9,代码来源:Map.cs

示例7: WriteState

 /// <summary>
 /// Writes the state of the object to an <see cref="IValueWriter"/>.
 /// </summary>
 /// <param name="writer">The <see cref="IValueWriter"/> to write the values to.</param>
 public virtual void WriteState(IValueWriter writer)
 {
     writer.Write(_checkedValueKey, Checked);
     PersistableHelper.Write(this, writer);
 }
开发者ID:wtfcolt,项目名称:game,代码行数:9,代码来源:PersistableCheckBox.cs

示例8: Write

        /// <summary>
        /// Writes the SkeletonNode to an IValueWriter.
        /// </summary>
        /// <param name="writer">IValueWriter to write to.</param>
        public void Write(IValueWriter writer)
        {
            writer.Write(_nameValueKey, Name);
            writer.Write(_positionValueKey, Position);
            writer.Write(_isModifierValueKey, IsModifier);
            writer.Write(_hasParentValueKey, Parent != null);

            if (Parent != null)
                writer.Write(_parentNameValueKey, Parent.Name);
        }
开发者ID:mateuscezar,项目名称:netgore,代码行数:14,代码来源:SkeletonNode.cs

示例9: Write

        /// <summary>
        /// Writes the NPCChatDialogItemBase's values to an IValueWriter.
        /// </summary>
        /// <param name="writer">IValueWriter to write the values to.</param>
        public void Write(IValueWriter writer)
        {
            writer.Write("Value", Value);
            writer.Write("Page", Page);
            writer.Write("Text", Text ?? string.Empty);
            writer.WriteMany("Actions", Actions.Select(x => x.Name), writer.Write);

            writer.WriteStartNode("Conditionals");
            {
                var c = Conditionals;
                var hasConditionals = (c != null) && (!c.IsEmpty());
                writer.Write("HasConditionals", hasConditionals);
                if (hasConditionals)
                    c.Write(writer);
            }
            writer.WriteEndNode("Conditionals");
        }
开发者ID:wtfcolt,项目名称:game,代码行数:21,代码来源:NPCChatResponseBase.cs

示例10: WriteValue

 /// <summary>
 /// Writes the audio values to an <see cref="IValueWriter"/>.
 /// </summary>
 /// <param name="w">The <see cref="IValueWriter"/> to write to.</param>
 /// <param name="value">The value to write.</param>
 static void WriteValue(IValueWriter w, KeyValuePair<string, int> value)
 {
     w.Write("File", value.Key);
     w.Write("Index", value.Value);
 }
开发者ID:mateuscezar,项目名称:netgore,代码行数:10,代码来源:AudioManager.cs

示例11: WriteCustomValues

 /// <summary>
 /// When overridden in the derived class, writes all custom state values to the <paramref name="writer"/>.
 /// </summary>
 /// <param name="writer">The <see cref="IValueWriter"/> to write the state values to.</param>
 protected override void WriteCustomValues(IValueWriter writer)
 {
     writer.Write(_closedKeyName, Closed);
     writer.Write(_scaleKeyName, Scale);
     writer.Write(_rotationKeyName, Rotation);
     writer.WriteEnum(_polygonOriginKeyName, PolygonOrigin);
     Points.Write(_pointsNodeName, writer);
 }
开发者ID:wtfcolt,项目名称:game,代码行数:12,代码来源:PolygonEmitter.cs

示例12: Write

        /// <summary>
        /// Writes a <see cref="IRefractionEffect"/> to an <see cref="IValueWriter"/>.
        /// </summary>
        /// <param name="writer">The <see cref="IValueWriter"/> to write to.</param>
        /// <param name="re">The <see cref="IRefractionEffect"/> to write.</param>
        /// <exception cref="ArgumentException"><paramref name="re"/> is not in the <see cref="ValidTypes"/>.</exception>
        /// <exception cref="ArgumentNullException"><paramref name="re"/> is null.</exception>
        /// <exception cref="ArgumentNullException"><paramref name="writer"/> is null.</exception>
        public static void Write(IValueWriter writer, IRefractionEffect re)
        {
            if (writer == null)
                throw new ArgumentNullException("writer");

            if (re == null)
                throw new ArgumentNullException("re");

            var asPersistable = re as IPersistable;

            string typeName = null;
            if (asPersistable != null)
                typeName = Instance[re.GetType()];

            if (typeName == null)
            {
                const string errmsg = "Type `{0}` is not a valid persistable IRefractionEffect type.";
                if (log.IsErrorEnabled)
                    log.ErrorFormat(errmsg, re.GetType());
                throw new ArgumentException(string.Format(errmsg, re.GetType()), "re");
            }

            writer.Write(_refractionEffectTypeKeyName, typeName);
            writer.WriteStartNode(_refractionEffectNodeName);
            {
                asPersistable.WriteState(writer);
            }
            writer.WriteEndNode(_refractionEffectNodeName);
        }
开发者ID:mateuscezar,项目名称:netgore,代码行数:37,代码来源:RefractionEffectFactory.cs

示例13: WriteState

 /// <summary>
 /// Writes the state of the object to an <see cref="IValueWriter"/>.
 /// </summary>
 /// <param name="writer">The <see cref="IValueWriter"/> to write the values to.</param>
 public void WriteState(IValueWriter writer)
 {
     writer.Write(_positionValueKey, Position);
     writer.Write(_sizeValueKey, Size);
     writer.Write(_colorValueKey, Color);
     writer.Write(_rotationValueKey, Rotation);
     writer.Write(_isEnabledValueKey, IsEnabled);
     writer.Write(_spriteValueKey, Sprite != null ? Sprite.GrhData.GrhIndex : GrhIndex.Invalid);
 }
开发者ID:mateuscezar,项目名称:netgore,代码行数:13,代码来源:Light.cs

示例14: Write

        /// <summary>
        /// Writes the NPCChatDialogItemBase's values to an IValueWriter.
        /// </summary>
        /// <param name="writer">IValueWriter to write the values to.</param>
        public void Write(IValueWriter writer)
        {
            AssertBranchHasTwoResponses();
            AssertNonBranchHasNoConditionals();
            AssertResponsesHaveValidValues();

            writer.Write("ID", ID);
            writer.Write("Title", Title ?? string.Empty);
            writer.Write("Text", Text ?? string.Empty);
            writer.Write("IsBranch", IsBranch);
            writer.WriteManyNodes("Responses", Responses, ((w, item) => item.Write(w)));

            if (IsBranch)
            {
                writer.WriteStartNode("Conditionals");
                {
                    var c = Conditionals;
                    var hasConditionals = (c != null) && (c.Count() > 0);
                    writer.Write("HasConditionals", hasConditionals);
                    if (hasConditionals)
                        c.Write(writer);
                }
                writer.WriteEndNode("Conditionals");
            }
        }
开发者ID:mateuscezar,项目名称:netgore,代码行数:29,代码来源:NPCChatDialogItemBase.cs

示例15: Write

 /// <summary>
 /// Writes the <see cref="QuickBarSlotValues"/> to an <see cref="IValueWriter"/>.
 /// </summary>
 /// <param name="w">The <see cref="IValueWriter"/> to write the values to.</param>
 public void Write(IValueWriter w)
 {
     w.Write("Slot", Slot);
     w.WriteEnum("Type", Type);
     w.Write("Value", Value);
 }
开发者ID:mateuscezar,项目名称:netgore,代码行数:10,代码来源:QuickBarForm.cs


注:本文中的IValueWriter.Write方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。