Inheritance: DialogueNode
Ejemplo n.º 1
0
        private DialogueNode VisitLoopDialogueNode(DialogueNode pPrevious)
        {
                        #if DEBUG_WRITE
            Console.WriteLine("VisitLoopDialogueNode()");
                        #endif

            match(Token.TokenType.LOOP);

            LoopDialogueNode n = _dialogueRunner.Create <LoopDialogueNode>(_conversationName, _language, (_nodeCounter++).ToString() + " (loop)");
            AddLinkFromPreviousNode(pPrevious, n);

            //ImmediateNode finalNode = _dialogueRunner.Create<ImmediateNode>(_conversationName, _language, (_nodeCounter++).ToString() + "(final node)");
            //n.nextNode = finalNode.name;

            AllowLineBreak();

            _loopStack.Push(n);
            match(Token.TokenType.BLOCK_BEGIN);

            ImmediateNode branchStartNode = _dialogueRunner.Create <ImmediateNode>(_conversationName, _language, (_nodeCounter++).ToString() + " (loop branch node)");
            n.branchNode = branchStartNode.name;

            SilentDialogueNode unifiedEndNode = _dialogueRunner.Create <SilentDialogueNode>(_conversationName, _language, (_nodeCounter++).ToString() + " (unified end node for loop)");
            Nodes(branchStartNode, unifiedEndNode);

            match(Token.TokenType.BLOCK_END);
            _loopStack.Pop();

            return(n);
        }
Ejemplo n.º 2
0
        public override void Update(float dt)
        {
            Stop();
            LoopDialogueNode targetLoopDialogueNode = _dialogueRunner.GetDialogueNode(conversation, breakTargetLoop) as LoopDialogueNode;

            if (targetLoopDialogueNode == null)
            {
                throw new GrimmException("targetLoopDialogueNode was not of type LoopDialogueNode");
            }
            targetLoopDialogueNode.Break();
            //StartNextNode();
        }
Ejemplo n.º 3
0
        private void PrintLoopDialogueNode(LoopDialogueNode pLoopNode)
        {
            Indentation();

            _output.Append("LOOP{\n");

            _indentationLevel++;
            DialogueNode branchStartNode = _dialogueRunner.GetDialogueNode(_conversation, pLoopNode.branchNode);

            SwitchOnNode(branchStartNode);
            _indentationLevel--;

            _output.Append("}\n");

            DialogueNode nextNode = _dialogueRunner.GetDialogueNode(_conversation, pLoopNode.nextNode);

            SwitchOnNode(nextNode);
        }
Ejemplo n.º 4
0
        private void PrintLoopDialogueNode(LoopDialogueNode pLoopNode)
        {
            Indentation();

            _output.Append("LOOP{\n");

            _indentationLevel++;
            DialogueNode branchStartNode = _dialogueRunner.GetDialogueNode(_conversation, pLoopNode.branchNode);
            SwitchOnNode(branchStartNode);
            _indentationLevel--;

            _output.Append("}\n");

            DialogueNode nextNode = _dialogueRunner.GetDialogueNode(_conversation, pLoopNode.nextNode);
            SwitchOnNode(nextNode);
        }