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


C# IValueWriter.WriteMany方法代码示例

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


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

示例1: SaveGrhs

        /// <summary>
        /// Writes all the MapGrhs to an <see cref="IValueWriter"/>.
        /// </summary>
        /// <param name="w">IValueWriter to write to.</param>
        void SaveGrhs(IValueWriter w)
        {
            w.WriteStartNode(_mapGrhsNodeName);
            {
                // Used GrhIndexes
                w.WriteMany(_usedIndiciesNodeName, GetMapGrhList(), w.Write);

                // MapGrhs
                w.WriteManyNodes(_mapGrhsNodeName, Spatial.GetMany<MapGrh>().Distinct(),
                    ((writer, item) => item.WriteState(writer)));
            }
            w.WriteEndNode(_mapGrhsNodeName);
        }
开发者ID:mateuscezar,项目名称:netgore,代码行数:17,代码来源:Map.cs

示例2: WriteToolBarItems

        /// <summary>
        /// Writes the items in a <see cref="ToolBar"/>.
        /// </summary>
        /// <param name="writer">The <see cref="IValueWriter"/> to write to.</param>
        /// <param name="tb">The <see cref="ToolBar"/> containing the items to write.</param>
        static void WriteToolBarItems(IValueWriter writer, ToolBar tb)
        {
            var tbItems = tb.GetItems().Select(x => x == null ? _separatorClassName : (GetToolKey(x.Tool) ?? _separatorClassName));

            writer.WriteEnum(_toolBarItemsKeyName, tb.ToolBarVisibility);
            writer.WriteMany(_toolBarItemsValueName, tbItems, writer.Write);
        }
开发者ID:mateuscezar,项目名称:netgore,代码行数:12,代码来源:ToolStateManager.cs

示例3: 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

示例4: 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)
        {
            var frameIndices = _frames.Select(x => x.GrhIndex).ToArray();

            writer.Write(_speedValueKey, (int)(1f / Speed));
            writer.WriteMany(_framesNodeName, frameIndices, writer.Write);
        }
开发者ID:wtfcolt,项目名称:game,代码行数:12,代码来源:AnimatedGrhData.cs


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