Ejemplo n.º 1
0
        /// <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);
        }
Ejemplo n.º 2
0
 public void UnsetResponse()
 {
     _response = null;
     Text = string.Empty;
 }
Ejemplo n.º 3
0
            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;
            }
Ejemplo n.º 4
0
        /// <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;
        }