本文整理汇总了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);
}
示例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;
}
}
示例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;
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例7: Read
public void Read(IValueReader reader, ContentPaths contentPath)
{
var loadedFrames = reader.ReadManyNodes(_framesNodeName, x => new SkeletonFrame(x, contentPath));
_keyFrames = loadedFrames;
}
示例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);
}
示例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);
}
}
示例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));
}
示例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();
}
示例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();
}
示例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);
}
}
示例14: Read
public void Read(IValueReader reader)
{
_items = reader.ReadManyNodes(_itemsNodeName, x => new SkeletonBodyItemInfo(x));
}
示例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();
}