GetEncountersWithInEdge() public method

public GetEncountersWithInEdge ( string inEdgeName ) : List
inEdgeName string
return List
Exemplo n.º 1
0
        protected override void UpdateOutEdges(Graph graph)
        {
            GameMasterNode arcFile = NodeFile.Owner;
            ArcNodeData    arc     = arcFile?.NodeData as ArcNodeData;

            if (arc != null)
            {
                foreach (string inEdgeName in mOutEdgeStrings)
                {
                    List <GameMasterNode> linkedEncounters = arc.GetEncountersWithInEdge(inEdgeName);
                    if (linkedEncounters.Count == 1 && linkedEncounters[0].Name.Equals(inEdgeName))
                    {
                        if (mChoiceEdgeInfo.ContainsKey(inEdgeName))
                        {
                            foreach (string choice in mChoiceEdgeInfo[inEdgeName])
                            {
                                Node choiceNode = graph.AddNode(NodeFile.Id + "#" + choice);
                                choiceNode.LabelText = '"' + choice + '"';
                                MakeNodePrivate(choiceNode);
                                graph.AddEdge(NodeFile.Id, choiceNode.Id).UserData            = inEdgeName;
                                graph.AddEdge(choiceNode.Id, linkedEncounters[0].Id).UserData = inEdgeName;
                            }
                        }
                        else
                        {
                            graph.AddEdge(NodeFile.Id, linkedEncounters[0].Id).UserData = inEdgeName;
                        }
                    }
                    else
                    {
                        Node arcOutNode = graph.AddNode(arcFile.Id + "#" + inEdgeName);
                        arcOutNode.LabelText = inEdgeName;
                        MakeNodePrivate(arcOutNode);
                        if (mChoiceEdgeInfo.ContainsKey(inEdgeName))
                        {
                            foreach (string choice in mChoiceEdgeInfo[inEdgeName])
                            {
                                Node choiceNode = graph.AddNode(NodeFile.Id + "#" + choice);
                                choiceNode.LabelText = '"' + choice + '"';
                                MakeNodePrivate(choiceNode);
                                graph.AddEdge(NodeFile.Id, choiceNode.Id).UserData   = inEdgeName;
                                graph.AddEdge(choiceNode.Id, arcOutNode.Id).UserData = inEdgeName;
                            }
                        }
                        else
                        {
                            graph.AddEdge(NodeFile.Id, arcOutNode.Id).UserData = inEdgeName;
                        }

                        foreach (GameMasterNode linkedEncounter in linkedEncounters)
                        {
                            graph.AddEdge(arcOutNode.Id, linkedEncounter.Id).UserData = inEdgeName;
                        }
                    }
                }
            }
        }
Exemplo n.º 2
0
        // Returns list of out edges
        private List <string> GetOutEdges()
        {
            List <string>  outEdges = new List <string>();
            GameMasterNode arcFile  = NodeFile.Owner;

            if (arcFile != null)
            {
                ArcNodeData arc = arcFile.NodeData as ArcNodeData;
                foreach (string inEdgeName in mOutEdgeStrings)
                {
                    foreach (GameMasterNode linkedEncounter in arc.GetEncountersWithInEdge(inEdgeName))
                    {
                        outEdges.Add(linkedEncounter.Id);
                    }
                }
            }

            return(outEdges);
        }