/** * Checks if there is a "go-back" tag in the given node. This is, if the * node is a DialogueNode, and is linked to the OptionNode from which came * from * * @param node * Node (must be a DialogueNode) to check * @return True if the node has a "go-back" tag, false otherwise */ public static bool thereIsGoBackTag(ConversationNodeView node) { bool goBackTag = false; // Perform the check only if the node is a DialogueNode and it has a child if (node.getType() == ConversationNodeViewEnum.DIALOGUE && node.getChildCount() > 0) { ConversationNodeView possibleFather = node.getChildView(0); // For each child of the possible father node, check if it match with the possible child for (int i = 0; i < possibleFather.getChildCount(); i++) if (possibleFather.getChildView(i) == node) goBackTag = true; } return goBackTag; }
/** * Checks if there is a "go-back" tag in the given node. This is, if the * node is a DialogueNode, and is linked to the OptionNode from which came * from * * @param node * Node (must be a DialogueNode) to check * @return True if the node has a "go-back" tag, false otherwise */ public static bool thereIsGoBackTag(ConversationNodeView node) { bool goBackTag = false; // Perform the check only if the node is a DialogueNode and it has a child if (node.getType() == ConversationNodeViewEnum.DIALOGUE && node.getChildCount() > 0) { ConversationNodeView possibleFather = node.getChildView(0); // For each child of the possible father node, check if it match with the possible child for (int i = 0; i < possibleFather.getChildCount(); i++) { if (possibleFather.getChildView(i) == node) { goBackTag = true; } } } return(goBackTag); }