本文整理汇总了C#中IValueReader.ReadNPCChatDialogItemID方法的典型用法代码示例。如果您正苦于以下问题:C# IValueReader.ReadNPCChatDialogItemID方法的具体用法?C# IValueReader.ReadNPCChatDialogItemID怎么用?C# IValueReader.ReadNPCChatDialogItemID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IValueReader
的用法示例。
在下文中一共展示了IValueReader.ReadNPCChatDialogItemID方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Read
/// <summary>
/// Reads the values for this NPCChatResponseBase from an IValueReader.
/// </summary>
/// <param name="reader">IValueReader to read the values from.</param>
protected void Read(IValueReader reader)
{
var value = reader.ReadByte("Value");
var page = reader.ReadNPCChatDialogItemID("Page");
var text = reader.ReadString("Text");
var actionNames = reader.ReadMany("Actions", ((r, name) => r.ReadString(name)));
var actions = GetActionsFromNames(actionNames);
var cReader = reader.ReadNode("Conditionals");
var hasConditionals = cReader.ReadBool("HasConditionals");
NPCChatConditionalCollectionBase conditionals = null;
if (hasConditionals)
{
conditionals = CreateConditionalCollection();
if (conditionals != null)
conditionals.Read(cReader);
}
SetReadValues(value, page, text, conditionals, actions);
}
示例2: 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();
}