public void VisitNodeResponseDialogue(NodeResponseDialogue nrd)
        {
            UsedCharacters.Add(nrd.Character);

            var targetIndex = _scene.Nodes.IndexOf(nrd.ResponseMap[0].Target);

            if (targetIndex == -1)
            {
                Report.AddMessage(ProjectReportMessage.MessageSeverity.Error, "Extra ferocious raptors dispatched.", nrd);
                Running = false;
            }
            Position = targetIndex;

            foreach (var response in nrd.ResponseMap.Skip(1))
            {
                var target = _scene.Nodes.IndexOf(response.Target);

                if (target == -1)
                {
                    Report.AddMessage(ProjectReportMessage.MessageSeverity.Error, "Extra ferocious raptors dispatched.", nrd);
                    continue;
                }

                var clone = Clone();
                clone.Position = target;
                _parent.AddInterpreter(clone);
            }
        }
        public void VisitNodeMovement(NodeMovement nm)
        {
            UsedCharacters.Add(nm.Character);

            if (OutputState.Characters.ContainsKey(nm.MovementDirection)) // Operating on current module characters
            {
                switch (nm.MovementType)
                {
                case NodeMovement.MovementTypeEnum.Enter:
                    if (OutputState.Characters.ContainsKey(nm.MovementDirection) && OutputState.Characters[nm.MovementDirection] != null)
                    {
                        Report.AddMessage(ProjectReportMessage.MessageSeverity.Error, "A movement node is adding a character to an occupied location.", nm);
                    }
                    if (OutputState.Characters.ContainsValue(nm.Character))
                    {
                        Report.AddMessage(ProjectReportMessage.MessageSeverity.Error, "A movement node is adding a character that is already in the scene.", nm);
                    }
                    else
                    {
                        OutputState.Characters[nm.MovementDirection] = nm.Character;
                    }
                    break;

                case NodeMovement.MovementTypeEnum.Exit:
                    if (!OutputState.Characters.ContainsKey(nm.MovementDirection) || OutputState.Characters[nm.MovementDirection] == null)
                    {
                        Report.AddMessage(ProjectReportMessage.MessageSeverity.Error, "Movement node is removing character from side with no present characters.", nm);
                    }
                    else if (OutputState.Characters[nm.MovementDirection] != nm.Character)
                    {
                        Report.AddMessage(ProjectReportMessage.MessageSeverity.Error, "A movement node is removing a character from the wrong side or another character overwrote it.", nm);
                    }
                    else
                    {
                        OutputState.Characters[nm.MovementDirection] = null;
                    }
                    break;
                }
            }
            else // Operating on caller characters
            {
                switch (nm.MovementType)
                {
                case NodeMovement.MovementTypeEnum.Enter:
                    InputState.Characters[nm.MovementDirection]  = null;
                    OutputState.Characters[nm.MovementDirection] = nm.Character;
                    break;

                case NodeMovement.MovementTypeEnum.Exit:
                    InputState.Characters[nm.MovementDirection]  = nm.Character;
                    OutputState.Characters[nm.MovementDirection] = null;
                    break;
                }
            }
        }
示例#3
0
        public void VisitNodeMovement(NodeMovement nm)
        {
            UsedCharacters.Add(nm.Character);

            switch (nm.MovementType)
            {
            case NodeMovement.MovementTypeEnum.Exit:
                if (!PresentCharacters.Contains(nm.Character))
                {
                    Report.AddMessage(ProjectReportMessage.MessageSeverity.Error, "A movement node is removing a character that is not in the scene.", nm);
                }
                else
                {
                    PresentCharacters.Remove(nm.Character);
                }

                if (!PresentCharactersSide.ContainsKey(nm.MovementDirection) || PresentCharactersSide[nm.MovementDirection] != nm.Character)
                {
                    Report.AddMessage(ProjectReportMessage.MessageSeverity.Error, "A movement node is removing a character from the wrong side or another character overwrote it.", nm);
                }
                else
                {
                    PresentCharactersSide.Remove(nm.MovementDirection);
                }
                break;

            case NodeMovement.MovementTypeEnum.Enter:
                if (PresentCharacters.Contains(nm.Character))
                {
                    Report.AddMessage(ProjectReportMessage.MessageSeverity.Error, "A movement node is adding a character that is already in the scene.", nm);
                }
                else
                {
                    PresentCharacters.Add(nm.Character);
                }

                if (PresentCharactersSide.ContainsKey(nm.MovementDirection))
                {
                    Report.AddMessage(ProjectReportMessage.MessageSeverity.Error, "A movement node is adding a character to an occupied location.", nm);
                }
                else
                {
                    PresentCharactersSide.Add(nm.MovementDirection, nm.Character);
                }
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(nm.MovementType), nm.MovementType, null);
            }
        }
 public void VisitNodeDialogue(NodeDialogue nd)
 {
     UsedCharacters.Add(nd.Character);
 }
 public void VisitNodeChangePose(NodeChangePose ncp)
 {
     UsedCharacters.Add(ncp.Character);
     UsedPoses.Add(ncp.Pose);
 }
示例#6
0
 public void VisitNodeResponseDialogue(NodeResponseDialogue nrd)
 {
     UsedCharacters.Add(nrd.Character);
 }