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


C# IValueReader.ReadManyNodes方法代码示例

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


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

示例1: Read

        /// <summary>
        /// Reads the values for this <see cref="NPCChatConditionalCollectionItemBase"/> from an <see cref="IValueReader"/>.
        /// </summary>
        /// <param name="reader"><see cref="IValueReader"/> to read the values from.</param>
        /// <exception cref="ArgumentException">The read <see cref="NPCChatConditionalBase"/> was invalid.</exception>
        protected void Read(IValueReader reader)
        {
            var not = reader.ReadBool("Not");
            var conditionalName = reader.ReadString("ConditionalName");
            var parameters = reader.ReadManyNodes("Parameters", NPCChatConditionalParameter.Read);

            var conditional = NPCChatConditionalBase.GetConditional(conditionalName);
            if (conditional == null)
            {
                const string errmsg = "Failed to get conditional `{0}`.";
                throw new ArgumentException(string.Format(errmsg, conditionalName), "reader");
            }

            SetReadValues(conditional, not, parameters);
        }
开发者ID:wtfcolt,项目名称:game,代码行数:20,代码来源:NPCChatConditionalCollectionItemBase.cs

示例2: LoadRefractionEffects

        void LoadRefractionEffects(IValueReader reader)
        {
            reader = reader.ReadNode(_refractionEffectsNodeName);

            _refractionEffects.Clear();

            var loadedFx = reader.ReadManyNodes(_refractionEffectListNodeName, RefractionEffectFactory.Read);

            _refractionEffects.AddRange(loadedFx);

            foreach (var fx in loadedFx)
            {
                fx.Tag = this;
            }
        }
开发者ID:mateuscezar,项目名称:netgore,代码行数:15,代码来源:Map.cs

示例3: LoadLighting

        void LoadLighting(IValueReader reader)
        {
            reader = reader.ReadNode(_lightingNodeName);

            AmbientLight = reader.ReadColor("Ambient");

            _lights.Clear();

            var loadedLights = reader.ReadManyNodes(_lightsNodeName, x => new Light(x));
            _lights.AddRange(loadedLights);

            foreach (var light in loadedLights)
            {
                light.Tag = this;
            }
        }
开发者ID:mateuscezar,项目名称:netgore,代码行数:16,代码来源:Map.cs

示例4: LoadGrhs

        void LoadGrhs(IValueReader reader)
        {
            reader = reader.ReadNode(_mapGrhsNodeName);

            // Used GrhIndexes
            var usedGrhIndexes = reader.ReadMany(_usedIndiciesNodeName, ((r, key) => r.ReadGrhIndex(key)));
            BuildAtlas(usedGrhIndexes);

            // MapGrhs
            var currentTime = GetTime();
            var loadedMapGrhs = reader.ReadManyNodes(_mapGrhsNodeName, x => new MapGrh(x, currentTime));
            foreach (var mapGrh in loadedMapGrhs)
            {
                AddMapGrh(mapGrh);
            }
        }
开发者ID:mateuscezar,项目名称:netgore,代码行数:16,代码来源:Map.cs

示例5: LoadBackgroundImages

        void LoadBackgroundImages(IValueReader r)
        {
            var loadedBGImages = r.ReadManyNodes<BackgroundImage>(_bgImagesNodeName, x => new BackgroundLayer(this, this, x));

            // Add the loaded background images
            foreach (var bgImage in loadedBGImages)
            {
                AddBackgroundImage(bgImage);
            }
        }
开发者ID:mateuscezar,项目名称:netgore,代码行数:10,代码来源:Map.cs

示例6: ReadState

 /// <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)
 {
     _questDescriptions.Clear();
     var nodes = reader.ReadManyNodes(_questDescriptionsNodeName, r => new QuestDescription(r));
     foreach (var n in nodes)
     {
         _questDescriptions.Insert(n.QuestID.GetRawValue(), n);
     }
 }
开发者ID:mateuscezar,项目名称:netgore,代码行数:14,代码来源:QuestDescriptionCollection.cs

示例7: Read

 public void Read(IValueReader reader, ContentPaths contentPath)
 {
     var loadedFrames = reader.ReadManyNodes(_framesNodeName, x => new SkeletonFrame(x, contentPath));
     _keyFrames = loadedFrames;
 }
开发者ID:mateuscezar,项目名称:netgore,代码行数:5,代码来源:SkeletonSet.cs

示例8: ColumnSchema

 /// <summary>
 /// Initializes a new instance of the <see cref="ColumnSchema"/> class.
 /// </summary>
 /// <param name="reader">The <see cref="IValueReader"/> to read the values from.</param>
 public ColumnSchema(IValueReader reader)
 {
     var values = reader.ReadManyNodes(_valuesNodeName, ReadKVP);
     _values = values.ToDictionary(x => x.Key, x => x.Value);
 }
开发者ID:mateuscezar,项目名称:netgore,代码行数:9,代码来源:ColumnSchema.cs

示例9: ReadState

        /// <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 override void ReadState(IValueReader reader)
        {
            base.ReadState(reader);

            CreateSlots();

            var slotValues = reader.ReadManyNodes("QuickBarItems", QuickBarSlotValues.Read);

            foreach (var sv in slotValues)
            {
                if (sv.Slot < _slots.Length)
                    _slots[sv.Slot].SetQuickBar(sv.Type, sv.Value);
            }
        }
开发者ID:mateuscezar,项目名称:netgore,代码行数:19,代码来源:QuickBarForm.cs

示例10: ReadState

        /// <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));
        }
开发者ID:wtfcolt,项目名称:game,代码行数:26,代码来源:ParticleEffect.cs

示例11: TableSchema

 /// <summary>
 /// Initializes a new instance of the <see cref="TableSchema"/> class.
 /// </summary>
 /// <param name="reader">The <see cref="IValueReader"/> to read the values from.</param>
 public TableSchema(IValueReader reader)
 {
     _tableName = reader.ReadString(_tableNameValueKey);
     _columns = reader.ReadManyNodes(_columnsNodeName, r => new ColumnSchema(r)).ToCompact();
 }
开发者ID:mateuscezar,项目名称:netgore,代码行数:9,代码来源:TableSchema.cs

示例12: SchemaReader

 /// <summary>
 /// Initializes a new instance of the <see cref="SchemaReader"/> class.
 /// </summary>
 /// <param name="reader">The <see cref="IValueReader"/> to read the values from.</param>
 public SchemaReader(IValueReader reader)
 {
     _tableSchemas = reader.ReadManyNodes(_tablesNodeName, r => new TableSchema(r)).ToCompact();
 }
开发者ID:wtfcolt,项目名称:game,代码行数:8,代码来源:SchemaReader.cs

示例13: Read

        /// <summary>
        /// Reads the <see cref="BodyInfoManager"/> data from an <see cref="IValueReader"/>.
        /// </summary>
        /// <param name="reader">The <see cref="IValueReader"/> to read the <see cref="BodyInfoManager"/> data from.</param>
        public void Read(IValueReader reader)
        {
            var bodies = reader.ReadManyNodes(_bodyNodeName, BodyInfo.Read);
            _bodies.Clear();

            foreach (var body in bodies)
            {
                _bodies.Add(body.ID, body);
            }
        }
开发者ID:mateuscezar,项目名称:netgore,代码行数:14,代码来源:BodyInfoManager.cs

示例14: Read

 public void Read(IValueReader reader)
 {
     _items = reader.ReadManyNodes(_itemsNodeName, x => new SkeletonBodyItemInfo(x));
 }
开发者ID:mateuscezar,项目名称:netgore,代码行数:4,代码来源:SkeletonBodyInfo.cs

示例15: Read

        /// <summary>
        /// Reads the values for this NPCChatDialogItemBase from an IValueReader.
        /// </summary>
        /// <param name="reader">IValueReader to read the values from.</param>
        protected void Read(IValueReader reader)
        {
            var id = reader.ReadNPCChatDialogItemID("ID");
            var title = reader.ReadString("Title");
            var text = reader.ReadString("Text");
            var isBranch = reader.ReadBool("IsBranch");

            var responses = reader.ReadManyNodes("Responses", CreateResponse);

            NPCChatConditionalCollectionBase conditionals = null;
            if (isBranch)
            {
                var cReader = reader.ReadNode("Conditionals");
                var hasConditionals = cReader.ReadBool("HasConditionals");
                if (hasConditionals)
                {
                    conditionals = CreateConditionalCollection();
                    if (conditionals != null)
                        conditionals.Read(cReader);
                }
            }

            SetReadValues(id, title, text, isBranch, responses, conditionals);

            AssertBranchHasTwoResponses();
            AssertNonBranchHasNoConditionals();
            AssertResponsesHaveValidValues();
        }
开发者ID:mateuscezar,项目名称:netgore,代码行数:32,代码来源:NPCChatDialogItemBase.cs


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