/// <summary> /// Creates a NPCChatDialogViewNode as a child of this NPCChatDialogViewNode. /// </summary> /// <param name="response">The NPCChatResponseBase the child node will handle.</param> /// <returns>A NPCChatDialogViewNode as a child of this NPCChatDialogViewNode.</returns> NPCChatDialogViewNode CreateNode(NPCChatResponseBase response) { // Check if the node already exists var children = Nodes.OfType <NPCChatDialogViewNode>(); var retNode = children.FirstOrDefault( x => x.ChatItemType == NPCChatDialogViewNodeItemType.Response && x.ChatItemAsResponse == response); if (retNode == null) { retNode = new NPCChatDialogViewNode(this, response); } return(retNode); }
public void UnsetResponse() { _response = null; Text = string.Empty; }
public void SetResponse(NPCChatResponseBase response, int index) { if (response == null) { Debug.Fail("Parameter 'response' should never be null. Use UnsetResponse() instead."); UnsetResponse(); return; } _response = response; Text = (index + 1) + ": " + Response.Text; }
/// <summary> /// Creates a NPCChatDialogViewNode as a child of this NPCChatDialogViewNode. /// </summary> /// <param name="response">The NPCChatResponseBase the child node will handle.</param> /// <returns>A NPCChatDialogViewNode as a child of this NPCChatDialogViewNode.</returns> NPCChatDialogViewNode CreateNode(NPCChatResponseBase response) { // Check if the node already exists var children = Nodes.OfType<NPCChatDialogViewNode>(); var retNode = children.FirstOrDefault( x => x.ChatItemType == NPCChatDialogViewNodeItemType.Response && x.ChatItemAsResponse == response); if (retNode == null) retNode = new NPCChatDialogViewNode(this, response); return retNode; }